2

编写了一个打印加速度计输出的简单程序。

mSensorManager = (SensorManager)getSystemService(SENSOR_SERVICE);
mSensorManager.registerListener(this,mSensorManager.getDefaultSensor(Sensor.TYPE_ACCELEROMETER), SensorManager.SENSOR_DELAY_FASTEST);     

事实证明:

  1. 加速度计输出始终设置为“最低”,具体取决于:

    public void onAccuracyChanged(Sensor sensor, int accuracy) {
      if (collectingData){  
         accelPrecision.setText("accelerometer accuracy: " + accuracy);
      }
    }
    
  2. 实际的加速度计读数非常不准确——即使它放在桌子上也有大约 2%-5% 的波动

据我所知,Nexus S、Nexus One 和 G1 也存在同样的问题

知道如何使模式准确/什么设置

4

1 回答 1

0

使用过滤器。您正在查看原始数据,因此它当然会波动。诸如加权平均移动平均之类的东西就足够了。

于 2011-01-05T21:50:13.277 回答