
' Theremino Automation demo program

' Bistable button that changes state and color

' ------------------------------------ INITIALIZATIONS
Variable Numeric LED = 1
Button 1 Text LedToggle
Gosub LedOFF
Stop

' ------------------------------------ FUNCTIONS
Label LedToggle
	If Slot(LED) = 0
		Gosub LedON
	Else
		Gosub LedOFF
	EndIf
Return

Label LedON
	Slot LED = 1000
	Button LedToggle Text "LED OFF"
	Button LedToggle Color PowderBlue
Return

Label LedOFF
	Slot LED = 0
	Button LedToggle Text "LED ON"
	Button LedToggle Color Cyan
Return


