self.mManager = [[CMMotionManager alloc]init];

    self.mManager.deviceMotionUpdateInterval = 0.5;

    

    if (self.mManager.gyroAvailable) {

        [self.mManager startDeviceMotionUpdatesToQueue:[NSOperationQueue currentQueue] withHandler:^(CMDeviceMotion * _Nullable motion, NSError * _Nullable error) {

            NSLog(@"RotationRate X:%.2lf Y:%.2lf Z:%.2lf ",motion.userAcceleration.x,motion.userAcceleration.y,motion.userAcceleration.z);

        }];

    }

 

x轴 头 靠近 负数 Y参数
x轴 头 远离 正数

y轴 左侧 高 正数 X参数
y轴 右侧 高 负数

相关文章:

  • 2021-11-06
  • 2021-08-23
  • 2022-01-07
  • 2022-01-25
  • 2021-10-16
  • 2021-06-09
  • 2021-12-08
  • 2021-10-30
猜你喜欢
  • 2021-12-08
  • 2021-11-28
  • 2021-11-04
  • 2022-01-22
  • 2021-12-04
  • 2022-12-23
相关资源
相似解决方案