1) Has a standard 16 pin connection. Click here for details.
First two pins : VCC and GND for display
Last two pins : VCC and GND for back light
3rd pin : Contrast. Controlled by potentiometer
4 - 6 : Reset and enable pins
7-14 : 8 data lines for 8-bit mode. But it can also work with 4 datalines in 4 bit mode
* Libraries
* ---------
* - LiquidCrystal (comes with Arduino IDE)
*
* Connections
* -----------
* LCD screen | Arduino Uno
* -----------------------------
* 1 (Vss) | GND
* 2 (Vdd) | 5V
* 3 (VO) | Potentiometer
* 4 (RS) | 12
* 5 (RW) | GND
* 6 (E) | 11
* 7 (D0) | Not connected
* 8 (D1) | Not connected
* 9 (D2) | Not connected
* 10 (D3) | Not connected
* 11 (D4) | 5
* 12 (D5) | 4
* 13 (D6) | 3
* 14 (D7) | 2
* 15 (A) | 5V
* 16 (K) | GND
*
* For the potentiometer, connect the middle pin
* to pin 3 (V0) of the display. The other two, connect
* to 5V and GND. It doesn't matter which pin goes to
* 5V and to GND.
*
* Other information
* -----------------
* For information on the LiquidCrystal library: https://www.arduino.cc/en/Reference/LiquidCrystal
*
* Created on November 18 2016 by Peter Dalmaris
*
*/
// 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);
}
1) It may be tedious to do all the wiring while making an actual gadet. So it is better to use an LCD I2C adapter with PCF8574 backup chip
2) Then you can use the LiquidCrystal_I2C.h library. Note that this library works only with PCF8574 compatable variations
This adapter has 6 pads which can be soldered together to change I2C address. IF there are conflicts, short two pads and use I2C scanner sketch to find the new address
#include <LiquidCrystal_I2C.h>
LiquidCrystal_I2C lcd(0x27,16,2);
void setup()
{
lcd.init();
lcd.backlight();
lcd.setCursor(0, 0);
lcd.print("Hello world!");
lcd.setCursor(0, 1);
lcd.print("Row number: ");
lcd.setCursor(12, 1);
lcd.print("2");
}
Adafruit RGB LCD shield can be pluggon on top on UNO board.
This shield uses I2C connections through the pins
DOWNSIDE:
This shield should be used in-combination with some other shield
It is not possible to use the GPIO pins on top of this shield. To attach sensors, you have to attach this shield on top of some prototyping shield like Adafruit proto shield. Or you can have other shields that have sensor or ethernet and have LCD for user interface
When using other shields, make sure there is no I2C conflicts