Leistungsvorgabe jetzt in Schritten und nicht mehr in Prozent

This commit is contained in:
Bernhard
2026-01-17 19:14:44 +01:00
parent c16ac482bd
commit 1b265c71f0
4 changed files with 35 additions and 27 deletions

View File

@@ -197,22 +197,22 @@ void IO_DoCyclic()
{
mylog(LOG_INFO, "IO: KEY-Plus: Start motor.");
Can_SetMotorGear(0, 1);
Can_SetMotorPower(0, MOTOR_PWR_MIN_PCT);
Can_SetMotorPower(0, 1);
}
else
{
mylog(LOG_INFO, "IO: KEY-Plus: Increase power.");
Can_SetMotorPower(0, motctrl[0].iMotorPowerPct + MOTOR_PWR_STEP);
Can_SetMotorPower(0, motctrl[0].iMotorPowerSteps + 1);
}
}
if (gpioKeyPwrDown.iKeyRisingEdge)
{
// minus key is pressed -> decrease power
if (motctrl[0].iMotorPowerPct > MOTOR_PWR_MIN_PCT)
if (motctrl[0].iMotorPowerSteps > 1)
{
mylog(LOG_INFO, "IO: KEY-Minus: Decrease power.");
Can_SetMotorPower(0, motctrl[0].iMotorPowerPct - MOTOR_PWR_STEP);
Can_SetMotorPower(0, motctrl[0].iMotorPowerSteps - 1);
}
else
{