Created
September 17, 2015 11:00
-
-
Save elliotwoods/5f952d440b5eadccf124 to your computer and use it in GitHub Desktop.
This file contains 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
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