SensorLib 0.5.0
Multi-platform sensor driver library for Arduino, PlatformIO, and ESP-IDF
Loading...
Searching...
No Matches
GyroscopeUtils.hpp
Go to the documentation of this file.
1
31#pragma once
32
33#include "SensorDefs.hpp"
34#include <cmath>
35
36// *INDENT-OFF*
38{
46 {
47 switch (range) {
48 case GyroFullScaleRange::FS_125_DPS: return 125.0f;
49 case GyroFullScaleRange::FS_250_DPS: return 250.0f;
50 case GyroFullScaleRange::FS_500_DPS: return 500.0f;
51 case GyroFullScaleRange::FS_1000_DPS: return 1000.0f;
52 case GyroFullScaleRange::FS_2000_DPS: return 2000.0f;
53 case GyroFullScaleRange::FS_4000_DPS: return 4000.0f;
54 default: break;
55 }
56 return 500.0f; // Default fallback
57 }
58}
59// *INDENT-ON*
@license MIT License
GyroFullScaleRange
Enumeration of gyroscope full-scale range settings.
@ FS_2000_DPS
±2000 °/s
@ FS_1000_DPS
±1000 °/s
@ FS_4000_DPS
±4000 °/s (if supported)
@ FS_250_DPS
±250 °/s
@ FS_500_DPS
±500 °/s
@ FS_125_DPS
±125 °/s
float rangeToDegreesPerSecond(GyroFullScaleRange range)
Convert full-scale range enumeration to degrees per second value.