我想找到所有侧面的倾斜度(左、右、前、后)
我使用下面的代码来查找左右
[motionManager startDeviceMotionUpdatesToQueue:[NSOperationQueue mainQueue] withHandler:^(CMDeviceMotion *deviceMotion, NSError *error)
{
if (deviceMotion.attitude.roll <= -1)
{
[self TiltControl:@"left"];
}
else if(deviceMotion.attitude.roll > 1)
{
[self TiltControl:@"right"];
}
}];
现在怎么能找到前进和后退...
找到所有 4 个倾斜的最佳方法是什么...