mirror of
https://github.com/alexandrebobkov/ESP-Nodes.git
synced 2025-08-18 06:57:42 +00:00
24 lines
376 B
C
24 lines
376 B
C
#ifndef MOTOR_CONTROLS_H
|
|
#define MOTOR_CONTROLSC_H
|
|
|
|
// Interpolate value (x) based on raw reading, min/max limits.
|
|
/*
|
|
|
|
Joystick scale: 4096 2048 0
|
|
*/
|
|
static int interpolate_raw_val (int raw) {
|
|
int x;
|
|
|
|
x = 4096 - raw;
|
|
|
|
return x;
|
|
}
|
|
/*static int interpolate_raw_val (int min, int max, int raw) {
|
|
int x;
|
|
|
|
x = raw - 8191;
|
|
|
|
return x;
|
|
}*/
|
|
|
|
#endif |