Hi All,
just to already warn you, I am pretty much a newbie about electronics and just started to wrap my head around the arduino platform in order to build up a terrarium controller.
What I have so far:
- 3 x LM75A temperature sensors via I2C, all working like a charm
- couple of LEDs controlled via digital output, working as well
- LCD 2x10 via I2c, display is HD44780 based and is hooked off of a PCF8574 - NOT WORKING
I bought the display as a complete unit. The only thing I got with it is a piece of C code but unfortunately I do not know how the PCF8574 is connected to the HD44780.
The c code I got with it is the following:
void setup(){
Wire.begin();
}
void loop(){
Wire.beginTransmission(39);
Wire.send(B00000000);
delay(15);
// init
Wire.send(B00000011); // X E RW RS D7 D6 D5 D4
delay(5);
Wire.send(B01000011);
delay(5);
Wire.send(B00000011);
delay(5);
Wire.send(B01000011);
delay(5);
Wire.send(B00000011);
delay(5);
Wire.send(B01000011);
delay(5);
Wire.send(B00000011);
delay(5);
Wire.send(B00000010);
delay(5);
Wire.send(B01000010);
delay(5);
Wire.send(B00000010);
delay(5);
Wire.send(B00000010);
delay(5);
Wire.send(B01000010);
delay(5);
Wire.send(B00000010);
delay(5);
Wire.send(B00001100);
delay(5);
Wire.send(B01001100);
delay(5);
Wire.send(B00001100);
delay(5);
Wire.send(B00000000);
delay(5);
Wire.send(B01000000);
delay(5);
Wire.send(B00000000);
delay(5);
Wire.send(B00001000);
delay(5);
Wire.send(B01001000);
delay(5);
Wire.send(B00001000);
delay(5);
Wire.send(B00000000);
delay(5);
Wire.send(B01000000);
delay(5);
Wire.send(B00000000);
delay(5);
Wire.send(B00000001);
delay(5);
Wire.send(B01000001);
delay(5);
Wire.send(B00000001);
delay(5);
Wire.endTransmission();
}
The code itself seems to be running, but the only thing I see is that the display gets initialized (gets wiped once I did Wire.send(B000000)).
Also, I do not really get what is being meant with the comment // X E RW RS D7 D6 D5 D4
up there. Is that how the 8 P ports on the PF8574 are mapping to the Display?
Thanks already for any hints or tips,
Passi