//9,press one by one 1,4,7,9 key and blink 8 th LED (15 - 09 - 22)
void setup() {
// put your setup code here, to run once:
volatile long x,j,i,y;
volatile char *dirf,*dirk,*dirh;
volatile char *outf,*ink,*inh;
dirf = 0x30; dirk = 0x107; dirh = 0x101;
*dirf = 0xff; *dirk = 0x00; *dirh = 0x00;
outf = 0x31; ink = 0x106; inh = 0x100;
while(1)
{
x = *ink;
y = *inh;
if(((((x & 0x01) == 0x01) || (x & 0x10) == 0x10)|| (x & 0x80 ) == 0x80 ) || (y & 0x02) == 0x02)
{
*outf = 0x80;
for(j=0;j<1000000;j++);
}
else
{
*outf = 0x00;
}
}
}
void loop() {
// put your main code here, to run repeatedly:
}