Thank you for all your help.
I understand the bit about tying the address lines.
(Do I need to add more pull up resistors?)
I don't really understand how to set up a unique address for each chip.
Are you referring to pin A0?
I am trying to control lamps and buttons on a pinball machine.
I would like to do the following:
Using 4 PCF8575s I would like to use
1 PCF for 16 inputs.
3 PCFs for 3 x 16 outputs.
I used the code below successfully with 1 PCF8575
How do I modify the below code to work with 4 PCF8575s?
#include "mbed.h"
#include "PCF8575.h"
PCF8575 IO(p9, p10, 0x40); // sda, scl, address
int var;
byte a;
// integer variable
int main() {
while(1){
IO.write(0xFFFF); // All outputs goes high.
wait(1);
IO.write(0x0000); // All outputs go low
wait(1);
var = IO.read(); // Read the inputs on the PCF8575 to integer.
}
}
Cheers
David
I have successfully built this circuit.
I now have 16 outputs. 16bit
How do I get 32 outputs. 32bit
Or 64 bits.
Apparently you can link up to 5 of these.
I have tried connecting 2 of these by linking pin1, with no luck.
Thanks in advance.