amrshata
Member level 1
i writing a program to measure distance i think i have problem at that part
char txt[6];
void Display_DIST(double AMR) {
Lcd_Cmd(_LCD_CLEAR);
lcd_out(1,1,"DISTANCE= ");
floattostr(AMR,txt);
lcd_out(2,1,txt);
lcd_out(2,11,"Meter");
delay_ms(1000);
}
void main() {
double x,T,DISTANCE;
float y;
......
.....
...
.
do{
....
...
.
x=20000-x;
T=(2.5*(10^(-5)))*x;
T=T/2;
DISTANCE=(346.45)*T;
display_DIST(DISTANCE);
}
while(1);
}
char txt[6];
void Display_DIST(double AMR) {
Lcd_Cmd(_LCD_CLEAR);
lcd_out(1,1,"DISTANCE= ");
floattostr(AMR,txt);
lcd_out(2,1,txt);
lcd_out(2,11,"Meter");
delay_ms(1000);
}
void main() {
double x,T,DISTANCE;
float y;
......
.....
...
.
do{
....
...
.
x=20000-x;
T=(2.5*(10^(-5)))*x;
T=T/2;
DISTANCE=(346.45)*T;
display_DIST(DISTANCE);
}
while(1);
}
Attachments
Last edited: