-
Math Problems
Hello Group,
I have 2 floating Point problem that I can't figure out.
The first is each time a switch closes I need to increment the value by .011 and have it display on a LCD with the correct value.
The second problem is each time a switch closes I need to increment the value 1.492 and show it on a LDC.
I have tried many things but I don't get the correct read outs.
Can someone help me with the code to have the correct read outs.
Than You
William Oliver
-
Re: Math Problems
Why you need to use FP for that :confused:
You can use integers for that simple math...
Code:
Counter VAR LONG
Main:
IF button1=pressed THEN Counter = Counter + 11
IF button2=pressed THEN Counter = Counter + 1492
LCDOUT $FE,1, DEC Counter /1000, ".", DEC3 Counter //1000
GOTO Main