Read rpi pico with podmeters for params
This commit is contained in:
parent
1f1c163fca
commit
bb5c89f15e
1 changed files with 14 additions and 0 deletions
14
main.py
Normal file
14
main.py
Normal file
|
@ -0,0 +1,14 @@
|
|||
from machine import Pin, ADC #importing Pin and ADC class
|
||||
from time import sleep #importing sleep class
|
||||
potentiometer1 = ADC(28) #creating potentiometer object
|
||||
potentiometer2 = ADC(27) #creating potentiometer object
|
||||
potentiometer3 = ADC(26) #creating potentiometer object
|
||||
|
||||
led = Pin('LED', Pin.OUT)
|
||||
while True:
|
||||
led.value(not led.value())
|
||||
potentiometer_value1 = potentiometer1.read_u16() / 65536 #reading analog pin
|
||||
potentiometer_value2 = potentiometer2.read_u16() / 65536 #reading analog pin
|
||||
potentiometer_value3 = potentiometer3.read_u16() / 65536 #reading analog pin
|
||||
print(potentiometer_value1, potentiometer_value2, potentiometer_value3)
|
||||
sleep(0.05)
|
Loading…
Reference in a new issue