Skip to content

Commit c364b38

Browse files
committed
added basic examples
1 parent 12c3129 commit c364b38

File tree

1 file changed

+19
-0
lines changed

1 file changed

+19
-0
lines changed

examples/src/EntryPoint.cpp

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
#include "Button.hpp"
2+
#include "LED.hpp"
3+
4+
#define BAUD_RATE 115200
5+
#define BUTTON_PIN D1
6+
#define LED_PIN D2
7+
8+
Button button = Button(BUTTON_PIN);
9+
LED led = LED(LED_PIN);
10+
11+
void setup() {
12+
Serial.begin(BAUD_RATE);
13+
}
14+
15+
void loop() {
16+
if (button.isUpdated() && button.getState() == LOW) {
17+
led.changeState(!led.isTurnedOn());
18+
}
19+
}

0 commit comments

Comments
 (0)