unsigned char list1[5]={0b10000001,0b01000010,0b00100100,0b00011000,0b00000000};
unsigned char list2[5]={0b11111111,0b11100111,0b11000011,0b10000001,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=0b00000011;
}
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);
}
}
}