void setup() {
// put your setup code here, to run once:
volatile char *dirk,*dirf,x,i;
volatile long j;
volatile char *out,*ink;
dirf=0x30; dirk=0x107;
out=0x31; ink=0x106;
*dirf=0x01; *dirk=0x00;
i=0;
while(1){
x= *ink;
if((x & 0x01) == 0x01){
i++;
for(j=0;j<100000;j++);// debouncing we put delay here
}
if((i%2)==0){
*out=0x01;
}
else{
*out=0x02;
}
}
}
void loop() {
// put your main code here, to run repeatedly:
}