"""
from machine import Pin
from utime import sleep
print("Hello, ESP32!")
led = Pin(18, Pin.OUT)
while True:
led.on()
sleep(0.5)
led.off()
sleep(0.5)
"""
""
from machine import Pin,ADC
from time import sleep
from machine import Pin, PWM
pot = ADC(Pin(34))
pot.atten(ADC.ATTN_11DB)
pot.width(ADC.WIDTH_10BIT)
led_pin=Pin(18,Pin.OUT)
led_pwm=PWM(led_pin)
while True:
pot_value=pot.read()
duty_cycle = pot_value
led_pwm.duty(duty_cycle)
print(pot_value)
sleep(0.1)
"""
from machine import Pin, ADC
from time import sleep
from machine import Pin, PWM
pot = ADC(Pin(34))
pot.atten(ADC.ATTN_11DB)
pot.width(ADC.WIDTH_10BIT)
led_pin=Pin(18,Pin.OUT)
led_pwm=PWM(led_pin)
while True:
pot_value = pot.read()
duty_cycle = pot_value
led_pwm.duty(duty_cycle)
print(pot_value)
sleep(0.1)
esp:VIN
esp:GND.2
esp:D13
esp:D12
esp:D14
esp:D27
esp:D26
esp:D25
esp:D33
esp:D32
esp:D35
esp:D34
esp:VN
esp:VP
esp:EN
esp:3V3
esp:GND.1
esp:D15
esp:D2
esp:D4
esp:RX2
esp:TX2
esp:D5
esp:D18
esp:D19
esp:D21
esp:RX0
esp:TX0
esp:D22
esp:D23
led2:A
led2:C
pot1:GND
pot1:SIG
pot1:VCC
r3:1
r3:2