Skip to content

Instantly share code, notes, and snippets.

@embedded-creations
Last active April 14, 2016 16:03
Show Gist options
  • Save embedded-creations/8218d5c7da6bd6e093537e840db4434e to your computer and use it in GitHub Desktop.
Save embedded-creations/8218d5c7da6bd6e093537e840db4434e to your computer and use it in GitHub Desktop.
Wakeup Light - Test receiving message using "wakeup" function
/*
* Wakeup Light - Test "wakeup" Function Only
*/
#include "InternetButton.h"
InternetButton b = InternetButton();
int wakeupHandler(String command) {
Serial.println();
Serial.print("wakeup: \"");
Serial.print(command);
Serial.println("\"");
digitalWrite(D7, HIGH);
b.allLedsOn(20,20,20);
delay(500);
digitalWrite(D7, LOW);
b.allLedsOff();
}
void setup() {
b.begin();
// drive onboard blue LED
pinMode(D7, OUTPUT);
Serial.println("startup");
Particle.function("wakeup", wakeupHandler);
b.allLedsOn(0,20,20);
delay(2000);
b.allLedsOff();
}
void loop() {
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment