Using a MCP23017 to feed a 2 different 4511 7 segement LED drivers.
Bank A to feed 7Segment (1) 4511, Bank B to feed 7Segment(2) 4511
I’m getting the same output on bank A pins, as I’m getting on Bank B.
I must be missing something, regarding separating them.
For the sake of this example, I want Bank A to send all 0’s
and Bank B is sending the value of the variable countDown but instead bank A is outputting the countdown as well, but would like it to be just zero
void setup() {
// put your setup code here, to run once:
//*********************************SETUP THE IC TO BE OUTPUTS ON BANK A AND BANK B***************************
Wire.begin(); // creates a wire object
Wire.beginTransmission(0x20); // begins talking to the slave
Wire.write(0x00); // Select Bank A
Wire.write(0x00); // Set bank A to 0 which is Output
Wire.endTransmission(); //Stop talking to slave
Wire.beginTransmission(0x20); // start talking again to slave
Wire.write (0x01); // Select Bank B
Wire.write (0x00); // Set all of bank B to 0, which is outputs.
Wire.endTransmission(); // Stop talking to Slave
}
void loop() {
Wire.beginTransmission(0x20); //starts talking to slave device
Wire.write(0x12); // This selects Bank A pins (not the bank, the actual pins)
Wire.write(0b00010000); //write a 1 - The 1 is set the latch high to take a new value
Wire.write(0b00000000); //now write a value of 0 to get a 0 on the display
Wire.write(0b00000000); // now write the latch pin LOW to latch the data and display it on the screen.... and also keep the 0 value
Wire.endTransmission();//ends communication with the device
countDown = 9;
while (countDown < 10) {
Wire.beginTransmission(0x20); //starts talking to slave device
Wire.write(0x13); // This selects Bank B pins
Wire.write(0b00010000); //write a 1 (high to pin 5 of 8 in bank B - The 1 is set the latch on 4511 high to take a new value
Wire.write(countDown); //now write a value of the countDown
Wire.write(countDown); // now write the latch pin LOW to latch the data and display it on the screen.... and also keep the countDown value displayed.
Wire.endTransmission();//ends communication with the device
one = one - 1;
delay (500);
}