Skip to content

Commit

Permalink
add led on relay
Browse files Browse the repository at this point in the history
  • Loading branch information
SeaDve committed Dec 8, 2024
1 parent fda62ab commit 10f536f
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions subproject/relay/relay.ino
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ const char *HOST_NAME = "uets-relay";

const int SERVER_PORT = 8888;

const uint8_t LED_PIN = D2;
const uint8_t RELAY_PIN = D3;

ESP8266WebServer server(SERVER_PORT);
Expand All @@ -16,6 +17,7 @@ void handle_high()
{
Serial.println("Handling high");

digitalWrite(LED_PIN, HIGH);
digitalWrite(RELAY_PIN, HIGH);
server.send(200);
}
Expand All @@ -24,6 +26,7 @@ void handle_low()
{
Serial.println("Handling low");

digitalWrite(LED_PIN, LOW);
digitalWrite(RELAY_PIN, LOW);
server.send(200);
}
Expand Down Expand Up @@ -71,6 +74,7 @@ void setup()
{
Serial.begin(9600);

pinMode(LED_PIN, OUTPUT);
pinMode(RELAY_PIN, OUTPUT);

server_setup();
Expand Down

0 comments on commit 10f536f

Please sign in to comment.