I set up a simple accelerometer test to try out the accelerometer but my application isn't works i declared a CGPoint and a UIImageVeiw in the .h file and set up the accelerometer to update:
and then told the CGPoint x and y axes's to update to the accelerometer axes's and then told the UIImageVeiw to say in the center of the CGPoint:
but when I run it on my iPhone The circle (the UIImageVeiw) just stays in the center. Please Help
HTML:
[[UIAccelerometer sharedAccelerometer] setUpdateInterval:(1.0 / kAccelerometerFrequency)];
[[UIAccelerometer sharedAccelerometer] setDelegate:self];
HTML:
- (void)accelerometer:(UIAccelerometer *)accelerometer didAccelerate:(UIAcceleration *)acceleration {
// Update the accelerometer graph view
deviceTilt.x = acceleration.x;
deviceTilt.y = acceleration.y;
Circle.center = deviceTilt;
}