iPhone中的加速度计范围

时间:2009-09-01 18:31:50

标签: iphone uiaccelerometer

我在我的应用程序中实现了以下方法。

- (void)accelerometer:(UIAccelerometer *)acel didAccelerate:(UIAcceleration *)aceler {
if (fabsf(aceler.x) > 1.5 || fabsf(aceler.y) > 1.5 || fabsf(aceler.z) > 1.5 || fabsf(aceler.x) < -1.5 || fabsf(aceler.y) < -1.5 || fabsf(aceler.z) < -1.5 )
{
    self.navigationItem.rightBarButtonItem=nil;
    [self showImage:nil];
}

}

=&GT;我很想知道“aceler.x的范围”。

即。什么是aceler.x / y / z的最大值

同样的最低限度? (我想,它应该是零)

先谢谢你的帮助。

2 个答案:

答案 0 :(得分:3)

快速搜索显示iPhone使用LIS302 accelerometer。我链接的数据表显示+ -2G或+ -8G。还有一个只有+ -2G的LIS302版本。从我遇到的另一个page,提到输出固定在2.37G,所以看起来他们使用的是2G模式或仅支持2G的LIS302。

答案 1 :(得分:1)

我相信最大值约为2.5克。这是我见过的最多,我记得在其他地方读过。高于此值的任何东西都将限制在2.5。