void setup() {
  // put your setup code here, to run once:
volatile char *dirf, *dirk;
dirf=0x30;
*dirf=0xFF;
dirk=0x107;
*dirk=0x00;

}

void loop() {
  // put your main code here, to run repeatedly:
volatile char *out, *inp, x;
out=0x31;
inp=0x106;
while(1)
{
  x=*inp;
if((x & 0x01) == 0x01)
*out=0x01;
else
*out=0x00;
}

}