void setup() {
// put your setup code here, to run once:
volatile char *dirA,*dirB,x;
volatile char *outA,*inpB;
dirA=0x21; dirB=0x24;//H port
*dirA=0xff; *dirB=0x00;
outA=0x22;inpB=0x23;
while(1)
{
x=*inpB;
if((x & 0x01)==0x01)
*outA=0x02;
else
*outA=0x00;
if((x & 0x02) == 0x02)
*outA=0x01;
else
*outA=0x00;
}
}
void loop() {
// put your main code here, to run repeatedly:
}