
' Theremino Automation demo program

' Bistable button that changes multiple states

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

' ------------------------------------ FUNCTIONS
Label LedChange
	Select Slot(LED)
		Case 0
			Gosub Led30%
		Case 300
			Gosub Led60%
		Case 600
			Gosub Led100%
		Case 1000
			Gosub LedOFF
	EndSelect
Return

Label LedOFF
	Slot LED = 0
	Button LedChange Text "LED is OFF"
Return

Label Led30%
	Slot LED = 300
	Button LedChange Text "LED is 30%"
Return

Label Led60%
	Slot LED = 600
	Button LedChange Text "LED is 60%"
Return

Label Led100%
	Slot LED = 1000
	Button LedChange Text "LED is 100%"
Return


