#define Delay 600000
void setup() {
// put your setup code here, to run once:
char *dir;
dir=0x30;
*dir=0xFF;
}
void loop() {
// put your main code here, to run repeatedly:
volatile char x;
volatile char *out;
out=0x31;
volatile long i;
volatile long j;
//x=128;
//*out=x;
/*for (x=0;x<8;x++){
*out=( 3 << x );
for (i=0;i<200000;i++);
}
for (x=7;x>0;x--){
*out=( 3 << x );
for(i=0;i<=200000;i++);
}*/
for(i=1;i<=255;i=(i<<1)+1)
{
*out=i;
for(j=0;j<=Delay;j++);
*out=0x00;
for(j=0;j<=Delay;j++);
}
/*for(i=1;i<=255;i=(i<<1)+1)
{
*out = i;
for(j=0;j<Delay;j++);
*out = 0x00;
for(j=0;j<Delay;j++);
}*/
//x=0;
//*out=x;
//for (i=0;i<100000;i++);
/**out=(1 << x);
for (i=0;i<=100000;i++);
}
/*01010101
10101010
00000011
11000000
1000 -8
1001 -9
1010 -A
1011 -B
1100 -C
1101 -D
1110 -E
1111 -F
00001111 -
10001101
*/
}