
Button 1 Label _RUN
Button 2 Label _STOP
Button 3 Label _PAUSE

Button 5 Label CONTINUE
Button 6 Label STEP

Button 8 Label  Turn the LED ON
Button 9 Label  TURN LED OFF
Button 10 Label Turn the LED  to RED
Button 11 Label TURN LED  COLOUR BLACK

Button 13 Label EnableButton1
Button 14 Label DisableButton1

Variable Numeric Slot_CommandsToBlockly = 1

Stop

' =============================================================
'  SEND COMMAND (default timeout = 0.5 Sec)
' =============================================================
Label SendCommand
	Variable Numeric SC1       '<-- Parameter Destinat.-Slot
	Variable String  SC2       '<-- Parameter Command-String
	Variable Numeric SC3 = 0.5 '<-- The timeout in seconds
	Variable Numeric SC4
	SlotText SC1 = SC2
	For SC4 = 0.1 To SC3 Step 0.1
		If SlotText(SC1) = ""
			Exit
		EndIf
		Wait Seconds 0.1
	Next
Return

' =============================================================
'  COMMANDS TO GPS
' =============================================================
Label _RUN
	SendCommand(Slot_CommandsToBlockly)("Run")
Return
Label _STOP
	SendCommand(Slot_CommandsToBlockly)("Stop")
Return
Label _PAUSE
	SendCommand(Slot_CommandsToBlockly)("Pause")
Return
Label STEP
	SendCommand(Slot_CommandsToBlockly)("STEP")
Return
Label CONTINUE
	SendCommand(Slot_CommandsToBlockly)("CONTINUE")
Return

Label Turn the LED ON
	SendCommand(Slot_CommandsToBlockly)(Turn the LED ON)
Return

Label TURN LED OFF
	SendCommand(Slot_CommandsToBlockly)(TURN LED OFF)
Return

Label Turn the LED  to RED
	SendCommand(Slot_CommandsToBlockly)(Turn the LED  to RED)
Return

Label TURN LED  COLOUR BLACK
	SendCommand(Slot_CommandsToBlockly)(TURN LED COLOUR BLACK)
Return

Label EnableButton1
	SendCommand(Slot_CommandsToBlockly)(EnableButton 1)
Return
Label DisableButton1
	SendCommand(Slot_CommandsToBlockly)(DisableButton 1)
Return


'WATCH SewTo_Speed
'EXEC Button 5 Text Button5
