Thursday, 6 October 2016

LCD INTERFACING WITH ARDUINO UNO

















































     

STEPS:

  1. First we connect Vss to GND.
  2. Next Vcc is connected to +5v.
  3. VEE is connected to the middle pin of the potentiometer.
  4. The potentiometer is given +5v and GND at the other two pins.
  5. 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.
  1. Now Rs is connected to pin number 12 of Arduino.
  2. R/W is given to GND (as we are only writing data to LCD).
  3. Enable (En) is connected to pin number 11 of Arduino.
  4. DB4-DB7 is connected to pin 5,4,3,2 of Arduino respectively.
  5. Lastly Led+ and Led- are given +5v and GND respectively.
  6. After this the code is uploaded to Arduino. And the output must be visible.
  7. 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

in m mf mv fm mvf dmv mfv fv dfv fdvd