About markwills

June 16, 2016
Full Profile »

Tell us about yourself!

Complete Your Profile
  • markwills commented on verdelj's instructable I2C LCD Controller (the easy way)3 months ago
    I2C LCD Controller (the easy way)

    Guys,If any of you are struggling, I have found that some LCD modules have a different pinout on the 16 way connector. I am using a 20x4 RT204-1 Version 3 LCD Module (blue characters with built in backlight).After a considerable amount of head-scratching and looking at datasheets, I came up with the following, which DOES work on my Arduino UNO with the RT204-1 20x4 module. Note that the pin numbers in the #defines are different in my code from the code published in the article. Some I2C LCD driver modules have definable addresses. Please see the attached photo. If your unit is like mine, it will have three pads, marked A0, A1, and A2. The idea is you can short out the links (using soldered on jumper wire, or even better, solder on some header pins and use links. The header pins just fit on the solder pads). It seems these address pins are tied HIGH (1) if they are not connected (so linking them will take them low (0)). Hence the address of my LCD module, with no links on the address pins is 0x27, as shown in the code below.Maybe this will help.RegardsMark#include <Wire.h>#include <LCD.h>#include <LiquidCrystal_I2C.h> // F Malpartida's NewLiquidCrystal library#define I2C_ADDR 0x27 // Define I2C Address for controller#define En_pin 2#define Rw_pin 1#define Rs_pin 0#define D4_pin 4#define D5_pin 5#define D6_pin 6#define D7_pin 7#define BACKLIGHT 3LiquidCrystal_I2C lcd(I2C_ADDR,En_pin,Rw_pin,Rs_pin,D4_pin,D5_pin,D6_pin,D7_pin);void setup(){lcd.begin (20,4); // initialize the lcd// Switch on the backlightlcd.setBacklightPin(BACKLIGHT,POSITIVE);lcd.setBacklight(HIGH);}void loop(){// Reset the displaylcd.clear();delay(1000);lcd.home();// Print on the LCDlcd.backlight();lcd.setCursor(0,0);lcd.print("Hello Isla from Dad!");delay(1000);}

    View Instructable »