I believe your observation about button vs switch is correct. Pg 72 has a blurb about it at the bottom of the page.
I think for your use case here, a switch is a better choice. I am using a button as a way to advance my script after I've performed an action like adding grain, hops, etc.
what is should read:
Buttons
Buttons have a
State property which can be read or written.
Read:
New bool x
x = “Button 1” State
Set:
“Button 1” State = False
A Button may also be Left Clicked or Touch Screened to turn from Off (False) to On (True)
{One Way: False to True Only!}
The State of the Button is not apparent unless you use an Environmental Appearance Theme like “Pumpkin”.
You can use the read State Property in a Wait or if-endif Statement to do something when the button is click to True. You must use Script Code to turn any Button back to False. Once set to true by a Click, it will stay True until a Script reset:
"The Button" State = false
This code makes the button act like a Toggle:
"The Button" State = false
[Pump1 ControlOn] // Pump on when Button On Section
sleep 100 // Prevents accidental double click of Button
wait "The Button" state == true // Wait till Button Clicked
if "The Button” state == true
"Pump 1" State = True // Turn on the Pump
"The Button" State = false // Reset Button to false
goto " Pump1 ControlOff"
endif
[Pump1 ControlOff]
sleep 100 // Prevents accidental double click of Button
wait "The Button" state == true // Wait till Button Clicked
if "The Button" state == true
" Pump 1" State = False // Turn off the Pump
"The Button" State = false // Reset Button to false
goto " Pump1 ControlOn"
endif
Switches
Switches have a
State property which can be read or written.
Read:
New bool x
x = “Switch 1” State
Set:
“Switch 1” State = False
A Switch has a slide bar that you may click or Slide from Off (False) to On (True) then Back to Off (False). The Bar Changes Color when it is “On”
You can use the read State Property in an if-endif Statement to do something when the switch is slide to True or False.
if "The Switch” state == true
"Pump 1" State = True // Turn on the Pump
else
"Pump 1" State = False // Turn off the Pump
endif