Combining LCDs and Wire (TWI/I2C)

Hi all,

I'm trying to connect 2 LCD screens, 5 sensors + 10 RGB leds through Wire and a QT110.

Individually, everything is working. However, when I combine the LCD screens and the Wire, one or both of them are not working.

I will post the setup for now, if you need more information please let me know!

void setup() {

  Serial.print (1);


  for (int i = 0; i < numberOfBoards; i++){
  for (int i = 0; i< sensorArraySize; i++){
     sensorValues[i] = 0; 
  for (int i = 0; i< numberOfLeds*3; i++){
     leds[i] = 0;

  lcd.begin(16, 2);
  lcd.print("hallo, ik ben 1!");
  lcd2.print("en ik ben 2!");

I used the serial print to keep track of where I am.
Is there a problem of combining the two?


This may not be a very good answer, but as you've had none so far...

I would guess you are trying to use at least one of the Arduino pins for more than one thing? This can work in some cases, but is frequently going to cause problems.

I don't know what LCDs you are using, but they probably each need a dedicated pin, one that is different from the ones used by "serial." to talk to the Arduino IDE's serial monitor. And likewise the other things you mention connecting, and the Wire library... but I know those things hardly at all.

Try getting just the to LCDs and the serial monitor (if you need it) working together first. Once they're okay, see about adding the rest.

There is information on using an LCD and serial monitor at the same time in...

(That tutorial is quite a lot bigger than most in the series, but it is the one that covers what you may find useful.)