arduino: TSV telemetry protocol with mock RPM/gear
- null-terminated TSV frame: V_bat, IMU (9 fields), RPM, gear - mock RPM ramps 800-8000, gear derived from RPM bands - voltage calibration offset - PROTOCOL.md documents wire format Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
19
arduino/main/rpm.cpp
Normal file
19
arduino/main/rpm.cpp
Normal file
@@ -0,0 +1,19 @@
|
||||
#include "rpm.h"
|
||||
#include <Arduino.h>
|
||||
|
||||
// Mock RPM: ramps up/down between idle and redline
|
||||
static int _rpm = 800;
|
||||
|
||||
void rpm_init() {
|
||||
_rpm = 800;
|
||||
}
|
||||
|
||||
void rpm_update() {
|
||||
// ~100ms per call at 10Hz = takes ~7s to sweep range
|
||||
_rpm += 10;
|
||||
if (_rpm >= 8000) { _rpm = 800;}
|
||||
}
|
||||
|
||||
int rpm_get() {
|
||||
return _rpm;
|
||||
}
|
||||
Reference in New Issue
Block a user