Hi guys and girls,
I’m running a photon connected to your 2CH relay I2C board.
I’ve managed to get the libraries going as well as the basics of the code.
There seems to be an issue though with individual relay addressing.
Firstly you have to address the Port Register which makes no sense as there really is only one 0x01 based on the following code in your libraries as I’m using the output:
class I2CBZ{
public:
bool initialize(int directionReg);
void buzzer(int command);
private:
int address = 0x41;
int inputPortReg = 0x00;
int outputPortReg = 0x01;
int polarityInversionReg = 0x02;
int gpioConfigReg = 0x03;
};
So Wire.write(0x01) – Supposed to address all outputs
writing Wire.write(0x01)
again triggers relay 1 to HIGH
writing Wire.write(0x02)
triggers relay 2 to HIGH (using either 0x01 or 0x02 as the port register)
So to this point I’m addressing each relay to turn on, no problem.
When following the rule, using 0x01 with 0x00 to turn relay back to LOW, both relays fall to LOW.
When using 0x02 with 0x00, nothing happens.
As a matter of interest I used 0x03 and all relays turn to HIGH,
how do I switch individual relays off one, at a time?
Thank you