using the way of the arduino map function
This commit is contained in:
parent
443da0edcf
commit
1a5c58c31c
2 changed files with 40 additions and 12 deletions
|
|
@ -1 +1,17 @@
|
|||
pub mod afroesc;
|
||||
pub mod afroesc;
|
||||
|
||||
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;
|
||||
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue