arduino/leds_blink.cpp
2016-09-03 10:37:39 +02:00

31 lines
455 B
C++

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);
}
}