LED display - Hex to decimal question
Steve2381
Posts: 94
Hello
Just started programming with the Stamps - so please bear with me!
I have this line in my program displaying a clock...
DEBUG CRSRXY, 0,1,HEX2 Hours,":",HEX2 Minutes,":",HEX2 Seconds,":",DEC2 Tenths," ",CR·
The hour, minute and second variables are hex numbers.
Later in the program I have a list of the following·statements (with different variables)·controlling the LED displays....
SHIFTOUT Time_data,Time_clock,MSBFIRST,[noparse][[/noparse]6]·· 'Select 6th digit position
SHIFTOUT Time_data,Time_clock,MSBFIRST,[noparse]/noparse][color=red]Seconds DIG 0[/color······· 'Send the digit
PULSOUT Time_load,5
My problem is I need to convert the variable I have highlighted in red to a·decimal value, as it is still in hex format and therefore not displaying correctly on the LED display.
Any ideas?
Many thanks
Just started programming with the Stamps - so please bear with me!
I have this line in my program displaying a clock...
DEBUG CRSRXY, 0,1,HEX2 Hours,":",HEX2 Minutes,":",HEX2 Seconds,":",DEC2 Tenths," ",CR·
The hour, minute and second variables are hex numbers.
Later in the program I have a list of the following·statements (with different variables)·controlling the LED displays....
SHIFTOUT Time_data,Time_clock,MSBFIRST,[noparse][[/noparse]6]·· 'Select 6th digit position
SHIFTOUT Time_data,Time_clock,MSBFIRST,[noparse]/noparse][color=red]Seconds DIG 0[/color······· 'Send the digit
PULSOUT Time_load,5
My problem is I need to convert the variable I have highlighted in red to a·decimal value, as it is still in hex format and therefore not displaying correctly on the LED display.
Any ideas?
Many thanks
Comments
http://forums.parallax.com/showthread.php?p=552892
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Chris Savage
Parallax Tech Support
csavage@parallax.com
(Yep - it is a Max chip.... excellent bit of kit)
Cheers, Steve