Created
June 2, 2021 18:51
-
-
Save loginov-rocks/4ea1348e0f6a6a279ee8fb320b93696c to your computer and use it in GitHub Desktop.
DIY Connected Espresso Machine: Relays (Part 2) - main.cpp
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include "Relay.h" | |
#define SERIAL_BAUDRATE 9600 | |
#define RELAY_PIN 2 | |
Relay relay(RELAY_PIN); | |
void setup() { | |
Serial.begin(SERIAL_BAUDRATE); | |
Serial.print("Relay state: "); | |
Serial.println(relay.getState()); | |
} | |
void loop() { | |
relay.toggle(); | |
Serial.print("Relay state: "); | |
Serial.println(relay.getState()); | |
delay(1000); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment