LCD - EEPROM and stuff.
How do I actually store the data I want to print inside EEPROM, and how do i bring out the EEPROM data to be displayed in the LCD?
This is the template I got from parallax main website, I read through some tutorials and the demo but still doesn't understand how it actually works. I would want to replace the line "Binary Code sense a" " into EEPROM data, and then printing out the result of a as well to the LCD.
' {$STAMP BS2} ' {$PBASIC 2.5} ' ' ========================================================================= ' -----[noparse][[/noparse] Program Description ]--------------------------------------------- ' -----[noparse][[/noparse] Revision History ]------------------------------------------------ ' -----[noparse][[/noparse] I/O Definitions ]------------------------------------------------- TX PIN 0 ' serial output to LCD INPUT 1 'Set PIN 1 to INPUT INPUT 2 'Set PIN 2 to INPUT INPUT 3 'Set PIN 3 to INPUT INPUT 4 'Set PIN 4 to INPUT ' -----[noparse][[/noparse] Constants ]------------------------------------------------------- #SELECT $STAMP #CASE BS2, BS2E, BS2PE T2400 CON 396 T9600 CON 84 T19K2 CON 32 #CASE BS2SX, BS2P T2400 CON 1021 T9600 CON 240 T19K2 CON 110 #ENDSELECT LcdBaud CON T19K2 LcdBkSpc CON $08 ' move cursor left LcdRt CON $09 ' move cursor right LcdLF CON $0A ' move cursor down 1 line LcdCls CON $0C ' clear LCD (use PAUSE 5 after) LcdCR CON $0D ' move pos 0 of next line LcdBLon CON $11 ' backlight on LcdBLoff CON $12 ' backlight off LcdOff CON $15 ' LCD off LcdOn1 CON $16 ' LCD on; cursor off, blink off LcdOn2 CON $17 ' LCD on; cursor off, blink on LcdOn3 CON $18 ' LCD on; cursor on, blink off LcdOn4 CON $19 ' LCD on; cursor on, blink on LcdLine1 CON $80 ' move to line 1, column 0 LcdLine2 CON $94 ' move to line 2, column 0 LcdCC0 CON $F8 ' define custom char 0 LcdCC1 CON $F9 ' define custom char 1 LcdCC2 CON $FA ' define custom char 2 LcdCC3 CON $FB ' define custom char 3 LcdCC4 CON $FC ' define custom char 4 LcdCC5 CON $FD ' define custom char 5 LcdCC6 CON $FE ' define custom char 6 LcdCC7 CON $FF ' define custom char 7 ' -----[noparse][[/noparse] Variables ]------------------------------------------------------- a VAR Byte ' -----[noparse][[/noparse] EEPROM Data ]----------------------------------------------------- ' -----[noparse][[/noparse] Initialization ]-------------------------------------------------- Reset: HIGH TX ' setup serial output pin PAUSE 100 ' allow LCD to initialize ' -----[noparse][[/noparse] Program Code ]---------------------------------------------------- Main: a = INS >> 1 & $F DEBUG CR, "Binary Code sense" DEC a"." PAUSE 200 GOTO Main END ' -----[noparse][[/noparse] Subroutines ]-----------------------------------------------------
This is the template I got from parallax main website, I read through some tutorials and the demo but still doesn't understand how it actually works. I would want to replace the line "Binary Code sense a" " into EEPROM data, and then printing out the result of a as well to the LCD.
Comments
If you can understand whats going on there it would take very little to modify the example to display the data on the LCD. A couple of things you will have to adjust, one is instead of using debug to display the text you would use·SEROUT to transmit the data to the LCD, so check out the use of the SEROUT instruction. Secondly when using the·LCD ·always be aware of where the cursor is and make sure your messages will fit into the confines of the display.
Read it over and maybe try to code·a scaled down version·based on the example ,·then post back with any questions and code you might have.
Jeff T.
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Chris Savage
Parallax Engineering