programmin bs2 with serial lcd
voukefalas
Posts: 2
hallo..
i try to programme mine bs2 and i totaly comfused.
I have 2 push button and one lcd .(and the resistors of course )
When one pushbutton have been pressed i want to clrear my lcd and write a menu.I have already try lot's thing that i had found in web but i still din't have a solution.
Here is my small programme ....could you somebody helps me with that?
my lcd doesn't clear and the letters is side by side(from the 2 menus that i had)
DO
INPUT 1
INPUT 2
IF (IN1=1) THEN GOSUB lcd1
IF (IN2=1) THEN GOSUB lcd2
PAUSE 100
LOOP
lcd1 :
SEROUT 15, 16780,["main programme"]
SEROUT 15,16780 ,["alexandros"] /here is that i have a promblem and if i pressed again the button,the letters in the lcd steps side by side
RETURN
lcd2:
SEROUT 15,16780,[" "]
PAUSE 50
SEROUT 15,16780,["service "]
RETURN
i try to programme mine bs2 and i totaly comfused.
I have 2 push button and one lcd .(and the resistors of course )
When one pushbutton have been pressed i want to clrear my lcd and write a menu.I have already try lot's thing that i had found in web but i still din't have a solution.
Here is my small programme ....could you somebody helps me with that?
my lcd doesn't clear and the letters is side by side(from the 2 menus that i had)
DO
INPUT 1
INPUT 2
IF (IN1=1) THEN GOSUB lcd1
IF (IN2=1) THEN GOSUB lcd2
PAUSE 100
LOOP
lcd1 :
SEROUT 15, 16780,["main programme"]
SEROUT 15,16780 ,["alexandros"] /here is that i have a promblem and if i pressed again the button,the letters in the lcd steps side by side
RETURN
lcd2:
SEROUT 15,16780,[" "]
PAUSE 50
SEROUT 15,16780,["service "]
RETURN
Comments
The LCD is treated as one long string of characters. So if you want to "break" the line, you'll have to direct the text to another line.
Which LCD are you using?
Also, some LCDs (especially the ones from Parallax) require an initialization before sending them any data.
Have you read the documentation for your particular LCD?
DJ
http://www.parallax.com/Store/Accessories/Displays/tabid/159/CategoryID/34/List/0/SortField/0/Level/a/ProductID/50/Default.aspx
how can i initialization the lcd??? could you help me please???
http://www.parallax.com/Portals/0/Downloads/docs/prod/audiovis/27976-7-9-ParallaxSerialLCD-v3.0.pdf
and read through the document. It has everything you'll need to program the LCD correctly (including sample code).
If you have questions after the read, we can go from there.