void setup() {
// put your setup code here, to run once:
volatile char*dirf;
dirf=0x30;
volatile char*outf;
outf=0x31;
// *outf=0x01;
}
void loop() {
// put your main code here, to run repeatedly:
volatile char i;
volatile long m;
volatile char*outf;
outf=0x31;
*outf=0x01;
for(m=0;m< 200000;m++);
*outf=0x02;
for(m=0;m< 200000;m++);
}
/*
3. Glow 0 to 7 LEDs with delay and 7 to 0 LEDs with delay
char a=0x00 ,b;
for( i=0;i<8;i++){
b=( ( a << 1) | 0x01);
a=b;
*outf=a;
for(m=0;m< 200000;m++);
}
*outf=0x00;
for(m=0;m< 200000;m++);
char c=0x80,e;
for( i=0;i<7;i++){
e= ( c >> 1) ;
c=e;
*outf=c;
for(m=0;m< 200000;m++);
}
}
/* 1. Glow the LEDs in following order
3,7 delay – 2,6 delay – 1,5 delay – 0,4 delay
*outf=0x88;
for(m=0;m< 500000;m++);
*outf=0x00;
for(m=0;m< 500000;m++);
*outf=0x44;
for(m=0;m< 500000;m++);
*outf=0x00;
*outf=0x22;
for(m=0;m< 500000;m++);
*outf=0x00;
/*/