Created
December 11, 2015 15:16
-
-
Save WickedDevice/c8e514165546745a1323 to your computer and use it in GitHub Desktop.
Button test for Getting Started With Wearables
This file contains hidden or 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
| int buttonPin=D5; | |
| int led1=D7; | |
| void setup() { | |
| pinMode(buttonPin, INPUT_PULLUP); | |
| pinMode(led1, OUTPUT); | |
| digitalWrite(led1, HIGH);; | |
| delay(100); | |
| digitalWrite(led1, LOW); | |
| } | |
| void loop() { | |
| if(digitalRead(buttonPin) == LOW){ | |
| Particle.publish("button_status","true",60); | |
| digitalWrite(led1, HIGH);; | |
| delay(1000); | |
| digitalWrite(led1, LOW); | |
| } | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment