added leds_blink
This commit is contained in:
parent
157744ad92
commit
f0fb7dedc7
30
leds_blink.cpp
Normal file
30
leds_blink.cpp
Normal 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);
|
||||
}
|
||||
}
|
Loading…
Reference in New Issue
Block a user