Browse Source

Invert motor pins

esp32ota3
ptrinchini 2 weeks ago
parent
commit
9ece9d51ff
  1. 12
      src/main.cpp

12
src/main.cpp

@ -46,8 +46,8 @@ bool ValveState = LOW;
int ButtonOpen = 16;
int ButtonClose = 19;
int MotorPin1 = 25; // estende il braccio
int MotorPin2 = 26; // ritrae il braccio
int MotorPin1 = 25; // ritrae il braccio -> valvola aperta
int MotorPin2 = 26; // estende il braccio -> valvola chiusa
WebServer server(80);
@ -155,9 +155,6 @@ void loop() {
}
client.loop();
// Update actuator state machine (non-blocking)
updateActuator();
// Handle physical buttons
int buttonOpenState = digitalRead(ButtonOpen);
int buttonCloseState = digitalRead(ButtonClose);
@ -169,7 +166,10 @@ void loop() {
if(buttonCloseState == LOW) {
closeValve();
}
// Update actuator state machine (non-blocking)
updateActuator();
server.handleClient();
}

Loading…
Cancel
Save