Skip to content

CSD-01 Tact Switch ​

Instance declaration ​

When you add a CSD-01 Tact Switch block to the workspace, the following instance declaration is automatically inserted into the Python code:

python
cheesestick = CheeseStick(0)
csd01 = cheesestick.CSD01()

Parameters ​

NameKindDescriptionRange / TypeDefault
indexDropdown optionInstance number (starting from 0)Integer 0 or greater0

Set the input port ​

Sets the port that CSD01 (Tact Switch) is connected to.

set_input_port

Parameters ​

NameKindDescriptionRange / TypeDefault
unitDropdown optionPort to connect toSa, Sb, Sc-

Python ​

python
cheesestick = CheeseStick(0)
csd01 = cheesestick.CSD01()

csd01.set_port('Sa')

Button input value ​

The button input value of the selected port
It returns 0 if the button is pressed, and 1 otherwise.

button_input

Parameters ​

NameKindDescriptionRange / TypeDefault
unitDropdown optionPort to read fromSa, Sb, ScThe port of the last set_port

Python ​

python
cheesestick = CheeseStick(0)
csd01 = cheesestick.CSD01()

csd01.button_input('Sa')

Is the button pressed? ​

Whether the switch button connected to the selected port is pressed

button_pressed

Parameters ​

NameKindDescriptionRange / TypeDefault
unitDropdown optionPort to read fromSa, Sb, ScThe port of the last set_port

Python ​

python
cheesestick = CheeseStick(0)
csd01 = cheesestick.CSD01()

csd01.button_pressed('Sa')