You guys sure like to make things hard on yourselves. Use sprintf to format whatever style of number you want, then just display each character one at a time.
Quzah.
You guys sure like to make things hard on yourselves. Use sprintf to format whatever style of number you want, then just display each character one at a time.
Quzah.
Hope is the first step on the road to disappointment.
hi quzah..
sorry.. im quite new to C... wat is a sprintf?
my display wont work with printf, %d, %f % etc.. so i think sprintf wont work too...
so now what i need is to get two seperate integer
so i could put into my display.
help pls.....
sprintf prints to a buffer (string), not to an output device (stdout). If I wanted to store the number 1234 in a string, instead of printing it on the screen, I could use sprintf to store it in a string of characters, instead of storing it as an integer. Grab your book, or the nearest search engine, and look up sprintf.
Quzah.
Hope is the first step on the road to disappointment.
could anyone help me using some coding to my question?
thank you.
In post #29 I wanted to see if the logic was right for the ADC.
No need to run it on your device - just see if it's right, on your computer.
As noted above by Quzah, the sprintf() function could be very useful.
Could sprintf(), be used on your device?
I didn't think so, since it has no printf(), but it's too important a question not to ask.
never mind guys.. i did it with a simple code..
d3 = opvalue_d1 * 30 / 255;
d1 = d3 / 10 + '0';
d2 = d3 % 10 + '0';