PWM rescaling

This commit is contained in:
2025-06-26 03:01:47 -04:00
parent 030e642e26
commit 88a0fb1db0

View File

@@ -20,8 +20,8 @@ static int interpolate_raw_val (int raw) {
static int rescale_raw_val (int raw) { static int rescale_raw_val (int raw) {
int s; int s;
//s = 4*raw - 8190; s = 4*raw - 8190;
s = -(raw*raw) + 4.122*raw - 8190; //s = -(raw*raw) + 4.122*raw - 8190;
//s = (8190/2048^1)*(raw - 2048)^1; // Linear rescaling //s = (8190/2048^1)*(raw - 2048)^1; // Linear rescaling
//s = (8190/1870^3)*(raw - 1870)^3; // Cubic rescaling //s = (8190/1870^3)*(raw - 1870)^3; // Cubic rescaling
return s; return s;