Pages: [1]   Go Down
Author Topic: Multiple I2C LCD's  (Read 2168 times)
0 Members and 1 Guest are viewing this topic.
Offline Offline
Newbie
*
Karma: 0
Posts: 4
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

I am unable to get multiple I2C displays working.  I am using the LCDi2cNHD.h library.  When I try 2 LCD's, everything displays on the second LCD.  Here is a simple code.  I know the I2C addresses are correct, because if I test each one individually they work correctly.  Any help?  Thanks

Code:
#define VERSION "1.1"
#include <Wire.h>
#include <inttypes.h>

#include <LCDi2cNHD.h>                   
LCDi2cNHD lcd = LCDi2cNHD(2,16,0x50>>1,0);
LCDi2cNHD lcd2 = LCDi2cNHD(2,16,0x4C>>1,0);

uint8_t rows = 2;
uint8_t cols = 16;



void setup() {

  lcd.init();     
  lcd2.init();   
 
 }


void loop()
{

     lcd.print("Hello World!");     
     lcd2.print("Hello World2!");     
 
}
Logged

Denver
Offline Offline
God Member
*****
Karma: 19
Posts: 778
Inactive - PM
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

Just as a quick experiment, you might try this I2C LED lib:
http://www.xs4all.nl/~hmario/arduino/LiquidCrystal_I2C/

Since it conforms to the same API, it should be easy to try.
Logged

"Data is not information, information is not knowledge, knowledge is not understanding, understanding is not wisdom."
~ Clifford Stoll

Offline Offline
Newbie
*
Karma: 0
Posts: 4
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Just as a quick experiment, you might try this I2C LED lib:
http://www.xs4all.nl/~hmario/arduino/LiquidCrystal_I2C/

Since it conforms to the same API, it should be easy to try.

I tried that library, however it does not seem to work at all with my Newhaven Displays LCD.  Has anyone ever got multiple i2c lcd's working?
Logged

Offline Offline
Newbie
*
Karma: 0
Posts: 4
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

I was able to get 2 I2C lcd's working.  I gave up on the libraries, and just used wire.h.  This code works without issue.




Code:
#include <Wire.h>

int lcd_addr = 0x50;
int lcd_addr2 = 0x4C;

void setup(){

  delay(1000);

  Wire.begin();
   
  lcd_addr = lcd_addr >> 1;
  lcd_addr2 = lcd_addr2 >> 1;
 
 
  Wire.beginTransmission(lcd_addr);
  Wire.send(0xFE);
  Wire.send(0x51);
  Wire.endTransmission();

  Wire.beginTransmission(lcd_addr2);
  Wire.send(0xFE);
  Wire.send(0x51);
  Wire.endTransmission();
 
 
  delay(2000);
 
 
  Wire.beginTransmission(lcd_addr);
  Wire.send("This is LCD1");
  Wire.endTransmission();
   
  Wire.beginTransmission(lcd_addr2);
  Wire.send("This is LCD2");
  Wire.endTransmission();

}



void loop(){
   
}
Logged

Madrid, Spain
Offline Offline
Newbie
*
Karma: 0
Posts: 41
void guarantee{};
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

Have you tried to follow this tutorial: http://www.ladyada.net/products/i2cspilcdbackpack/
I got two i2C lcd working with the code.
Are you using Standard HD44780 LCDs or another type?
Paul
Logged

Offline Offline
Newbie
*
Karma: 0
Posts: 4
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Have you tried to follow this tutorial: http://www.ladyada.net/products/i2cspilcdbackpack/
I got two i2C lcd working with the code.
Are you using Standard HD44780 LCDs or another type?
Paul


No I have not tried that library.  I have everything working now with the wire library.  I may try this library on a future project.  Thanks
Logged

Global Moderator
Netherlands
Offline Offline
Shannon Member
*****
Karma: 170
Posts: 12451
In theory there is no difference between theory and practice, however in practice there are many...
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Quote
I have everything working now with the wire library.
Please post your working code for later reference,

tia rob
Logged

Rob Tillaart

Nederlandse sectie - http://arduino.cc/forum/index.php/board,77.0.html -
(Please do not PM for private consultancy)

Pages: [1]   Go Up
Jump to: