Difference between revisions of "Switch"
Jump to navigation
Jump to search
(2 intermediate revisions by one other user not shown) | |||
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 = | ||
Line 16: | Line 14: | ||
</syntaxhighlight> | </syntaxhighlight> | ||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
= Related Tutorial Videos = | = Related Tutorial Videos = | ||
Line 31: | Line 20: | ||
<youtube>va1beT6sxLs</youtube> | <youtube>va1beT6sxLs</youtube> | ||
− | + | [[Category:Sensor]] | |
− | |||
− | |||
− |
Latest revision as of 08:50, 11 June 2024
Contents
Description[edit]
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[edit]
How to control it in MicroPython[edit]
1 from machine import Pin
2 in26 = Pin(26, Pin.IN)
3 print(in26.value())
Related Tutorial Videos[edit]
Digital Input