Complete noob on scrolling text

The LCD and Keypad Shield gives you a handy 16-character by 2-line display, 5 buttons and a controllable backlight.
Post Reply
fuseo
Posts: 9
Joined: Tue Dec 31, 2013 12:59 am
Location: Sydney

Complete noob on scrolling text

Post by fuseo » Thu Jan 02, 2014 11:06 pm

I am awaiting the Arduino Workshop book and I have already purchased LCD display to play around with. Is there any chance of getting some basic coding on how to scroll text? Would be greatly appreciated!

fuseo
Posts: 9
Joined: Tue Dec 31, 2013 12:59 am
Location: Sydney

Re: Complete noob on scrolling text

Post by fuseo » Fri Jan 03, 2014 5:26 am

So far I am using this...

#include <Wire.h>
#include <LiquidCrystal.h>

LiquidCrystal lcd( 8, 9, 4, 5, 6, 7 );

void setup()
{
lcd.begin(16, 2);
lcd.print("Wired for sound!");
}

void loop ()
{}

angusgr
Freetronics Staff
Freetronics Staff
Posts: 853
Joined: Tue Apr 09, 2013 11:19 pm
Location: Melbourne, Australia
Contact:

Re: Complete noob on scrolling text

Post by angusgr » Sat Jan 04, 2014 1:53 am

Hi fuseo,

There's a pretty good example here that you can probably start from as a good base:
http://arduino.cc/en/Tutorial/LiquidCrystalScroll

Let us know if your run into any snags.

- Angus

angusgr
Freetronics Staff
Freetronics Staff
Posts: 853
Joined: Tue Apr 09, 2013 11:19 pm
Location: Melbourne, Australia
Contact:

Re: Complete noob on scrolling text

Post by angusgr » Sat Jan 04, 2014 1:57 am

Hi fuseo,

There's a pretty good example here that you can probably start from as a good base:
http://arduino.cc/en/Tutorial/LiquidCrystalScroll

Let us know if your run into any snags.

- Angus

fuseo
Posts: 9
Joined: Tue Dec 31, 2013 12:59 am
Location: Sydney

Re: Complete noob on scrolling text

Post by fuseo » Sun Jan 05, 2014 10:03 pm

Thanks Angus! I will give it a try and and hopefully I can learn from it so i don't have to post noob questions =P

fuseo
Posts: 9
Joined: Tue Dec 31, 2013 12:59 am
Location: Sydney

Re: Complete noob on scrolling text

Post by fuseo » Sun Jan 05, 2014 10:41 pm

Okay so if this helps anyone I will be pleased as it has assisted me and now I am slowly going to code from scratch attempting to remember what I have learnt.

#include <Wire.h>
#include <LiquidCrystal.h>

LiquidCrystal lcd( 8, 9, 4, 5, 6, 7 );

void setup() {
// set up the LCD's number of columns and rows:
lcd.begin(16, 2);
// Print a message to the LCD.
lcd.print("Hello World!");
delay(1000);
}

void loop() {
// scroll 13 positions (string length) to the left
// to move it offscreen left:
for (int positionCounter = 0; positionCounter < 13; positionCounter++) {
// scroll one position left:
lcd.scrollDisplayLeft();
// wait a bit:
delay(150);
}

// scroll 29 positions (string length + display length) to the right
// to move it offscreen right:
for (int positionCounter = 0; positionCounter < 29; positionCounter++) {
// scroll one position right:
lcd.scrollDisplayRight();
// wait a bit:
delay(150);
}

// scroll 16 positions (display length + string length) to the left
// to move it back to center:
for (int positionCounter = 0; positionCounter < 16; positionCounter++) {
// scroll one position left:
lcd.scrollDisplayLeft();
// wait a bit:
delay(150);
}

// delay at the end of the full loop:
delay(1000);

}

fuseo
Posts: 9
Joined: Tue Dec 31, 2013 12:59 am
Location: Sydney

Re: Complete noob on scrolling text

Post by fuseo » Sun Jan 05, 2014 10:50 pm

This code is specifically designed to assist people using the freetronics LCD & Keypad Shield. I have found if you were to cut and past the code from the Arduino website on the previous link adjustments were needed to get the text working.

Enjoy

Post Reply

Who is online

Users browsing this forum: No registered users and 2 guests