//2. Press 2nd switch blink 8 LEDs.
#define Delay 60000
void setup() {
// put your setup code here, to run once:
volatile char *dir_f;
volatile char *dir_k;
volatile char *out_f;
volatile char *in_k;
volatile char x;
volatile long j;
dir_f = 0x30;
out_f = 0x31;
dir_k = 0x107;
in_k = 0x106;
*dir_f = 0xff;
*dir_k = 0x00;
while(1)
{
x = *in_k;
if((x&0x04)== 0x04)//bit masking
//if(0x04 == *in_k)
{
while(1)
{
*out_f = 0xff;
for(j=0;j<Delay;j++);
*out_f = 0x00;
for(j=0;j<Delay;j++);
}
}
}
}
void loop() {
// put your main code here, to run repeatedly:
}