Last active
April 14, 2016 16:03
-
-
Save embedded-creations/8218d5c7da6bd6e093537e840db4434e to your computer and use it in GitHub Desktop.
Wakeup Light - Test receiving message using "wakeup" function
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
* 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