HI
I am in the process of creating a light control system, I have three buttons turning on and off 3 lights through a relay.
I use 2 arrays one containing the pins for the buttons and one for the pins for the lights.
I loop through the first array and check the buttons state, if the button is pressed I pass the position of the array to the light array and toggle the state of the pin. All works well.
I would now like to have one button turn on 2 lights, one 12 V and the other 240. what's the best approach?
I know I could create an array for each button which could contain the values of the pins it pulls high or low. But I am sure there must be a better way to achieve this.
thanks
Jasemilly