added dutyCycle to menuManualControl
This commit is contained in:
@@ -159,7 +159,7 @@ bool MotorControl::isAccelerationNegative() {
|
||||
|
||||
void MotorControl::setRealPower(int8_t power) {
|
||||
//TODO: Exceptionhandling
|
||||
if (power <= 100 || power <= -100) {
|
||||
if (power <= 100 && power >= -100) {
|
||||
this->power = power;
|
||||
} else {
|
||||
return;
|
||||
@@ -170,6 +170,7 @@ void MotorControl::setRealPower(int8_t power) {
|
||||
digitalWrite(this->dir_1, LOW);
|
||||
digitalWrite(this->dir_2, LOW);
|
||||
ledcWrite(this->pwm_channel, 0);
|
||||
this->dutycycle = 0;
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -186,6 +187,7 @@ void MotorControl::setRealPower(int8_t power) {
|
||||
}
|
||||
|
||||
ledcWrite(this->pwm_channel, pwm_val);
|
||||
this->dutycycle = pwm_val;
|
||||
}
|
||||
|
||||
void MotorControl::increasePower(int8_t power) {
|
||||
|
||||
Reference in New Issue
Block a user