Master and Slave toggle Button

Touch Portal Snippets

A button that toggles between ON and OFF but only if the master button is turned ON.

The master

On Press

Our master controls both the electrical system as the engine (our slave button). When we press the button and the electrical system is ON then we turn OFF both the master and the slave. The master button enforces the slave to be turned off.

On Event

Our events just change the visuals of the master button. Nothing new here.



The slave

On Press

Our slave turns of the engine. But since it is the slave, we also added that it can only be turned ON if the electrical state is also ON (the state of our master button)

On Event

Our events just change the visuals of the master button. Nothing new here.




Back to Guide Overview