SensorMotion.setFullScaleGyroRange()
Machine1987(讨论 | 贡献)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);
}
}
其他