LiquidCrystal and Wire collision?


I have sucsessfully interfaced an LCD(using LiquidCrystal) and a DS18b20 onewire (using onewire.h from the playground). Everything works nicely, but when i try to interface a couple of I2C EEPROM memorys using the "wire.h" the LCD simply fails to initialize, slowly fading away showing weird figures.

Is there any known collision that can occur between these librarys? everythink works great on its own, but not together, none of the pins are used by both.

Anyone got any idea?



I have looked some more at the problem, and found that it is when i add the line "Wire.begin();" that the LCD wont work... wounder why...


I just started playing with the Arduino, and I’m having a similar problem. I am trying to use the wire library to interface the HMC6352 compass module and the LiquidCrystal library to display results. I am also communicating over serial.

These three things (wire, LiquidCrystal and serial) sometimes give me random hangups and weirdness. The hangups always seem to occur at the wire.begin() line, but they only occur if all three components are used.
Sometimes, adding a simple line (like serial.println(“a”) somewhere in the sketch will suddenly cause everything to work.

The simplest sketch I can come up with that hangs is below. If I include the serial.println line, the sketch will run. If I comment it out, it doesn’t run. Anybody know what’s going on here?

#include <Wire.h>
#include <LiquidCrystal.h>
LiquidCrystal lcd(12, 11, 5, 4, 3, 2);

int ledPin = 13; // LED connected to digital pin 13

void setup()
pinMode(ledPin, OUTPUT);
//Serial.println(“a”); // uncommenting this line will cause sketch to run properly


void loop()
digitalWrite(ledPin, HIGH); // check for quick blinky
delay(100); // to see if sketch runs
digitalWrite(ledPin, LOW);

Bump, Im also seeing simliar problems. Im using the modified LiquidCrystal library, and the Dallas Temperature Sensor library along with a DS18B20. I never noticed a problem with the DS18S20 but when I switched to a B20 I sometimes check on the screen and see that it is filled with random garbage characters, which requires a restart. It doesnt happen in a certain time frame, or under any specific conditions, it just... happens.

I also hit this bug. I discovered that there's a bug tracking system on the Google Code site for Arduino, so I added this issue to it. Issue #125 (since this is my first post on this site, they don't let me link to it yet. Let me see if I can get a direct URL here in a moment...)

Alrighty, let's give this a shot:

Try changing this line:

LiquidCrystal lcd(12, 11, 5, 4, 3, 2);

Add an extra read/write pin parameter (I'll use 6, but apparently you can use any unused pin):

LiquidCrystal lcd(12, 6, 11, 5, 4, 3, 2);

This seems to work for me

this works for me too - thanks!


I think they fixed the R/W problem in v0018. Why don't you try your original code with v0018 and see if it works.