Switch: Difference between revisions

From Sketching with Hardware at LMU Wiki
Jump to navigation Jump to search
Line 11: Line 11:
= How to control it in MicroPython =
= How to control it in MicroPython =
<syntaxhighlight lang="python" line='line'>
<syntaxhighlight lang="python" line='line'>
# todo
from machine import Pin
# code goes here
in26 = Pin(26, Pin.IN)
print(in26.value())
</syntaxhighlight>
</syntaxhighlight>



Revision as of 23:49, 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

Text

Image(s)

How to control it in MicroPython

from machine import Pin
in26 = Pin(26, Pin.IN)
print(in26.value())

A small Program in MicroPython

# todo 
# code goes here

text

image(s)

Related Tutorial Videos

change to the right video


Background

text

image(s)