loading

After publishing the previous post, my friend told me there is an easier way with a 10k potentiometer, so I use the potentiometer included in the kit and follow his diagram and did the wiring.......

Step 1: Wiring With Potentiometer

It works! Now I can turn the potentiometer to control the LCD!

I have also modify the code in Library a little bit. Here is the code:

// include the library code:

#include

// initialize the library with the numbers of the interface pins

LiquidCrystal lcd(12, 11, 5, 4, 3, 2);

void setup() {

// set up the LCD's number of columns and rows:

lcd.begin(16, 2);

// Print a message to the LCD.

lcd.setCursor(0,0);

lcd.print("Hey, pretty lady");

lcd.setCursor(0,1);

lcd.print("Go to see movie");

}

void loop() {

// Turn off the display:

lcd.noDisplay();

delay(500);

// Turn on the display:

lcd.display();

delay(500);

}

Step 2: Try to Make It Moves

But the text is just limited to 16x2, which is definitely not enough for my "paragraph". : ) So I modify the code again referring to http://arduino.cc/en/Tutorial/LiquidCrystalScroll

// include the library code:

#include

// initialize the library with the numbers of the interface pins

LiquidCrystal lcd(12, 11, 5, 4, 3, 2);

void setup() {

// set up the LCD's number of columns and rows:

lcd.begin(16, 2);

// Print a message to the LCD.

lcd.setCursor(0,0);

lcd.print("Hey, pretty lady");

lcd.setCursor(0,1);

lcd.print("Go to see movie");

}

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);

}

It can move the whole text to left and right now.

Step 3: Make a Little Change Further

Then I extent the text to a sentence and delete part of the code to let it moves to the left only. The final code is as follow:

// include the library code:

#include

// initialize the library with the numbers of the interface pins

LiquidCrystal lcd(12, 11, 5, 4, 3, 2);

void setup() {

// set up the LCD's number of columns and rows:

lcd.begin(16, 2);

// Print a message to the LCD.

lcd.setCursor(0,0);

lcd.print("Hey, pretty lady, let's go to see a");

lcd.setCursor(0,1);

lcd.print("movie and have a dinner tonite");

}

void loop() {

lcd.scrollDisplayLeft();

// wait a bit:

delay(150);

}

Finished! Next time I will start a new project with different stuffs. See you.

<p>Cool, thanks for posting updates!</p>
<p>ok heere some thing really screwed up with instructables. it allows me to log in. but i cant make a simgle post wat so ever on the page i logged in under. but , even if i go back to that page it wont let me wat so ever. now it fine with me poating any where else but , there.</p>
<p>Email service@instructables.com for help!</p>

About This Instructable

1,436views

22favorites

License:

More by Rookie P:My Ninth Project: Robot Arm with Joystick Shield My Eighth Project: Robot Arm with Smart Tank Chassis and Bluetooth My Seventh Project: Robot Arm Set 
Add instructable to: