void leds_off(){
for(int c = 8;c < 14; c++){
digitalWrite(c, 0);
}
}
void setup() {
// put your setup code here, to run once:
for(int i = 8;i < 14; i++){
pinMode(i, OUTPUT);
digitalWrite(i, 1);
delay(500);
}
delay(1000);
leds_off();
digitalWrite(8, 1);
pinMode(3, INPUT_PULLUP);
}
bool p_key = false;
int count = 8;
void loop() {
// put your main code here, to run repeatedly:
bool key = !digitalRead(3);
delay(50);
if (key && !p_key){
p_key = true;
}
if (!key && p_key){
p_key = false;
leds_off();
count = count + 1;
digitalWrite(count, 1);
if (count >= 13){
count = 7;
}
}
}