Skip to content

Commit

Permalink
Add files via upload
Browse files Browse the repository at this point in the history
  • Loading branch information
GiovanniMerici authored Nov 22, 2022
1 parent 0c7eaea commit bed3669
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 0 deletions.
22 changes: 22 additions & 0 deletions 10.1_Photoresistor.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
from machine import Pin, ADC, PWM
import time

adc = ADC(26)
adc1 = ADC(27)
pwm = PWM(Pin(15))
pwm1 = PWM(Pin(0))
pwm2 = PWM(Pin(8))
pwm.freq(10000)
pwm1.freq(10000)
pwm2.freq(10000)
try:
while True:
read = adc.read_u16()
read1 = adc1.read_u16()
pwm.duty_u16(read)
pwm1.duty_u16(read)
pwm2.duty_u16(read1)

time.sleep(0.1)
except:
pwm.deinit()
Binary file added DFE18E84-2767-4A4A-9A27-4BCA556A8BB3.heic
Binary file not shown.

0 comments on commit bed3669

Please sign in to comment.