0

LCD Screen Scroll
Moderators: adafruit_support_bill, adafruit

Please be positive and constructive with your questions and comments.

LCD Screen Scroll

by bob500000 on Wed Apr 03, 2013 8:22 am

Hi Guys,

I need an LCD to scroll through a select number of lines that are seperated via delays for example

Message1 .....
Delay (10)
Message2 .....
Delay(10)
Message3 .....
Delay(10)

When it reaches the end it needs to loop back to Message1 but I guessing that just closes the loop.
I am looking at about 20 lines maybe more, is this possible and if so can someone point me in the right direction please.

Cheers
bob500000
 
Posts: 54
Joined: Tue Nov 20, 2012 11:16 am

Re: LCD Screen Scroll

by floresta on Wed Apr 03, 2013 10:32 am

How much have you got working so far?

Don

floresta
 
Posts: 223
Joined: Thu Jul 31, 2008 10:27 am
Location: Western New York, USA

Re: LCD Screen Scroll

by bob500000 on Wed Apr 03, 2013 2:32 pm

just the scroll so far mate, was thinking of running it in a loop any ideas?
bob500000
 
Posts: 54
Joined: Tue Nov 20, 2012 11:16 am

Re: LCD Screen Scroll

by floresta on Wed Apr 03, 2013 3:16 pm

bob500000 wrote:just the scroll so far mate, was thinking of running it in a loop any ideas?

That may be perfectly clear to you but it means nothing to me.

Since I have no idea of what you have done so far I can add nothing at this point.

Don

floresta
 
Posts: 223
Joined: Thu Jul 31, 2008 10:27 am
Location: Western New York, USA

Re: LCD Screen Scroll

by adafruit_support_rick on Wed Apr 03, 2013 4:15 pm

Do you want to repeat the scroll forever, or just a few times?
Do the messages need to change over time, or will they always be the same?
Are the messages coming from someplace else, or will you write them directly into the sketch?

adafruit_support_rick
 
Posts: 35095
Joined: Tue Mar 15, 2011 11:42 am
Location: Buffalo, NY

Re: LCD Screen Scroll

by bob500000 on Thu Apr 04, 2013 3:42 am

driver block,

I want them to repeat forever as I wasn't planning on adding some controls to the LCD, although this has crossed my mind and may look into it,

The messages will always be the same and will be written into the sketch.

The LCD will explain what is going on in the rest of the project, which is a physical interactive representation of a microcontroller. so it will give the users instructions which stay on display for around 30 secs then move on to the next line, see example

Message 1: Please select a register
Delay(30)
Message 2: As you can see the value is transferred to holding block A
Delay(30)
Message 3: Please select another register
Delay(30)
Message 4: As you can see the value is transferred to holding block B

and so on and so forth, this needs to repeated in a loop, currently I have it scrolling one line of text but thinking, if I create an if statement or a loop to get it to move down or purhaps an array that cycles through each message, what would you suggest?

Cheers
bob500000
 
Posts: 54
Joined: Tue Nov 20, 2012 11:16 am

Re: LCD Screen Scroll

by adafruit_support_rick on Thu Apr 04, 2013 10:41 am

