SHARE
TWEET

Untitled

a guest Sep 19th, 2019 88 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. #include <M5Stack.h>
  2.  
  3. #define PIN_SW 2
  4.  
  5.  
  6. void setup() {
  7.   M5.begin();
  8.   M5.Lcd.fillScreen(BLACK);
  9.  
  10.   pinMode(PIN_SW, INPUT_PULLUP);
  11. }
  12.  
  13. void loop() {
  14.   M5.update();
  15.  
  16.   M5.Lcd.setCursor(10, 30);
  17.   M5.Lcd.setTextSize(10);
  18.   if(digitalRead(PIN_SW) == LOW) {
  19.     M5.Lcd.println("ON  ");
  20.   } else {
  21.     M5.Lcd.println("OFF ");
  22.   }
  23.   delay(500);
  24. }
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top