accelerometer range in iPhone

别说谁变了你拦得住时间么 提交于 2019-12-22 13:51:37

问题


i have implemented following method in my application.

- (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];
}

}

=> I am eager to know " The range of aceler.x ".

i.e. what would be the maximum value of aceler.x / y / z

Same way the minimum ? ( I think, it should be zero )

Thanks in advance for helping me.


回答1:


A quick search shows that the iPhone uses a LIS302 accelerometer. The datasheet I linked shows +-2G or +-8G. There is also a version of the LIS302 that only does +-2G. From another page I came across, mentions the output pegging out at 2.37G, so it appears they use the 2G mode or the LIS302 that only supports 2G.




回答2:


I believe the maximum value is around 2.5 g's. Thats the most I've seen, and I remember reading that somewhere else. Anything higher than that will get capped at 2.5.



来源:https://stackoverflow.com/questions/1363935/accelerometer-range-in-iphone

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!