Hello All!
I hope all is going well!
Situation: I have a 2 channel relay to control powering on a 12v LED strip. I'll be using an Arduino Uno (that has been collecting way too much dust) with a rocker switch that I will test powering the led strip on and off.
Question:
I am following the tutorial Using Arduino push button to Push ON and Push OFF relay and AC bulb (toggle) by Robojax with the completed code here: Using Arduino push button to Push ON and Push OFF relay and AC bulb - Robojax
The code provided works perfectly and I understand it enough to follow along however, how can I change the code such that when I toggle the rocker switch that the led strip turns on and off?
What is happening currently:
- The code has been compiled and uploaded.
- The led strip only turns on via the relay when I toggle the switch twice (which is to be expected since the code is for a push button and not a rocker)
I would greatly appreciate any kind of help on this! I have been googling my eyes out over here attempting this. Forgot to add that I tested the ezbutton toggle library by itself with said rocker switch on its own but I am unsure of how make it such that this library works the way I want it. I am thinking maybe add code for the signal pin in this library so it knows that the relay is there and to switch it off when there is an on/off event?