“SensorMotion.setFullScaleGyroRange()”的版本间的差异
Machine1987(讨论 | 贡献) |
Machine1987(讨论 | 贡献) |
||
| (未显示同一用户的1个中间版本) | |||
| 第22行: | 第22行: | ||
Serial.begin(115200); | Serial.begin(115200); | ||
motion.begin(); | motion.begin(); | ||
| − | setFullScaleGyroRange(GYRO_FS_1000); | + | motion.setFullScaleGyroRange(GYRO_FS_1000); |
} | } | ||
| 第34行: | 第34行: | ||
</pre> | </pre> | ||
| − | + | <br> | |
| + | <p style="color: #E87E05;font-size:135%">其他</p> | ||
| + | *[[sensorMotion()]] | ||
| + | *[[sensorMotion.begin()|begin()]] | ||
| + | *[[sensorMotion.getData()|getData()]] | ||
| + | *[[sensorMotion.setFullScaleAccelRange()|setFullScaleAccelRange()]] | ||
| + | <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:37的最新版本
sensorMotion.setFullScaleGyroRange(uint8_t _range)
- 作用:
设置Sensor_Motion的角速度计量程
- 参数:
_range:角速度计量程,取值范围是GYRO_FS_250、GYRO_FS_500、GYRO_FS_1000、GYRO_FS_2000,分别代表满量程时250、500、1000、2000°/s的检测上限。
- 例子:这里以俯仰角输出为例
#include <Sensor_Motion.h>
sensorMotion motion(&Serial1);
float ypr[3];
void setup(){
Serial.begin(115200);
motion.begin();
motion.setFullScaleGyroRange(GYRO_FS_1000);
}
void loop(){
if(motion.get_data(MOTION_3, ypr)){
Serial.println(ypr[1]);
delay(100);
}
}
其他