from machine import Pin, PWM # Import the Pin and PWM classes from the machine module
import time # Import the time module for delays
# Initialize a PWM object on Pin 5 with a frequency of 5Hz and a duty cycle of 512 (50%)
led_pwm = PWM(Pin(5), freq=5, duty=512)
# Wait for 2 seconds (keep the current PWM settings for 2 seconds)
time.sleep(2)
# Change the frequency of the PWM signal to 30Hz
led_pwm.freq(30)
# Wait for 2 seconds (keep the current PWM settings for 2 seconds)
time.sleep(2)
# Set the duty cycle of the PWM signal to 0, effectively turning off the LED
led_pwm.duty(0)
# Wait for 1 second
time.sleep(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
led1:A
led1:C
r1:1
r1:2