Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import time # librería delay
- import board # librería placa
- import pulseio # librería PWM
- led = pulseio.PWMOut(board.D13, frequency=50, duty_cycle=0) # Seteo de pin y frecuencia
- while True:
- for i in range(100):
- if i < 50:
- led.duty_cycle = int(i * 2 * 65535 / 100)
- else:
- led.duty_cycle = 65535 - int((i - 50) * 2 * 65535 / 100)
- time.sleep(0.01)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement