I'm having a strange problem while trying to print to an LCD.
I have a variable that goes from 0 to 10 and I wish to print that 10000 times larger. So the actual value should go from 0 to 100000. Everything works fine up to 32767 at which point the variable shows up as negative and counting down to zero and then counts up to 32767 and so on...
This is the behaviour I would expect from an int variable, however both the variable and calculation are declared as a float:
long rpm = 0; // The actual output
byte myvar = 0; // The 0-10 Variable
rpm = (long(myvar*10000);
In fact, 9*10000 is reported as 24464!
I don't understand: is this a limitation of the lcd.print library? Or what exactly am I missing!?