Accelerometer Troubles

Discussion in 'iOS Programming' started by Programmer, Jan 10, 2010.

  1. Programmer macrumors member


    Jun 16, 2009
    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:
    	[[UIAccelerometer sharedAccelerometer] setUpdateInterval:(1.0 / kAccelerometerFrequency)];
    	[[UIAccelerometer sharedAccelerometer] setDelegate:self];
    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:
    - (void)accelerometer:(UIAccelerometer *)accelerometer didAccelerate:(UIAcceleration *)acceleration {
    	// Update the accelerometer graph view
    	deviceTilt.x = acceleration.x;
    	deviceTilt.y = acceleration.y; = deviceTilt;
    but when I run it on my iPhone The circle (the UIImageVeiw) just stays in the center. Please Help
  2. Programmer thread starter macrumors member


    Jun 16, 2009
    By the way

    By the way what happens is the circle stays in the top Left corner no matter what angle the device is at

Share This Page