This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

sprintf bugs

heyyy guyss,,,

i am using kiel4 c51 compiler and using 89c51 uC with ads1230 20 bit serial adc and an lcd.i want to show the data of adc as a float value on lcd.i am using sprintf function but it is not working.wenever i use it the program doesnt run, even on the compiler.i cant understand y it is happening.wen i delete only sprintf function, program runs..i am using usual routine of it as shown in the help menu.

void print_ADC()
{

char buffer[20];

char timer3;

if(++timer3<50) {

timer3=0;

sprintf(buffer,"%f\n",adc_data);

LCD_command(0xc4);

LCD_sendstring(buffer);

}

}

will anyone help me asap.

Parents
  • i am using sprintf function but it is not working.

    That's not a very helpful problem description.

    By the way, what's with the timer3 variable? The code looks so wrong. There is no point in trying to figure anything out when the basics are wrong.

Reply
  • i am using sprintf function but it is not working.

    That's not a very helpful problem description.

    By the way, what's with the timer3 variable? The code looks so wrong. There is no point in trying to figure anything out when the basics are wrong.

Children