12-02-2025, 05:07 AM
I am building an off-road caravan and wish to use a simple smart switch to control the lights, etc. I found Kincony's Lesson 3 - Control relay by wall switch video on YouTube of a KC868-A4 receiving a momentary input switch that toggled the output relay on, a second momentary input toggled the relay off. It was perfect. I could have momentary switches in multiple locations to operate the same light (relay). I needed more relays, so ordered the larger A8 online.
I have zero experience with Arduino or ESP32, but I hoped to learn off the online examples. As part of that learning I discovered the A4 is different to the A8 through the addition of the PCF8574 to expand the I/O. I have managed to successfully upload the code from the Kincony - Arduino Lesson 19 on using the PCF8574, so I have the settings correct, I just can't find any code examples for making the A8 behave like the A4 example in lesson 3.
As a novice, could someone please point me in the right direction for the code to use a momentary press of a dry contact switch on an input to energise its corresponding relay, a second momentary contact on the same input to de-energise that relay again.
Obviously for all 8 inputs to control 8 relays. I would really appreciate it.
I have zero experience with Arduino or ESP32, but I hoped to learn off the online examples. As part of that learning I discovered the A4 is different to the A8 through the addition of the PCF8574 to expand the I/O. I have managed to successfully upload the code from the Kincony - Arduino Lesson 19 on using the PCF8574, so I have the settings correct, I just can't find any code examples for making the A8 behave like the A4 example in lesson 3.
As a novice, could someone please point me in the right direction for the code to use a momentary press of a dry contact switch on an input to energise its corresponding relay, a second momentary contact on the same input to de-energise that relay again.
Obviously for all 8 inputs to control 8 relays. I would really appreciate it.

