Switch: Difference between revisions
Jump to navigation
Jump to search
Created page with "= Description = Text Image(s) = How to connect it electrically = Text Image(s) = How to control it in MicroPython = <syntaxhighlight lang="python" line='line'> # todo #..." |
No edit summary |
||
(6 intermediate revisions by one other user not shown) | |||
Line 1: | Line 1: | ||
= Description = | = 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, | |||
[[File:Switch01.PNG|x300px]] | |||
= 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 = | ||
<syntaxhighlight lang="python" line='line'> | <syntaxhighlight lang="python" line='line'> | ||
from machine import Pin | |||
in26 = Pin(26, Pin.IN) | |||
print(in26.value()) | |||
</syntaxhighlight> | </syntaxhighlight> | ||
= Related Tutorial Videos = | = Related Tutorial Videos = | ||
Digital Input | |||
<youtube>va1beT6sxLs</youtube> | |||
[[Category:Sensor]] |
Latest revision as of 09:50, 11 June 2024
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]
from machine import Pin
in26 = Pin(26, Pin.IN)
print(in26.value())
Related Tutorial Videos[edit]
Digital Input