void setup() {
// put your setup code here, to run once:
volatile unsigned long int *ind=0x29,*ddrb=0x24,*ddrd=0x2a,*outb=0x25,*outd=0x2b,i=1,m;
*ddrb=0xff;
*ddrd=0xf0;
volatile unsigned long int j=32,tot=0,k=0,fl,l;
while(1){
// *outb=0x0f;
fl=0;
while(fl!=1){
while(k<i){
if(k==6){
*outd=128;
// *outb=0xff;
for(m=0;m<70000;m++);
*outd=0;
*outb=0;
fl=1;
break;
}
tot=tot+j;
l=(*ind & 0x08);
if(l!=0x08){
*outb=j;
}
else{
*outb=tot;
}
for(m=0;m<70000;m++);
j=j/2;
k++;
}
*outb=0;
for(m=0;m<70000;m++);
k=0;
i++;
tot=0;
j=32;
}
i=1;
}
}
void loop() {
// put your main code here, to run repeatedly:
}