Skip to content

Instantly share code, notes, and snippets.

@dmiddlecamp
Created December 20, 2016 21:56
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save dmiddlecamp/afe502fc2749591e8637fe986ee9533b to your computer and use it in GitHub Desktop.
Save dmiddlecamp/afe502fc2749591e8637fe986ee9533b to your computer and use it in GitHub Desktop.
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