mirror of
https://github.com/ShikyC/Taiko-Drum-Controller-Arduino.git
synced 2024-11-12 00:50:46 +01:00
Bugfix
This commit is contained in:
parent
620ef18892
commit
80304ae65c
@ -126,11 +126,10 @@ void loop() {
|
|||||||
}
|
}
|
||||||
lastPower[p][i] = power[p][i];
|
lastPower[p][i] = power[p][i];
|
||||||
#else
|
#else
|
||||||
float x = sensitivities[p][i] / 2048.0 - 1;
|
float x2 = sensitivities[p][i] * sensitivities[p][i];
|
||||||
float x2 = x * x;
|
float x3 = x2 * sensitivities[p][i];
|
||||||
float x3 = x2 * x;
|
float x4 = x3 * sensitivities[p][i];
|
||||||
float x4 = x3 * x;
|
float v = 1.0 + sensitivities[p][i] + 0.5 * x2 + 0.166667 * x3;
|
||||||
float v = 1.0 + x + 0.5 * x2 + 0.166667 * x3;
|
|
||||||
axisValues[p][i] = AXIS_RANGE * (v >= MAX_THRES ? 1 : (v / MAX_THRES));
|
axisValues[p][i] = AXIS_RANGE * (v >= MAX_THRES ? 1 : (v / MAX_THRES));
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user