Experment 14 magic 8 Ball
Chris123
Posts: 7
I need to convert this 8Ball.BS2 from a parallel LCD to a Serial LCD, All I need are a few simple changes.If anybody can help me that would be greatly appreciated. Thank you
Comments
I'd read up on the serial LCD that you intend to use to understand it's required control characters.
BTW - welcome to the Forum!
I wasn't aware of the ability to "alias" text strings via the DATA statement.
That trick will certainly save memory in my current project as I've a number of SEROUTs with the same quoted text string. :thumb:
Thanks again.
Since the BASIC Stamp Modules do not have any string handling functions, per se, I would tend to handle strings of text in PBASIC in the exact same manner as I would in ASM on say a Z80. the text blocks would be encoded as blocks of zero-delimited data with labels to refer to the address of that block of text.
When you want to print the string you need only pass the address to the routine and continue to fetch bytes and process them (in this case print them) until you get a zero. In this manner your strings can be of varying lengths and all you need to know is the start address. the LOOKUP provides an easy way to turn a linear integer into a variable offset address.
As a note, I use LOOKUP in keyboard/keypad scanning routines to convert the return values to the appropriate ASCII values all in one line.
Anyway, I will build the circuit tomorrow if you haven't gotten it working by then. Take care.
Thanks Chris.
Also, it doesn't matter if you have the Backlit LCD or not. The code for each is compatible so no need to delete anything for this to work, even though it may have backlight commands in it.
Thanks again!
Chris