Created
December 20, 2016 21:56
-
-
Save dmiddlecamp/afe502fc2749591e8637fe986ee9533b to your computer and use it in GitHub Desktop.
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
bool state = false; | |
int counter = 0; | |
void setup() { | |
pinMode(D7, OUTPUT); | |
digitalWrite(D7, HIGH); | |
Serial.begin(9600); | |
} | |
void loop() { | |
counter++; | |
Serial.println("counter is " + String(counter)); | |
state = !state; | |
digitalWrite(D7, (state) ? HIGH : LOW); | |
delay(100); | |
if (counter > 100) { | |
Spark.publish("counter", String(counter)); | |
delay(1000); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment