Hi all,
I am currently working on a project that requires readings from an accelerometer to be displayed on an LCD. I am operating in the liquid crystal library.
Currently all my values are being represented as integers, rather than as decimal places. Anyone got any advice on how to change this?
Thanks in advance,
Sam Thomas
Without knowing the part number of the accelerometer or the the ability to see your program, we can only guess.
I will say, that I often will read a sensor that should have a number of decimal places, then multiply it by 10 or 100 to store in a 2-byte unsigned integer. Most of the time all of those extra decimals are irrelevant, so why use up an extra two byte to store junk. To then display the values use x/10.x%10 (or x/100.x%100). Works great (for me).