#define btn 10
void setup() {
// put your setup code here, to run once:
for(int i = 2; i <= 9; i++) pinMode(i , OUTPUT);
pinMode(btn , INPUT_PULLUP);
}
int pin[10][8] = {
{0 , 0 , 0 , 0 , 0 , 0 , 1 , 0},
{1 , 0 , 0 , 1 , 1 , 1 , 1 , 0},
{0 , 0 , 1 , 0 , 0 , 1 , 0 , 0},
{0 , 0 , 0 , 0 , 1 , 1 , 0 , 0},
{1 , 0 , 0 , 1 , 1 , 0 , 0 , 0},
{0 , 1 , 0 , 0 , 1 , 0 , 0 , 0},
{0 , 1 , 0 , 0 , 0 , 0 , 0 , 0},
{0 , 0 , 0 , 1 , 1 , 1 , 1 , 0},
{0 , 0 , 0 , 0 , 0 , 0 , 0 , 0},
{0 , 0 , 0 , 0 , 1 , 0 , 0 , 0},
};
int laststate = HIGH;
int i = 0;
void loop() {
// put your main code here, to run repeatedly:
int value = digitalRead(btn);
if(value != laststate){
laststate - value;
for(int j = 0; j < 8; j++){
digitalWrite(j+2, pin[i][j]);
}
delay(500);
i++;
i %= 10;
}
}