Public marks with tag accelerometerhttp://blogmarks.net/marks/tag/accelerometer

Medallia Blog: Fun with the iPhone accelerometerhttp://blog.medallia.com/2007/08/fun_with_the_iphone_accelerome.html
In your main application code files (myApp.h and myApp.m), just override the acceleratedInX method, like this:
myApp.h:
@interface myApp : UIApplication {
}
- (void)acceleratedInX:(float)xTilt Y:(float)yTilt Z:(float)zTilt;
myApp.m:
#import "myApp.h"
@implementation myApp
- (void)acceleratedInX:(float)xTilt Y:(float)yTilt Z:(float)zTilt
{
// do something with the tilt values, like write them to a textView
//[_textView setText:[NSString stringWithFormat:@"%f,%f,%f",xTilt,yTilt,zTilt]];
}
@end
Obviously I cut out all of the code to setup the textview and window and stuff. I'm going to post my code for the simple moving ball app over at macrumors. This was my first ever Cocoa application (I'm a C# developer) so I was kind of weary about releasing it, especially because the collision detection never worked right.2010-04-26T11:01:48Zkrutyaccelerometer, ball, iphone, code, app

In your main application code files (myApp.h and myApp.m), just override the acceleratedInX method, like this:
myApp.h:
@interface myApp : UIApplication {
}
- (void)acceleratedInX:(float)xTilt Y:(float)yTilt Z:(float)zTilt;
myApp.m:
#import "myApp.h"
@implementation myApp
- (void)acceleratedInX:(float)xTilt Y:(float)yTilt Z:(float)zTilt
{
// do something with the tilt values, like write them to a textView
//[_textView setText:[NSString stringWithFormat:@"%f,%f,%f",xTilt,yTilt,zTilt]];
}
@end
Obviously I cut out all of the code to setup the textview and window and stuff. I'm going to post my code for the simple moving ball app over at macrumors. This was my first ever Cocoa application (I'm a C# developer) so I was kind of weary about releasing it, especially because the collision detection never worked right.