Skip to content

Instantly share code, notes, and snippets.

@ttseng
Created November 1, 2019 03:15
Show Gist options
  • Save ttseng/98a3c5dad8245276e4e2ae24c94a41be to your computer and use it in GitHub Desktop.
Save ttseng/98a3c5dad8245276e4e2ae24c94a41be to your computer and use it in GitHub Desktop.
if(M5.BtnA.wasReleased() || M5.BtnB.wasReleased() || M5.BtnC.wasReleased()){
M5.Lcd.setTextSize(7);
M5.Lcd.println("button pressed");
// send an update to the Glitch app to increment the counter
counterHttp.begin("https://m5stack.glitch.me/updateCounter");
int counterHttpCode = counterHttp.POST("");
if(counterHttpCode > 0){
if(counterHttpCode == HTTP_CODE_OK){
// flash the screen for confirmation
M5.Lcd.clear(BLACK);
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment