I suspect this posting will reveal in painful detail that I am not a programmer. Generally I can find sample code that I have been able to use but I've not been lucky this time. Basically I'm trying to use a normally open (NO) push button to sort of sequentially control two relays. Initially the relays will be controlling two sets of LED lamps (3W to 10W variety).
From both outputs Low/Off, press button, if A=low/off and B=low/off, turn A=high/on (leave B=off)
press button, if A=high/on and B=low/off, turn A=low/off and B=high/on
press button, if A=low/off and B=high/on, turn A=high/on and B=high/on
press button, if A=high/on and B=high/on, turn both A & B = low/off
Basically the single button will command the relay/LEDs to light in sequence of A only, then B only, then Both A & B and finally both off.
I've reviewed some of the example code here, and initially thought the "Button State change" would apply but now don't think so. I'm now thinking I need some sort of "if/then" type of statement but can't figure it out. I firmly suspect I'll need the debounce logic for the momentary input switch but have seen a few examples of that and feel I can add that when the rest is figured out.
I'm intending on creating a project to allow one button to control two sets of auxiliary lights on a motorcycle. yes, I know it would be simple to add two SPST switches and control the lights but where is the challenge in that.
So, any guidance/advice for my simple brain??
Thanks in advance,
Rick