rewrite esc controller: periodic process func

This commit is contained in:
Serge Bazanski 2026-01-23 23:19:20 +01:00
parent fe8942575a
commit 06fd42430f
5 changed files with 78 additions and 113 deletions

View file

@ -1,13 +1,2 @@
pub mod afroesc;
//pub mod afroesc;
pub mod dshot;
pub enum EscState {
Starting,
Running,
Stopping,
Stop,
}
//taken from: https://docs.arduino.cc/language-reference/en/functions/math/map/
//used for the ramp up of the spincoater
pub fn arduino_map(x: i32, in_min: i32, in_max: i32, out_min: i32, out_max: i32) -> i32 {
return (x - in_min) * (out_max - out_min) / (in_max - in_min) + out_min;
}