mirror of
https://github.com/okalachev/flix.git
synced 2025-07-27 17:49:33 +00:00
Move motorsActive
function to motors.ino
This commit is contained in:
parent
c8109af04f
commit
0a45614751
@ -164,10 +164,6 @@ void controlTorque() {
|
|||||||
motors[3] = constrain(motors[3], 0, 1);
|
motors[3] = constrain(motors[3], 0, 1);
|
||||||
}
|
}
|
||||||
|
|
||||||
bool motorsActive() {
|
|
||||||
return motors[0] > 0 || motors[1] > 0 || motors[2] > 0 || motors[3] > 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
const char* getModeName() {
|
const char* getModeName() {
|
||||||
switch (mode) {
|
switch (mode) {
|
||||||
case MANUAL: return "MANUAL";
|
case MANUAL: return "MANUAL";
|
||||||
|
@ -46,3 +46,7 @@ void sendMotors() {
|
|||||||
ledcWrite(MOTOR_2_PIN, getDutyCycle(motors[2]));
|
ledcWrite(MOTOR_2_PIN, getDutyCycle(motors[2]));
|
||||||
ledcWrite(MOTOR_3_PIN, getDutyCycle(motors[3]));
|
ledcWrite(MOTOR_3_PIN, getDutyCycle(motors[3]));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
bool motorsActive() {
|
||||||
|
return motors[0] != 0 || motors[1] != 0 || motors[2] != 0 || motors[3] != 0;
|
||||||
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user