Help with LCD display formats

Coding and general discussion relating to the compiler

Moderators: David Barker, Jerry Messina

Post Reply
SonOfBc
Posts: 8
Joined: Mon Nov 12, 2012 10:39 pm

Help with LCD display formats

Post by SonOfBc » Tue Nov 13, 2012 4:43 pm

Can anyone help me with LCD commands?
I am currently using Proton basic (and thinking about switching to Swordfish) and some commands I use frequently are:

Print "Var1= ", Dec Var1 ' Display the decimal value of Var1
Print "Var1= ", Hex Var1 ' Display the hexadecimal value of Var1
Print "Var1= ", Bin Var1 ' Display the binary value of Var1
etc.....

Can anyone explain to me how these functions are handled in SwordFish?

Thank you
SamB :(

User avatar
David Barker
Swordfish Developer
Posts: 1214
Joined: Tue Oct 03, 2006 7:01 pm
Location: Saltburn by the Sea, UK
Contact:

Post by David Barker » Tue Nov 13, 2012 4:51 pm

Code: Select all

Include "LCD.bas"
Include "Convert.bas"
dim Var1 as byte
LCD.WriteAt(1,1,DecToStr(Var1,3))
LCD.WriteAt(1,1,HexToStr(Var1,2))
LCD.WriteAt(1,1,BinToStr(Var1,8))
You will need to ensure the LCD is configured to use the correct pins. Put the cursor on "LCD" and press F1 for further help...

SonOfBc
Posts: 8
Joined: Mon Nov 12, 2012 10:39 pm

Thank You Mr. Barker .. It works!

Post by SonOfBc » Tue Nov 13, 2012 5:03 pm

I did see the Conversion module but the functions were confusing to me.
I guess in hindsight I should have tried them.. :oops:

Thanks again..
SamB

Post Reply