问题
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