【发布时间】:2019-01-18 09:36:52
【问题描述】:
我正在开发一个安卓移动应用。我想使用提供 m/s^2 三轴输出(x、y、z)的加速度计传感器来计算振动频率。 样品: x: 9.89403849 是:5.99348859 z: 10.9458495
它是一个 React Native 应用程序,我使用库 https://react-native-sensors.github.io/docs/Usage.html 来访问传感器的输出。
constructor() {
super();
this.state = {
value: null
}
setUpdateIntervalForType(SensorTypes.accelerometer, 1000);
}
componentWillMount() {
const subscription = accelerometer.subscribe(({ x, y, z, timestamp }) =>
this.setState({
value: z
})
);
}
是否可以使用上述移动加速度计传感器的输出计算振动频率以及如何计算?
【问题讨论】:
-
通常智能手机加速度计的分辨率为 5 毫秒,因此它们可以每 5 毫秒返回一个值。所以最大可检测频率为200Hz。够你吃吗?
标签: java android react-native kotlin android-sensors