Accelerometer Troubles

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

  1. Programmer macrumors member

    Programmer

    Joined:
    Jun 16, 2009
    #1
    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:
    HTML:
    	[[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:
    HTML:
    - (void)accelerometer:(UIAccelerometer *)accelerometer didAccelerate:(UIAcceleration *)acceleration {
    	// Update the accelerometer graph view
    	deviceTilt.x = acceleration.x;
    	deviceTilt.y = acceleration.y;
        Circle.center = 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

    Programmer

    Joined:
    Jun 16, 2009
    #2
    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