I am having an Arduino Uno and a C2042A LCD with I2C shield on it. Because the VirtualWire library does not work for me. I tried only the wire library but it's still not working:
My code:
#include <Wire.h>
void setup() {
Wire.begin(0x63);
}
void loop() {
Wire.write(4);
}
I just read on this website which commands you have to use but it doesn't do anything. What is my fault, how to solve it?
-
Please add a link to the LCD Shield.Mikael Patel– Mikael Patel2016年08月22日 13:02:58 +00:00Commented Aug 22, 2016 at 13:02
-
use can see and read about the lcd here: robot-electronics.co.uk/htm/Lcd03tech.htmNumber_987– Number_9872016年08月22日 13:06:28 +00:00Commented Aug 22, 2016 at 13:06
-
You need to first read about how to use Wire and then the LCD communications protocol. The above code snippet is not a complete command.Mikael Patel– Mikael Patel2016年08月22日 15:37:15 +00:00Commented Aug 22, 2016 at 15:37
3 Answers 3
SOLVED!
I forgot to write beginTransmission()
. Here's my code:
#include <Wire.h>
void setup() {
Wire.begin(0x63);
}
void loop() {
Wire.beginTransmission(0x63);
Wire.write(byte(0x00));
Wire.write("Temperatur:");
Wire.endTransmission();
}
The documentation under the link you posted says: "The I2C display is located on the I2C bus at an address of 0XC6.", not the address you have used in your code.
-
no the adress is 0x63 tested with i2c scannerNumber_987– Number_9872016年08月22日 15:20:45 +00:00Commented Aug 22, 2016 at 15:20
-
1@marangisto many I2C addresses are quoted like this as an 8 bit value - made up of the 7 bit address plus the data direction (read/write) bit. 0b11000110 (0xC6) removing the least significant bit is 0b1100011 (0x63). There is also 10 bit addressing (i2c-bus.org/addressing/10-bit-addressing), but that only confuses things even further...KennetRunner– KennetRunner2016年09月21日 16:37:56 +00:00Commented Sep 21, 2016 at 16:37
You can't begin writing unless you first initialize it like with Serial.begin
In this case you don't show Wire.beginTransmission.
Perhaps it is in the code you didn't show us, but it is required.