Skip to content

Instantly share code, notes, and snippets.

@elliotwoods
Created September 17, 2015 11:00
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 elliotwoods/5f952d440b5eadccf124 to your computer and use it in GitHub Desktop.
Save elliotwoods/5f952d440b5eadccf124 to your computer and use it in GitHub Desktop.
const int output = 13;
const int highDuration = 50;
const int lowDuration = 30;
void setup() {
pinMode(output, OUTPUT);
Serial.begin(9600);
}
void wait(int seconds) {
for(int i=0; i<seconds; i++) {
delay(1000);
Serial.print(i, DEC);
Serial.print("/");
Serial.println(seconds, DEC);
}
}
void loop() {
Serial.println("-----ON------");
digitalWrite(output, HIGH);
wait(highDuration);
Serial.println("-----OFF-----");
digitalWrite(output, LOW);
wait(lowDuration);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment