Go Down

Topic: Leonardo LCD03 I2C (Read 349 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
 


Please enter a valid email to subscribe

Confirm your email address

We need to confirm your email address.
To complete the subscription, please click the link in the email we just sent you.

Thank you for subscribing!

Arduino
via Egeo 16
Torino, 10131
Italy