Files
Robotics-at-Home-with-Raspb…/ch-5/4-pwm/motors_pwm_drive_slower.py
T
Danny Staple 481cac28de Ch-5 clean
2022-03-20 22:24:56 +00:00

12 lines
188 B
Python

import time
import board
import pwmio
A1_PWM = pwmio.PWMOut(board.GP17)
A1_PWM.duty_cycle = 2 ** 16 - 1
time.sleep(0.3)
A1_PWM.duty_cycle = 2 ** 15
time.sleep(0.3)
A1_PWM.duty_cycle = 0