Arduino additions

This commit is contained in:
Mikkeli Matlock
2026-02-01 11:47:37 +09:00
parent 559e62e292
commit f610f0fed2
4 changed files with 197 additions and 5 deletions

View File

@@ -28,4 +28,23 @@ const ImuData& imu_get_data();
// Check if IMU data is fresh (updated within timeout_ms)
bool imu_is_fresh(unsigned long timeout_ms = 200);
// Calibrate IMU - blocks for ~250ms while sampling
// Sets current orientation as zero reference
// Note: Zeroes all axes including accel (loses gravity reference)
// Revisit once mounting orientation is finalized
void imu_calibrate();
// Check if calibration has been performed
bool imu_is_calibrated();
// Send command to IMU (see IMU.md for command list)
// Common commands: 0x52 = zero yaw, 0x67 = calibrate accel
void imu_send_cmd(uint8_t cmd);
// Convenience: zero the yaw angle
inline void imu_zero_yaw() { imu_send_cmd(0x52); }
// Convenience: calibrate accelerometer (keep module level!)
inline void imu_calibrate_accel() { imu_send_cmd(0x67); }
#endif