unsigned char list1[5]={0b10000001,0b01000010,0b00100100,0b00011000,0b00000000};
unsigned char list2[5]={0b11111111,0b11100111,0b11000011,0b10000001,0b00000000};
unsigned char list3[9]={0b11000000,0b01100000,0b00110000,0b00011000,0b00001100,0b00000110,0b00000011,0b10000001,0b00000000};
unsigned char list4[9]={0b00000011,0b00000110,0b00001100,0b00011000,0b00110000,0b01100000,0b11000000,0b10000001,0b00000000};
unsigned char list5[7]={0b11100000,0b01110000,0b00111000,0b00011100,0b00001110,0b00000111,0b00000000};
void setup() {
// put your setup code here, to run once:
DDRD=0xFF;
// DDRD=0xFF; // The code is the same as above (this is in hexadecimal)
PORTD=0x00;
DDRB=0x00;
PORTB=0b00011111;
}
void loop() {
// put your main code here, to run repeatedly:
//if (PORTD==0x80)
if ((PINB&0b00000001)==0)
{
for(int i=0; i<5; i++)
{
PORTD=list1[i];
delay(300);
}
}
if ((PINB&0b00000010)==0)
{
for(int i=0; i<5; i++)
{
PORTD=list2[i];
delay(300);
}
}
if ((PINB&0b00000100)==0)
{
for(int i=0; i<9; i++)
{
PORTD=list3[i];
delay(300);
}
}
if ((PINB&0b00001000)==0)
{
for(int i=0; i<9; i++)
{
PORTD=list4[i];
delay(300);
}
}
if ((PINB&0b00010000)==0)
{
for(int i=0; i<7; i++)
{
PORTD=list5[i];
delay(300);
}
}
}