added leds_blink

This commit is contained in:
Paul Lecuq 2016-09-03 10:37:39 +02:00
parent 157744ad92
commit f0fb7dedc7

30
leds_blink.cpp Normal file
View File

@ -0,0 +1,30 @@
const int second = 50;
void setup() {
// put your setup code here, to run once:
for(int i=13;i>=6;i--){
pinMode(i,OUTPUT);
}
}
void up(int led,int second) {
digitalWrite(led,HIGH);
delay(second);
}
void down(int led,int second) {
digitalWrite(led,LOW);
delay(second);
}
void loop() {
// put your main code here, to run repeatedly:
for(int j=13;j>=6;j--){
up(j,second);
}
for(int j=13;j>=6;j--){
down(j,second);
}
}