http://www.nxp.com/documents/data_sheet/PCF8577C.pdf
The above data sheet is the chip I'm using. I have an LCD screen hooked to the PCF 8577 but all of the pins on the PCF 8577 are set at "0" so every segment is currently lit. I tried changing the values of the output pins with the following code, and nothing is happening. I think I might have the address for the chip wrong but I'm not sure. The Data Sheet says the address is "01110100" but it says that the chip has that automatically. However I have pins a0 -a2 set to ground, so maybe the address is different?
Hopefully someone can help. I'm stumped.
#include <Wire.h>
byte address = 01110100; // address of PCF8577 with A0-A2 connected to GND
byte input; // variable to receive the two bytes
byte c; // first of the two bytes to read
byte d; // second of the two bytes to read
void setup()
{
Wire.begin(); // join i2c bus
Serial.begin(9600); // used to Debug
}
void loop(){
byte a = B00000000; //Should mean Bank 1 regester 0
byte b = B11111111; //controls pins 1-7 in register 0
// by changing the 1's and 0's above you can control which pins are on and off.
// The chip sinks, So the 1's are off and the 0's are on.
Wire.beginTransmission(address); // send the address and the write cmnd
Wire.send(a); // pack the first byte
Wire.send(b); // second byte
Wire.endTransmission(); // send the data
delay(1000);
Wire.beginTransmission(address);
input = Wire.requestFrom(01110100,2);
c = Wire.receive();
d = Wire.receive();
Wire.endTransmission();
Serial.println(c, BIN);
// delay(1000);
Serial.println(d,BIN);
}
The read stuff at the end, is just because I was trying to use the serial monitor to see if I was actually effecting anything. But the monitor just spits out "0's"