Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <M5Stack.h>
- #define PIN_SW 2
- void setup() {
- M5.begin();
- M5.Lcd.fillScreen(BLACK);
- pinMode(PIN_SW, INPUT_PULLUP);
- }
- void loop() {
- M5.update();
- M5.Lcd.setCursor(10, 30);
- M5.Lcd.setTextSize(10);
- if(digitalRead(PIN_SW) == LOW) {
- M5.Lcd.println("ON ");
- } else {
- M5.Lcd.println("OFF ");
- }
- delay(500);
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement