Go Down

Topic: Leonardo LCD03 I2C (Read 299 times) previous topic - next topic

maxmax39

Hi,
I am new with this ucontroller (just one on a wii drone).
I try to connect a LCD03 16 with i2c on a Leonardo.  To start I just want to clear screen.  The power come fron Leonardo board (5v) and I plug SCL and SDA with 2 pull up resistors (2k).
Here is the code (simple :-)):

Code:

#include <Wire.h>
#define adresse 0xC6

Void setup() {
  Wire.begin();
  Wire.beginTransmition(adresse);
  Wire.write((byte)(0x0C)); //clear screen
  Wire.write((byte)(0x13)); //turn on backlight
  Wire.endTransmission;
}
void loop () {

}

Thaks a lot
Max

pylon

Code: [Select]
#define adresse 0xC6

This is an 8-bit address, the Wire library expects a 7-bit address. Try this:

Code: [Select]
#define adresse 0x63

maxmax39

Thanks a lot,
I just starting to read about that.

Now I2C works

Go Up