I would like to get hold of a link to some educating stuff telling how to print out data into a given number of positions in an LCD. Overwriting the end of a line causes almost random polution of other fields. Overwriting in other places ruins other printouts…..
How to print out a float, specifying either the decimals or the predecimalpoint data?
There are several methods. Probably the easiest is to use dtostrf to format the float variable to a string with the necessary precision and then print it. Another option is to do the math to separate the whole number part from the fraction part with both in int variables and print them back to back with a "." in between.
Hi and thanks Shannon Member! Karma++…..
The second, and primive, way is what I am using now. I look for something more smart. Suppose a float is 1.90. It will print using 4 display positions but if the value is 10.90 I would like to print it just as "10.9", not spilling into some other position. Overwriting the last position in a 4*20 display gives very bad results...
Where can I read how dtostrf operates?
I prefer direct reliable links to serious sites.
Using Google has given me computer crashes and loss of valuable work way too often.
Anyway, I got an idea of the Arduino Environment and its reduced capability in this respect.
Railroader:
I prefer direct reliable links to serious sites.
Using Google has given me computer crashes and loss of valuable work way too often.
I don't know what you're talking about. Millions of people use Google every day without any ill effects. But the point wasn't to send you to Google. The point was to point out that you aren't helpless to look something like that up for yourself. Don't be pitiful.
Railroader:
Anyway, I got an idea of the Arduino Environment and its reduced capability in this respect.
What do you mean? The only reduced capability is that %f is turned off by default in the printf family of functions. But even that could be re-enabled if you want it. It just takes a hell of a lot of space on your Arduino.
Delta_G:
No problem Full Member.
lmao - I enjoyed the comical response!
Anyhow, I commonly use http://www.cplusplus.com/reference/; I couldn't find it there. However, I found it here and here.
Thanks JMeller!
I joined a coarce in C-programming 1994 and the last piece of that coarce shortly talked about C++. Then I spent 14 years in C-programming…….
Using Arduino IDE is done from my C-horizon….
Thanks Guys! All the best!