Skip to content

Sensor: 2 POSITION TOGGLE SWITCH

Jaume Olivé Petrus edited this page Oct 30, 2017 · 4 revisions

Back to sensor blocks

Sensor information

What Comments
Read () from sensor
When() changes from sensor
pos 1 = switch in pos 1
0 = switch in pos 0
Set () with value for sensor none
  • With this sensor you can get the position of a SPST (single-pole, single-throw) switch, or a SPDT (single-pole, double-throw) switch.
  • A SPST has 2 terminals. Connect one terminal to a GPIO, and the other terminal to GND.
  • A SPDT has 3 terminals. Connect one terminal to a GPIO, and one of the others to GND.
  • Hardware pull-ups are not required.
  • Hardware debouncing are not required.
  • When the GPIO level state changes the sensor reads the switch position and a callback is executed reporting the switch position.

Back to sensor blocks

Clone this wiki locally