void setup() {
// put your setup code here, to run once:
volatile char *dirf,*dirk,x;
volatile char *outf,*ink;
volatile long m;
dirf=0x30,dirk=107;
outf=0x31,ink=0x106;
*dirf=0x01,*dirk=0x01;
int b ,a;
while(1){
x = *ink;
// this code will Glow 1st LED to 4th LED
if ((x ==0x01 )){
x=0x00;
for( int i = 0; i < 4; i++){
x=(x << 1 | 0x01) ;
*outf=x;
for(m=0;m<200000;m++);
}
}
else if ((x ==0x02) ){
x=0x10;
*outf=0xA;
}
*if ((x == (x&0x0F)) ){
*outf=x;
}
else if ((x ==0x08) ){
*outf=x;
}
else
{
*outf= 0x00;
*/
}
}
void loop() {
// put your main code here, to run repeatedly:
}