Difference between revisions of "Potentiometer"

From Sketching with Hardware at LMU Wiki
Jump to navigation Jump to search
Line 4: Line 4:
 
Potentiometer
 
Potentiometer
  
[[File:Poti.PNG|x200px]]
+
[[File:Poti.PNG]]
  
 
Slider
 
Slider
  
[[File:Slider.PNG|x200px]]
+
[[File:Slider.PNG]]
  
 
= How to connect it electrically =
 
= How to connect it electrically =

Revision as of 23:38, 29 August 2020

Description

A potentiometer is a resistor that can be mechanically changed. Typically form factors are knobs (turn to change) or sliders. The change of resistance is either linear (resistance changes linear with the angle or distance) or logarithmic.

Potentiometer

Poti.PNG

Slider

Slider.PNG

How to connect it electrically

Text

Image(s)

How to control it in MicroPython

1 from machine import Pin, ADC
2 from time import sleep
3 pot = ADC(Pin(34))
4 pot.atten(ADC.ATTN_11DB)
5 while True:
6   pot_value = pot.read()
7   print(pot_value)
8   sleep(0.5)

Here the voltage of Pin 34 is manipulable with the poti:

PotiConnection2.jpg

Schematic drawing: PotiConnection1.png

A small Program in MicroPython

1 # todo 
2 # code goes here

text

image(s)

Related Tutorial Videos


Background

text

image(s)