Created
September 26, 2016 23:17
-
-
Save koji/d1ccd8c8334bbe9a5248eee6bca562fa 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
int loop_cnt =0; | |
void setup() { | |
// put your setup code here, to run once: | |
pinMode(13, OUTPUT); | |
pinMode(12, OUTPUT); | |
pinMode(11, OUTPUT); | |
pinMode(10, OUTPUT); | |
} | |
void loop() { | |
// put your main code here, to run repeatedly: | |
// digitalWrite(13, HIGH); | |
// digitalWrite(12, HIGH); | |
// digitalWrite(11, HIGH); | |
// digitalWrite(10, HIGH); | |
int delay_speed = 100; | |
if (loop_cnt %3 ==0) { | |
delay_speed = 1000; | |
loop_cnt = 0; | |
} | |
for( int i=13; i>=10; --i) { | |
digitalWrite(i, HIGH); | |
delay(delay_speed); | |
} | |
delay(1000); | |
for( int j=10; j<=13; ++j) { | |
digitalWrite(j, LOW); | |
delay(delay_speed); | |
} | |
loop_cnt++; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment