0

I'm working on a project, and I'm using an arduino Uno. I want to use 4 shields (OLIMEX Shield lcd 16x2) to print datas (a data for every lcd). So, I think I have to give every lcd an adress (or an ID). I searched on the net to find something, but I didn't found an answer.

Do you have any suggestion ?

Thank you in advance.!!

1 Answer 1

0

I already ask this question and I have the answer of it now.

Well, using a shield type "OLIMEX Shield lcd 16x2" is related to use the library named "LCD16x2.h", which required using I2C protocol, and this library don't let you change the property of the lcd. In this library you have to initialise your lcd this way :

    LCD16x2 lcd;

The solution is to use normal lcd 16x2 that allows you to use the pins configuration. The code for your 4 lcd is this way :

#include <LiquidCrystal.h>

// You only have to change your second number, make 11 or 10 or 9...


LiquidCrystal lcd1(12, 11, 5, 4, 3, 2);
LiquidCrystal lcd2(12, 10, 5, 4, 3, 2);
LiquidCrystal lcd3(12,  9, 5, 4, 3, 2);
LiquidCrystal lcd4(12,  8, 5, 4, 3, 2);

void setup()
{
// Your code
  lcd1.begin(16, 2);
  lcd2.begin(16, 2);
  lcd3.begin(16, 2);
  lcd4.begin(16, 2);

  lcd1.print("text1");
  lcd2.print("text2");
  lcd3.print("text3");
  lcd4.print("text4");

}

void loop()
{

  lcd1.setCursor(0, 1);
  lcd2.setCursor(0, 1);
  lcd3.setCursor(0, 1);
  lcd4.setCursor(0, 1);

  lcd1.print("anythingYouWant");
  lcd2.print("anythingYouWant");
  lcd3.print("anythingYouWant");
  lcd4.print("anythingYouWant");
}

Thank you all !!

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.