Skip to content

Instantly share code, notes, and snippets.

@WickedDevice
Created December 11, 2015 15:16
Show Gist options
  • Select an option

  • Save WickedDevice/c8e514165546745a1323 to your computer and use it in GitHub Desktop.

Select an option

Save WickedDevice/c8e514165546745a1323 to your computer and use it in GitHub Desktop.
Button test for Getting Started With Wearables
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