mirror of
https://github.com/MaSzyna-EU07/maszyna.git
synced 2026-07-22 12:49:18 +02:00
PoKeys: poprawka błędu złego wyliczania ułamka wartościa zadanej do maksymalnej. Dodanie odcinania wartości wykraczających poza podany zakres maksymalny.
This commit is contained in:
@@ -289,7 +289,10 @@ void Console::ValueSet(int x, double y)
|
|||||||
if (PoKeys55[0])
|
if (PoKeys55[0])
|
||||||
{
|
{
|
||||||
if (Global::fCalibrateOutMax[x] > 0)
|
if (Global::fCalibrateOutMax[x] > 0)
|
||||||
x = x / Global::fCalibrateOutMax[x]; // sprowadzenie do <0,1> jeśli podana maksymalna wartość
|
{
|
||||||
|
y = y / Global::fCalibrateOutMax[x]; // sprowadzenie do <0,1> jeśli podana maksymalna wartość
|
||||||
|
y = Global::CutValueToRange(0, y, Global::fCalibrateOutMax[x]);
|
||||||
|
}
|
||||||
|
|
||||||
PoKeys55[0]->PWM(
|
PoKeys55[0]->PWM(
|
||||||
x, (((((Global::fCalibrateOut[x][5] * y) + Global::fCalibrateOut[x][4]) * y +
|
x, (((((Global::fCalibrateOut[x][5] * y) + Global::fCalibrateOut[x][4]) * y +
|
||||||
|
|||||||
Reference in New Issue
Block a user