3.3. Gpioserver, Button

The values from the button are available in palette 'sensing', right down at the bottom at '... sensor value'.

The value is '1' for an open button and '0' when button pressed. The reason is the connection with a pullup resistor.

Sensor values.

Task: Control the LED with the button:

forever
    if gpio23 sensorvalue == 1
        broadcast gpio17off
    else
        broadcast gpio17on

Sensor values.

Sample code piandmore_gpioserver_button.sb

Additional idea to spend some time: Build an edge detector for the button.