I was trying to make a character set for my LCD as it doesn't have character functions built in.
I needed to get the ascii value of a single character but couldn't find a built in function to do that. Well looking through the GLCD code I found this
Sub GLCDPrint(In PrintLocX, In PrintLocY, PrintData As String)
PrintLen = PrintData(0)
If PrintLen = 0 Then Exit Sub
GLCDPrintLoc = PrintLocX
For SysPrintTemp = 1 To PrintLen
GLCDDrawChar GLCDPrintLoc, PrintLocY, PrintData(SysPrintTemp)
GLCDPrintLoc += 6
'''Draws a character at the specified location
Sub GLCDDrawChar(In CharLocX, In CharLocY, In CharCode)
PrintData is a string going into GLCDPrint but is sent as PrintData(SysPrintTemp) (one element of the string). But GLCDDrawChar takes it as an integer thus changing it from a string to an ascii value.
Neat trick! I'm not sure if it is soft error checking or automatic conversion by the complier but it works!
Sign up for the SourceForge newsletter:
You seem to have CSS turned off.
Please don't fill out this field.