I2C module for 2004 display

bigone5500

Apr 9, 2014
712
Joined
Apr 9, 2014
Messages
712
*edit* This does in fact work with 20x4 displays.

http://www.banggood.com/IIC-I2C-TWI-SP-Serial-Interface-Module-Port-For-5V-Arduino-1602LCD-p-80365.html?p=NY231218164622015065

Display used: http://www.banggood.com/5V-2004-20X...-Arduino-p-915064.html?p=NY231218164622015065

SKU077364i.JPG
 
Last edited:

bigone5500

Apr 9, 2014
712
Joined
Apr 9, 2014
Messages
712
I have not seen that FAQ but upon reading and attempting to decipher it, the last post looks like it says it is, but you have to be good at it or not buy it...???? Huh???
 

bigone5500

Apr 9, 2014
712
Joined
Apr 9, 2014
Messages
712
I soldered on a header and attached the display to the adapter. Loaded a sketch and modified it so it would show on all 4 lines.

It works. I also replied to the post on the Banggood forum along with the image.

20150915_163931.jpg
 
Last edited:

Harald Kapp

Moderator
Moderator
Nov 17, 2011
14,272
Joined
Nov 17, 2011
Messages
14,272
Good to hear. Does it truly address all 5 lines separately? Your picture could have been created even if only 2 lines are addressed correctly and the other two are mirrored. Try 4 different texts, just to be on the safe side.
 

bigone5500

Apr 9, 2014
712
Joined
Apr 9, 2014
Messages
712
Good to hear. Does it truly address all 5 lines separately? Your picture could have been created even if only 2 lines are addressed correctly and the other two are mirrored. Try 4 different texts, just to be on the safe side.

True. I will do that later and post the results. I did take my clock sketch and just copy and paste the lines then change the row number.
 

bigone5500

Apr 9, 2014
712
Joined
Apr 9, 2014
Messages
712
I changed the sketch to verify that the display is not repeating itself. It is indeed working with a 1602 I2C interface. Disregard the temperature part of the sketch.

Here is the code I used...don't laugh...o_O

Code:
#include <OneWire.h>
#include <Wire.h>
#include <DallasTemperature.h>
#include <LiquidCrystal_I2C.h>
#include <RealTimeClockDS1307.h>

#define ONE_WIRE_BUS_1 2
#define Display_Clock_Every_N_Seconds 10
#define Display_ShortHelp_EveryN_Seconds 60

String tz;
int hours = 0;
int minutes = 0;
int seconds = 0;
int ap = 0;


OneWire oneWire_in(ONE_WIRE_BUS_1);

DallasTemperature sensor_inhouse(&oneWire_in);
LiquidCrystal_I2C lcd(0x27, 20, 4);

float TFI;

void setup(void)
{
  lcd.begin();

  Serial.begin(9600);
  Serial.println("Dallas Temperature Control Library Demo - TwoPin_DS18B20");

  sensor_inhouse.begin();

  Serial.begin(9600);

  pinMode(A3, OUTPUT);
  digitalWrite(A3, HIGH);
  pinMode(A2, OUTPUT);
  digitalWrite(A2, LOW);
}

void loop(void)
{
    RTC.readClock();
    if(ap == 1)
    {
    tz = "PM";
    }
    else
    {
    tz ="AM";
    }
    lcd.home();
    hours = RTC.getHours();
    minutes = RTC.getMinutes();
    seconds = RTC.getSeconds();
    ap = RTC.isPM();
   /*
    dates = RTC.getDate();
    months = RTC.getMonth();
    years = RTC.getYear();
   */
   lcd.setCursor(0, 0);
   lcd.print("Time1: ");
    lcd.print(hours);
    lcd.print(":");
    if (minutes<10) (lcd.print(0));
    lcd.print(minutes);
    lcd.print(":");
    if (seconds<10) (lcd.print(0));
    lcd.print(seconds);
    lcd.print(" ");
   // lcd.print(tz);

      lcd.setCursor(0, 1);
   lcd.print("Time2: ");
    lcd.print(hours);
    lcd.print(":");
    if (minutes<10) (lcd.print(0));
    lcd.print(minutes);
    lcd.print(":");
    if (seconds<10) (lcd.print(0));
    lcd.print(seconds);
    lcd.print(" ");
   // lcd.print(tz);

      lcd.setCursor(0, 2);
   lcd.print("Time3: ");
    lcd.print(hours);
    lcd.print(":");
    if (minutes<10) (lcd.print(0));
    lcd.print(minutes);
    lcd.print(":");
    if (seconds<10) (lcd.print(0));
    lcd.print(seconds);
    lcd.print(" ");
   // lcd.print(tz);

      lcd.setCursor(0, 3);
   lcd.print("Time4: ");
    lcd.print(hours);
    lcd.print(":");
    if (minutes<10) (lcd.print(0));
    lcd.print(minutes);
    lcd.print(":");
    if (seconds<10) (lcd.print(0));
    lcd.print(seconds);
    lcd.print(" ");
   // lcd.print(tz);
  
  Serial.print("Requesting temperatures...");
  sensor_inhouse.requestTemperatures();
  Serial.println(" done");


  delay(100);
}
 

Harald Kapp

Moderator
Moderator
Nov 17, 2011
14,272
Joined
Nov 17, 2011
Messages
14,272
Very well, that FAQ was most misleading then.
 
Top