Skip to content

Instantly share code, notes, and snippets.

@tm-sanjay
Last active August 21, 2021 11:32
Show Gist options
  • Save tm-sanjay/6f58ed2654a5473705554c866a4686d5 to your computer and use it in GitHub Desktop.
Save tm-sanjay/6f58ed2654a5473705554c866a4686d5 to your computer and use it in GitHub Desktop.
PWM (LED brightness) using pi pico (Python)
pwm = PWM(Pin(25))
pwm.freq(100)
while True:
for duty in range(65025):
pwm.duty_u16(duty)
sleep(0.0001)
for duty in range(65025, 0, -1):
pwm.duty_u16(duty)
sleep(0.0001)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment