Sonsivri
 
*
Welcome, Guest. Please login or register.
Did you miss your activation email?
May 14, 2024, 04:57:25 16:57


Login with username, password and session length


Pages: [1]
Print
Author Topic: moving message(LCD)  (Read 3362 times)
0 Members and 1 Guest are viewing this topic.
eliorap
Guest
« on: May 11, 2007, 07:54:14 19:54 »

I don't now how to do a moving message with PBP with a lcd 16*2 and pic 16f84 I find one but I need
to Scroll a large message in one line. excuseme I speak a little english
Logged
robban
Senior Member
****
Offline Offline

Posts: 265

Thank You
-Given: 34
-Receive: 38


Warrior


WWW
« Reply #1 on: May 14, 2007, 08:11:26 08:11 »

I haven't done any Basic programming for a long time but you have to construct a loop where You increment (or decrement depending wether You want to scroll left or right) the position - normally POS X - of the line in question.

Generic code

loop:
for POS X = (right + lenght of message) to 0
Print at POS X, "Hello"    ' where POS X is the rightmost position of the LCD
clearLCD
delay                          ' here you put the desired delay to make Yr. message readable
POS X = (POS X - 1)
next
Goto loop

Haven't tested it, hope it works. There are several ways to skin a cat...
« Last Edit: May 14, 2007, 09:26:07 09:26 by robban » Logged

Code Warrior
wacksbaby
Guest
« Reply #2 on: May 15, 2007, 12:36:07 00:36 »

isn't it the Delay should be ahead of ClearLCD? and clear LCD may not be necessary because you can just over-write the characters


I haven't done any Basic programming for a long time but you have to construct a loop where You increment (or decrement depending wether You want to scroll left or right) the position - normally POS X - of the line in question.

Generic code

loop:
for POS X = (right + lenght of message) to 0
Print at POS X, "Hello"    ' where POS X is the rightmost position of the LCD
clearLCD
delay                          ' here you put the desired delay to make Yr. message readable
POS X = (POS X - 1)
next
Goto loop

Haven't tested it, hope it works. There are several ways to skin a cat...
Logged
robban
Senior Member
****
Offline Offline

Posts: 265

Thank You
-Given: 34
-Receive: 38


Warrior


WWW
« Reply #3 on: May 15, 2007, 02:13:40 14:13 »

No You can't overwrite the previous moving message. it will be a blur...
When it comes to putting the delay after or before clearLSD, I think it's a matter of taste

Let me know when Your'e make it work and supply the code. This example could also be done with "bit-banging" and other techniques.
« Last Edit: May 15, 2007, 02:22:19 14:22 by robban » Logged

Code Warrior
Pages: [1]
Print
Jump to:  


DISCLAIMER
WE DONT HOST ANY ILLEGAL FILES ON THE SERVER
USE CONTACT US TO REPORT ILLEGAL FILES
ADMINISTRATORS CANNOT BE HELD RESPONSIBLE FOR USERS POSTS AND LINKS

... Copyright © 2003-2999 Sonsivri.to ...
Powered by SMF 1.1.18 | SMF © 2006-2009, Simple Machines LLC | HarzeM Dilber MC