Difference between revisions of "Push button"

From Sketching with Hardware at LMU Wiki
Jump to navigation Jump to search
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,
+
With a button we can select which of the two sides are connected to the middle. It is similar to a [[switch]] but it only stays in the state as long as it is pressed.
  
[[File:Switch01.PNG|x300px]]
+
[[File:Button02.PNG|x200px]]
  
 
= How to connect it electrically =
 
= How to connect it electrically =

Revision as of 23:05, 29 August 2020

Description

With a button we can select which of the two sides are connected to the middle. It is similar to a switch but it only stays in the state as long as it is pressed.

Button02.PNG

How to connect it electrically

Switch02.PNG

How to control it in MicroPython

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


Related Tutorial Videos

Digital Input