I’m a new user to NCD products. I bought two products from NCD, the 4-Channel I2C PCA9536 Optical Isolated Digital Input with I2C Interface and the Analog Devices AD5254 Digital Potentiometer 4-Channel 256-Position I2C Mini Module. I got the DigiPot setup in Arduino and running perfect in 30 minutes. Then I came to the Optical Isolated GPIO and I’m banging my head against the wall. I’ll explain what I’m trying to do because I’m think I might be misunderstanding what the GPIO board can do.
I am trying to emulate 4 button presses with my Arduino and for this discussion we only need to pretend I’m controlling 1 button. Before I bought the NCD board, I bought a PC817 Optocoupler and used a breadboard to test out my “button pressing”. My button has 3V going through it. So I was able to send 5V to my optocoupler (through Pin 1 & 2 on PC817) and this closed the circuit on my 3V button (through Pin 3 & 4).
This led me to buy the 4 Channel GPIO as it seemed exactly what I needed to. In fairness I am quite new to electronics, as this is a hobby for me and my son. I am C++ developer and I can say I am humbled every time I tackle a new electronics project because I realize there is so much I don’t know.
Question 1: Is this GPIO board the correct device for having the Arduino activating the optocouplers in this board, so I can emulate my button presses?
Question 2: If so, are there any code examples in Arduino to activate each channel? I have searched google and found libraries for controlling the PCA9536. I have used straight code using <wire.h>, just as I use the DigiPot. Nothing I do in the code activates/deactivates the channels on the GPIO board. I have my 3V button line on “IN1” on the board and I have my volt meter across the terminals. I always read 3V (I expect when I set LOW, it should break the circuit and I should read 0V). I downloaded and tried the <SparkFun_PCA9536_Arduino_Library.h> and nothing.
Thanks for any help!