Files
Robotics-at-Home-with-Raspb…/ch-5/4-pwm/1-with_pwm/robot.py
T
2022-06-13 08:55:04 +01:00

15 lines
297 B
Python
Executable File

import board
import pwmio
motor_A1 = pwmio.PWMOut(board.GP17)
motor_A2 = pwmio.PWMOut(board.GP16)
motor_B1 = pwmio.PWMOut(board.GP18)
motor_B2 = pwmio.PWMOut(board.GP19)
def stop():
motor_A1.duty_cycle = 0
motor_A2.duty_cycle = 0
motor_B1.duty_cycle = 0
motor_B2.duty_cycle = 0