1

am developing one application using UIAccelerometer , and i retrived the x,y, z values . i need to mive one object (consider UIImageView) using these values.

here is my code

       UIAccelerometer *accel = [UIAccelerometer sharedAccelerometer];
         accel.delegate = self;
         accel.updateInterval = 1.0f/60.0f;

 - (void)accelerometer:(UIAccelerometer *)acel didAccelerate:(UIAcceleration *)aceler 
      {


     NSLog(@"%f %f %f",aceler.x,aceler.y,aceler.z);
 //i think here i can give the position of objects, tried object.frame.size.x=accelr.x; but which is not assignable :(



     }

what i can do for moving the object according to the accelarometer value, somethin like spirit level? and any idea how to turn the accelerometer data into degrees?

Vishnu Raj
  • 61
  • 8

0 Answers0