Wow ! Amazing ! THANK YOU, Mr.Darrel !
I will try to figure out how displaying ...
Wow ! Amazing ! THANK YOU, Mr.Darrel !
I will try to figure out how displaying ...
Let's say I read maximum 50 volts and maximum 5 ampers ; so one "empty box" = 5 volts and one "filled box" = 0.5 ampers.
It's this "pseudo" code correct ?!
I'm sure it's another way, much easiers, but I have -till now- no ideea ...Code:for y=9 to 0 step -1 if volts >= (y*5) then if ampers >= (y * 1/2) then char = 3 LCDOUT $FE, $80, char,char,char,char,char,char,char,char,char,char Endif Endif
Untested, likely needs some debugging, but at least the methodology should be clear.
Code:LCDPos VAR BYTE volts VAR WORD ' 0 to 500 representing 0 to 50.0 Volts Amps VAR BYTE ' 0 to 50 representing 0 to 5.0 Amps Char VAR BYTE FOR LCDPos = 0 TO 9 IF Volts / 50 >= LCDPos + 1 THEN ' Fill in Volt Block IF Amps / 5 >= LCDPos + 1 THEN ' Fill in Volt + Amp Block Char = 3 ELSE ' Fill in Volt Block Only Char = 2 ENDIF ELSE ' Don't Fill in Volt Block IF Amps / 5 >= LCDPos + 1 THEN ' Fill in Amp Block only Char = 1 ELSE ' Fill with Space Char = 32 ENDIF ENDIF LCDOUT $FE, $80 + LCDPos, Char NEXT LCDPos
Last edited by SteveB; - 25th January 2013 at 16:07. Reason: typo
Bookmarks