I'm using an arduino mega 2560 board with a lcd i2c converter. I type the code in the editor but the message is not shown in the lcd screen. I have looked for in several web sites, but I haven't succes.
Could you help me? It's a great project that I've started...
The first thing to do is to run an I2C scanner to confirm the LCD's I2C address and that the LCD is communicating over the bus. Upload and run this scanner and please report the results.
Make sure to set serial monitor baud rate to 115200.
// I2C scanner by Nick Gammon. Thanks Nick.
#include <Wire.h>
void setup() {
Serial.begin (115200); //***** make sure serial monitor baud matches *****
// Leonardo: wait for serial port to connect
while (!Serial)
{
}
Serial.println ();
Serial.println ("I2C scanner. Scanning ...");
byte count = 0;
Wire.begin();
for (byte i = 1; i < 120; i++)
{
Wire.beginTransmission (i);
if (Wire.endTransmission () == 0)
{
Serial.print ("Found address: ");
Serial.print (i, DEC);
Serial.print (" (0x");
Serial.print (i, HEX);
Serial.println (")");
count++;
delay (1); // maybe unneeded?
} // end of good response
} // end of for loop
Serial.println ("Done.");
Serial.print ("Found ");
Serial.print (count, DEC);
Serial.println (" device(s).");
} // end of setup
void loop() {}