are you sure that the file u told me about should be named delay.txt and not delay.h or delay.c ?
and this file should be saved in the same file that i saved he project in; and not the Include file located on the software main file ?
btw do u have any idea what are the following distance values(100,80,60,40,20), and how they were calculated ? :
- CODE: SELECT_ALL_CODE
if(distance>100)
{
PORTC=0B00000001;
}
else if(distance>80)
{
PORTC=0B00000010;
}
else if(distance>60)
{
PORTC=0B00000100;
}
else if(distance>40)
{
PORTC=0B00001000;
}
else if(distance>20)
{
PORTC=0B00010000;
}
}
also any idea about the formula :
distance=value*1.75616; // calculate inch value per inch = 147us with 20Mhz internal clock.
what is 1.75616 ?