mirror of
https://github.com/ShikyC/Taiko-Drum-Controller-Arduino.git
synced 2024-11-12 00:50:46 +01:00
No need to use pow() here
This commit is contained in:
parent
0b588ea3cb
commit
56a379b7c4
@ -126,10 +126,7 @@ void loop() {
|
|||||||
}
|
}
|
||||||
lastPower[p][i] = power[p][i];
|
lastPower[p][i] = power[p][i];
|
||||||
#else
|
#else
|
||||||
float x2 = sensitivities[p][i] * sensitivities[p][i];
|
float v = power[p][i] * sensitivities[p][i];
|
||||||
float x3 = x2 * sensitivities[p][i];
|
|
||||||
float x4 = x3 * sensitivities[p][i];
|
|
||||||
float v = power[p][i] * (1.0 + sensitivities[p][i] + 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