kodi.sudar
Member level 5
Do you have a LCD routine which can display a string?
Code:/* write a string of chars to the LCD */ void lcd_puts(const char * s) { while(*s) lcd_data(*s++); }
If not, implement one like the example above.
Then as I mention before simply use the sprintf() routine:
Code:#include <stdio.h> char buffer [21]; // Set size to LCD width plus one null sprintf (buffer, "ADC Value: %X", adc_val); lcd_puts(buffer);
If you require the output as an unsigned integer representation, simply change the format specifier from %X to %u.
Print formatted data to stdout
BigDog
the code works well but i wanted to display some floating point number say 21.356. it fails to display the value even after changing the representation from %x to %f or %4.2f
what change i should do to achieve that?