Page 1 of 1

Complete noob on scrolling text

Posted: Thu Jan 02, 2014 11:06 pm
by fuseo
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!

Re: Complete noob on scrolling text

Posted: Fri Jan 03, 2014 5:26 am
by fuseo
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 ()
{}

Re: Complete noob on scrolling text

Posted: Sat Jan 04, 2014 1:53 am
by angusgr
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

Re: Complete noob on scrolling text

Posted: Sat Jan 04, 2014 1:57 am
by angusgr
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

Re: Complete noob on scrolling text

Posted: Sun Jan 05, 2014 10:03 pm
by fuseo
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

Re: Complete noob on scrolling text

Posted: Sun Jan 05, 2014 10:41 pm
by fuseo
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);

}

Re: Complete noob on scrolling text

Posted: Sun Jan 05, 2014 10:50 pm
by fuseo
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