Dear all,
I am trying to interface with the matrix orbital LK202-25 LCD through I2C. So far, no success. I think I have tried pretty much everything possible. Also couldn't find much with google.
I have tried a lot, but following code seems to me the best to apply:
#include <Wire.h>
#define LCD_I2C_WRITE_ADDRESS 0x28 // address is default 0x50, shift bits to the right for Arduino: 0x28
void setup(void) {
Wire.begin(); // setup I2C
Serial.begin(9600); // setup serial
// turn off auto transmission of data in RS232
Wire.beginTransmission(LCD_I2C_WRITE_ADDRESS);
Wire.send(254);
Wire.send(160);
Wire.send(0);
Wire.endTransmission();
}
void loop(void)
{
if (Serial.available() > 0){
// read the oldest byte in the serial buffer:
int inByte = Serial.read();
if (inByte == '1')
{
Serial.println("Sending command");
// write a simple “HELLO” message
Wire.beginTransmission(LCD_I2C_WRITE_ADDRESS);
Wire.send(0x48);
Wire.send(0x45);
Wire.send(0x4C);
Wire.send(0x4C);
Wire.send(0x4F);
Wire.endTransmission();
Serial.println("Command Issued");
}
}
}
If I send '1', I receive the print commands in the serial box of Arduino, which tells me that the commands are sent. The LCD just does not respond. I don't think pull up resistors are required, I have tried, but as soon as I apply these, the loop hangs and gets stuck at "Sending Command". I use the extended voltage, so I apply 12V supply.
I have succesfully communicated with a devantech relayboard without using pull up resistors, so I doubt I need them as well for the LCD. If I do, what resistor value should I apply, and should I pull up from the 5V arduino, or the 12V supply to the LCD?
I have also soldered the I2C jumpers on the LCD board and removed the RS232 ones from the LCD board. Is there anybody out there which has experience with this LCD and I2C? Thanks in advance!
best regards,
Remco