STEPS:
-
First we connect Vss to GND.
-
Next Vcc is connected to +5v.
-
VEE is connected to the middle pin of the potentiometer.
-
The potentiometer is given +5v and GND at the other two pins.
-
Note: The value of voltage to VEE is set using the potentiometer, which controls the contrast of the LCD. So, rotate the Pot if you do not see any output to the optimum value.
-
Now Rs is connected to pin number 12 of Arduino.
-
R/W is given to GND (as we are only writing data to LCD).
-
Enable (En) is connected to pin number 11 of Arduino.
-
DB4-DB7 is connected to pin 5,4,3,2 of Arduino respectively.
-
Lastly Led+ and Led- are given +5v and GND respectively.
-
After this the code is uploaded to Arduino. And the output must be visible.
-
If not then check all the connections again and also the adjust the potentiometer value.
CODE:
// include the library code:
#include <LiquidCrystal.h>
// 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.print("hello,
world!");
}
void loop()
{
// set the cursor to column
0, line 1
// (note: line 1 is the
second row, since counting begins with 0):
lcd.setCursor(0, 1);
// print the number of
seconds since reset:
lcd.print(millis() / 1000);
}
No comments:
Post a Comment