Switch: Difference between revisions
Jump to navigation
Jump to search
No edit summary |
|||
Line 5: | Line 5: | ||
= How to connect it electrically = | = How to connect it electrically = | ||
[[File:Switch02.PNG]] | |||
= How to control it in MicroPython = | = How to control it in MicroPython = |
Revision as of 23:54, 29 August 2020
Description
With this switch we can select which of the two sides are connected to the middle. If we move the switch right then the right pin is connected to the middle. If we move the switch left then the left pin is connected to the middle,
How to connect it electrically
How to control it in MicroPython
from machine import Pin
in26 = Pin(26, Pin.IN)
print(in26.value())
Related Tutorial Videos
Digital Input