' Theremino Automation demo program

' Demonstrating read and write of Slot values
Button 1 Text F1
Button 2 Text F2

Stop

' A variable is incremented and written to the slot 1
Label F1
	Option Speed 7  ' 7 means 1000 instructions per second)
	v1 = 0
	Label F1b
		Slot(1) = v1
		v1 = v1 + 1
		If v1 > 1000 	' if more than 1000
			v1 = 0  	' reset to zero
		EndIf
	Goto F1b
Return


' The same, but using directly the slot value
' This demonstrates also how to use the "Speed 9"
' while reducing the CPU charge with "Wait Seconds 0.001"
Label F2
	Option Speed 9
	Slot(1) = 0
	Label F2b
		Slot(1) = Slot(1) + 1
		If Slot(1) > 1000	' if more than 1000
			Slot(1) = 0  	' reset to zero
		EndIf
		Wait Seconds 0.001
	Goto F2b
Return

