Serial Lcd (4x20)
Hi all,
··· I am trying to figure out how to display scrolling text.· I am looking through the download right now, and understand how to move the cursor around, but haven't been able to figure out a routine to do what I want.· Pretty much what I am trying to do is to display the same message on line 0, starting from the right side, scrolling across the screen, and off the left over and over again.
Any help is appreciated, and thanks in advance.
This is where I am so far, thanks again.·
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
There are 10 types of people that understand binary, those who do, and those who don't.
··· I am trying to figure out how to display scrolling text.· I am looking through the download right now, and understand how to move the cursor around, but haven't been able to figure out a routine to do what I want.· Pretty much what I am trying to do is to display the same message on line 0, starting from the right side, scrolling across the screen, and off the left over and over again.
Any help is appreciated, and thanks in advance.
This is where I am so far, thanks again.·
' File:
' Author:
' Date:
' {$STAMP BS2}
' {$PBASIC 2.5}
'----Program Description-------------------------------------------------------
'----PIN Declaration-----------------------------------------------------------
'----Constants-----------------------------------------------------------------
TxPin CON 0
Baud19200 CON 32
'----Variables-----------------------------------------------------------------
idx VAR Byte
txmt VAR Byte
'----EEPROM DATA---------------------------------------------------------------
DATA "Hartnell College Robotics Club" '29 characters
'----Initialization------------------------------------------------------------
DEBUG CLS
HIGH TxPin 'Set pin high to be a serial port
PAUSE 100 'Pause for Serial LCD to initialize
SEROUT TxPin, Baud19200, [noparse][[/noparse]17] 'Backlight On
'----Program Code---------------------------------------------------------------
Main:
DO
FOR idx = 0 TO 29
SEROUT TxPin, Baud19200, [noparse][[/noparse]147] 'Sets cursor position back to line 0
READ idx, txmt 'Position 19, but I need previous
SEROUT TxPin, Baud19200, [noparse][[/noparse]txmt] 'Characters to be shifted left?
PAUSE 100
NEXT
LOOP
'----Subroutines---------------------------------------------------------------
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
There are 10 types of people that understand binary, those who do, and those who don't.

Comments
1) Write characters 1-20 and pause briefly
2) Write characters 2-21 and pause briefly
3) Write characters 3-22 and pause briefly
4) And so on up to characters 10-29, then pause briefly and start all over again
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
There are 10 types of people that understand binary, those who do, and those who don't.
' File:Serial 4x20 scroll.bs2 ' Author: ' Date:12-16-08 ' {$STAMP BS2} ' {$PBASIC 2.5} '----Program Description------------------------------------------------------- '----PIN Declaration----------------------------------------------------------- '----Constants----------------------------------------------------------------- TxPin CON 0 Baud19200 CON 32 '----Variables----------------------------------------------------------------- message VAR Byte (20) idx VAR Byte '----EEPROM DATA--------------------------------------------------------------- DATA "tics Club Hartnell College Robotics Club " '49 characters '----Initialization------------------------------------------------------------ DEBUG CLS HIGH TxPin 'Set pin high to be a serial port PAUSE 100 'Pause for Serial LCD to initialize SEROUT TxPin, Baud19200, [noparse][[/noparse]17] 'Backlight On '----Program Code--------------------------------------------------------------- Main: DO FOR idx = 0 TO 41 READ idx, message(0), message(1), message(2), message(3), message(4), message(5), message(6), message(7), message(8), message(9), message(10), message(11), message(12), message(13), message(14), message(15), message(16), message(17), message(18), message(19) SEROUT TxPin, Baud19200, [noparse][[/noparse]message(0), message(1), message(2), message(3), message(4), message(5), message(6), message(7), message(8), message(9), message(10), message(11), message(12), message(13), message(14), message(15), message(16), message(17), message(18), message(19)] IF idx < 41 THEN PAUSE 300 ENDIF SEROUT TxPin, Baud19200,[noparse][[/noparse]128] NEXT LOOP '----Subroutines---------------------------------------------------------------▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
There are 10 types of people that understand binary, those who do, and those who don't.