“SensorMotion.setFullScaleAccelRange()”的版本间的差异
Machine1987(讨论 | 贡献) |
Machine1987(讨论 | 贡献) |
||
| 第33行: | 第33行: | ||
</pre> | </pre> | ||
| + | <br> | ||
| + | <p style="color: #E87E05;font-size:135%">其他</p> | ||
| + | *[[sensorMotion()]] | ||
| + | *[[sensorMotion.begin()|begin()]] | ||
| + | *[[sensorMotion.getData()|getData()]] | ||
| + | *[[sensorMotion.setFullScaleGyroRange()|setFullScaleGyroRange()]] | ||
| + | |||
| + | <br> | ||
[[https://wiki.microduino.cn/index.php/Sensor-Motion/zh 返回Sensor_Motion语法手册]] | [[https://wiki.microduino.cn/index.php/Sensor-Motion/zh 返回Sensor_Motion语法手册]] | ||
2017年7月27日 (四) 03:38的最新版本
sensorMotion.setFullScaleAccelRange(uint8_t _range)
- 作用:
设置Sensor_Motion的加速度计量程
- 参数:
_range:加速度计量程,取值范围是ACCEL_FS_2、ACCEL_FS_4、ACCEL_FS_8、ACCEL_FS_16,分别代表满量程时2、4、8、16g的检测上限。
- 例子:这里以俯仰角输出为例
#include <Sensor_Motion.h>
sensorMotion motion(&Serial1);
float ypr[3];
void setup(){
Serial.begin(115200);
motion.begin();
motion.setFullScaleAccelRange(ACCEL_FS_4);
}
void loop(){
if(motion.get_data(MOTION_3, ypr)){
Serial.println(ypr[1]);
delay(100);
}
}
其他