How hard can it be to use an Arduino to control two relays using two momentary switches? Answered
This is a problem which I have been trying to solve for literally months now! I am using an Arduino Nano (V3.0) to operate two non latching relays by the push of a button. Switch A will turn on Relay A at the first push, it will then turn it off at the second push. Switch B does the same to Relay B, hopefully.
So far, I have been using the 'debounce' example to control one set - Switch A and Relay A. This works perfectly, however I have issues when I try and make a sketch which will enable both A and B to work together at the same time but independently. After spending hours researching and looking through the Arduino forums, I know it can be done, but most likely not with this sketch due to the 'delay' in there? I read about the 'millis' command somewhere too, but I'm baffled by it! Obviously, I still have A LOT to learn about Arduinos.
The circuit is wired up and ready, I could just really do with a bit (*lot! ;) ) oh help with the programming, as it seems like it needs to be completely re-written :(
Last thing - this is part of my A-level Product Design project, and my deadline is next week, so if this approach cannot be resolved, I'll just have to buy a second Nano and use both, which seems a waste of two pretty powerful microelectronics!