I have 3 relays connected to Arduino Uno. These relays are used to trigger valves. I need a logic to sort the sequence.
User will specify a series of input to control the timing of each relay multiple times. like.. all values are in milliseconds from T0 (button press)
Relay | Open | Close
Relay 1 | 500 | 600 Relay 1 | 950 | 1100 Relay 1 | 1400 | 1575
Relay 2 | 1050 | 1200 Relay 2 | 1600 | 1700
Relay 3 | 1900 | 2000
each time user may specify different values and different steps. What would be best way to trigger each on and off at the correct timing!
I was thinking of converting this input to another table with RELAY, TIMING, ACTION as below.. Further sort it based on timing and follow the sequence. Is that good idea? If so what would be easy way to code it in Arduino, something like an array would be the way?
Relay | timing | action
Relay 1 | 500 | Open Relay 1 | 600 | Close Relay 1 | 950 | Open Relay 1 | 1100 | Close … …
Best Regards Joe