Browse Source

Invert motor pins

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

10
src/main.cpp

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

Loading…
Cancel
Save