Pages: [1]   Go Down
Author Topic: Leonardo LCD03 I2C  (Read 270 times)
0 Members and 1 Guest are viewing this topic.
Offline Offline
Jr. Member
**
Karma: 0
Posts: 77
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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
Logged

Switzerland
Offline Offline
Faraday Member
**
Karma: 108
Posts: 5144
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Code:
#define adresse 0xC6

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

Code:
#define adresse 0x63
Logged

Offline Offline
Jr. Member
**
Karma: 0
Posts: 77
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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

Now I2C works
Logged

Pages: [1]   Go Up
Jump to: