Custom character on LCD
Sabai
Posts: 27
I am trying to make a custom character but I can not get it to work.
I creat the character:
And save it to the LCD
But how do I use it?
I creat the character:
Char12 DATA %01000 DATA %10100 DATA %01000 DATA %00000 DATA %00000 DATA %00000 DATA %00000 Char13 DATA %01000 DATA %10100 DATA %01000 DATA %00000 DATA %00000 DATA %00000 DATA %00000
And save it to the LCD
Download_Chars: ' download custom chars char = LcdCGRam ' point to CG RAM GOSUB LCD_Cmd FOR idx = Char12 TO (Char13 + 7) ' prepare to write CG data ' build 4 custom chars READ idx, char ' get byte from EEPROM GOSUB LCD_Out ' put into LCD CG RAM NEXT
But how do I use it?
Comments
$41 is the font code for an·A, so you send $41 to get that letter.
You're storing character data for codes $12 and $13 (??) so you'd send a $12 or $13 as nec.
Sorry I do not understand this!
We have a book that I think would serve you well; it's Smart Sensors & Applications. It covers how to use a LCD display from general commands, to creating custom characters and the explanation behind it all. Here is a link for your convenience. There is a PDF and sample code that you can use.
Smart Sensors & Applications:
http://www.parallax.com/Store/Books/EducationalTexts/tabid/181/CategoryID/66/List/0/Level/a/ProductID/420/Default.aspx?SortField=ProductName%2cProductName
I hope this helps,
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Respectfully,
Joshua Donelson
www.parallax.com
Animation:
FOR idx1 = 0 TO 15 ' cover 16 characters
READ (Msg2 + idx1), newChar ' get new char from Msg2
FOR idx2 = 0 TO 4 ' 5 characters in cycle
char = LcdLine2 + idx1 ' set new DDRAM address
GOSUB LCD_Cmd ' move cursor position
LOOKUP idx2, [noparse][[/noparse]0, 1, 2, 1, newChar], char ' get animation "frame"
GOSUB LCD_Out ' write "frame"
PAUSE 100 ' animation delay
NEXT
NEXT
PAUSE 2000
But I do not understand how the character are called I can see them but not how to call them.
Sorry about that, didn't even catch it was a parallel LCD; However, there is another book that I would suggest reading up on. It's called the StampWorks Manual,·it covers using the Parallel LCD with the BASIC Stamp 2 module; there is sample code and PDF (LCD control starts on pg 73)·like the previous book.
StampWorks Manual:
http://www.parallax.com/Store/Books/BASICStamp/tabid/168/CategoryID/42/List/0/Level/a/ProductID/144/Default.aspx?SortField=ProductName%2cProductName
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Respectfully,
Joshua Donelson
www.parallax.com
The custom characters are being called with the LOOKUP command. As the program cycles from 0 - 15 (for a 2x16 display) the pac-man looking character goes through 3 different steps each time; 0,1,2,1 to simulate "eating" of characters that are already shown.
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Respectfully,
Joshua Donelson
www.parallax.com