More questions. The way to do this changes a lot, depending on the answers (so be certain you're not going to change your mind later :shock: ).

You already have a loop that does the horizontal scrolling? Will each line scroll continuously for the entire 30 seconds, or does it get to the end of the line and stop?

The display has two lines. Do you want to use them to display two messages at a time, or do you want only one message displayed?

If you want only one message displayed, then simply add two calls to lcd.println() to move the old line up and off the display.

If you want two messages displayed, one per line, will both messages continue to scroll horizontally as long as they are displayed?

This is an interactive project. If the user selects a register while Message 1 is displayed, do you immediately move to message 2, or do you continue to wait for the entire 30 seconds?

Is this same sketch responsible for recognizing the user's selection? That is, while it is doing all this scrolling, does it also have to monitor whatever input devices the user operates? Are you using the buttons on the shield for that, or something else?

adafruit_support_rick
 
Posts: 35095
Joined: Tue Mar 15, 2011 11:42 am
Location: Buffalo, NY

Re: LCD Screen Scroll

by floresta on Thu Apr 04, 2013 10:49 am

Now things are starting to look familiar except that I am now unclear about what you mean by 'scrolling'.

The term "scrolling" can be interpreted several different ways.

When you send information to a typical computer terminal the text starts appearing on the top line. After the line fills up the text 'scrolls' to the next line. After the bottom line is full the screen 'scrolls' vertically so the top line disappears and the bottom line is now available for new text. So here we have two different meanings for the term 'scroll'.

When you are dealing with a character mode LCD the Arduino people use the term 'scrolling' to represent what the Hitachi people call 'shifting' where the entire display, one, two, or four lines, shifts in unison either right or left.

In your original thread (http://arduino.cc/forum/index.php/topic ... msg1166550) you started out by saying: "I am wondering if it is possible to have the text to scroll to the right like a loop...".

In this thread you start out by saying: "I need an LCD to scroll through a select number of lines..."

Since you have constrained yourself to 16x2 display and since many of your messages are long you will have to do some horizontal shifting or some line wrapping for most of your messages. The line wrapping becomes more complicated if you are concerned with breaking syllables between lines. The horizontal shifting becomes more complicated when you run into the fact that both lines shift in unison. Some of your messages have more than 32 characters so you will have to do some vertical scrolling (as described for the computer terminal above) for those as well.

So you wind up with a complicated but not impossible programming problem due to the fact that you selected a small display for large messages.

Don

floresta
 
Posts: 223
Joined: Thu Jul 31, 2008 10:27 am
Location: Western New York, USA

Re: LCD Screen Scroll

by bob500000 on Fri Apr 05, 2013 5:50 am

Thanks for all the info guys.

Driverblock - I do want it to scroll through the messages, at this point it doesn't matter about breaking syllables as I will have the messages being dictated through the waveshield, I was thinking of cycling through the messages vertically, so when one message has finishe the next one will scroll up, the option to run a message on a second line is a good idea, that I didn't think about so will look into this, I was just unsure on how to get it to show the next text after adelay as the library wasn't really clear on this.

Don - Once again thanks for the input, yes you are correct, but due to the constraints of the size of the model I am unable to change the size of the screen. I have taken into account that I may have to cut down the size of the messges, but this will not be a big issue as explained above they will be dictated so as long as the basic information is there it shouldn't be a problem. I am just after some sample code that will allow a message to be displayed for 30 seconds then move onto the message, the format or the length of the message is not a priority at the moment just getting it to show more than just one line is.

I recall someone mentioning about using and external file that contains the messages and each one is pull in turn, I didnt think this would be possible without adding and external storage to the board.

Cheers
bob500000
 
Posts: 54
Joined: Tue Nov 20, 2012 11:16 am

Re: LCD Screen Scroll

by adafruit_support_rick on Fri Apr 05, 2013 9:13 am

bob500000 wrote:I recall someone mentioning about using and external file that contains the messages and each one is pull in turn, I didnt think this would be possible without adding and external storage to the board.

Well, you're going to need external storage for your wav files anyway, so you could certainly use it for your message strings.

I can imagine a data file that contains pairs of strings: the text message and the name of the associated .wav file. Something like this:
Code: Select all | TOGGLE FULL SIZE
"Please select a register",REG1MSG.WAV
"As you can see the value is transferred to holding block A",XFRAMSG.WAV
"Please select another register",REG2MSG.WAV
"As you can see the value is transferred to holding block B",XFRBMSG.WAV
…etc...

adafruit_support_rick
 
Posts: 35095
Joined: Tue Mar 15, 2011 11:42 am
Location: Buffalo, NY

Re: LCD Screen Scroll

by bob500000 on Mon Apr 08, 2013 3:40 am

Driver block,

The .wav files are running on a seperate board, I will be running three boards on the project overall and wasn't planning on syncing them together.

Currently the setup I have is

[] - wave shield [] - LCD [] - LED's

They can't be linked as the wave shield uses the ports that would be required to connect each of the boards.

I am looking at the button solution as this maybe the only way forward, can you advise if it is a simple as just creating an array and when the button is pressed cycling through the array?

cheers.
bob500000
 
Posts: 54
Joined: Tue Nov 20, 2012 11:16 am

Re: LCD Screen Scroll

by adafruit_support_rick on Mon Apr 08, 2013 10:47 am

bob500000 wrote:I am looking at the button solution as this maybe the only way forward, can you advise if it is a simple as just creating an array and when the button is pressed cycling through the array?


It's really tough for me to say what would be best, because I really don't understand this whole project from the user perspective, and I'm not sure what buttons we're talking about.

When the project is complete, it will ask the user to select a register, and then instruct him to watch something. How does the user select the register? What hardware does he use, and which of the three boards is that hardware connected to?

adafruit_support_rick
 
Posts: 35095
Joined: Tue Mar 15, 2011 11:42 am
Location: Buffalo, NY

Re: LCD Screen Scroll

by bob500000 on Tue Apr 09, 2013 8:43 am

Not too worry,

The project bascially simplifies how a micro controller works but with user interaction, see screenshot

image7.jpeg
image7.jpeg (730.53 KiB) Viewed 2219 times


imagine each blue button has a number start from the top and go from right to left so now you should have 1-6

makes it easier for me to explain.

So if the user presses buttons 1,2,4 then the first tube will light up. The buttons represent the registers.

If the user presses buttons 3,5,6 then the second tube will light up.

Once both tubes are lit up, the next part of the tubes (the ones after the separtation are lit)

Finally when the Y shaped tube is lit the last lot of tubes then light.

So to summarise, I need the LCD show what is being dictated by the wave shield which is contained in the black box above the model. I am wondering if it is possible for the LCD to scroll between each message automatically after a delay of 30 secs, or it would be much more benifical to allow the user to change the messages themselves by adding a button that allows them to move to the next message after they have read the previous one.

Hope this will be much easier to understand, sorry didn't think of doing this before hand
bob500000
 
Posts: 54
Joined: Tue Nov 20, 2012 11:16 am

Re: LCD Screen Scroll

by adafruit_support_bill on Tue Apr 09, 2013 8:57 am

That is a really cool project! :D
If you can get a clearer photo of it we'll post it in the blog. More light would help. Near a window of even outside during the day usually work well.

adafruit_support_bill
 
Posts: 74337
Joined: Sat Feb 07, 2009 10:11 am

Re: LCD Screen Scroll

by bob500000 on Wed Apr 10, 2013 3:38 am

Thanks mate, once its complete i'll send you a whole host of pictures, deadlines in two weeks so probbly shrotly after that :)
bob500000
 
Posts: 54
Joined: Tue Nov 20, 2012 11:16 am

Please be positive and constructive with your questions and comments.