Simple example for using a switch in a sketch

I’ve created a simple sketch where a switch determines what the lights do. (Just indicators, police lights or throttle lights).
On the Taranis I’ve just assigned a switch to channel 5 (that is nr 4 in the array).

Download MultiModeLights sketch here.

This is just one of the ways to do it. The switching is not immediate because each function finishes it’s cycle before the state of the switch is checked, but I don’t think that is a problem.