Robotics-at-Home-with-Raspb.../ch-5/4-pwm/motors_convert_speed.py
2021-12-07 21:34:30 +00:00

8 lines
124 B
Python

import time
import robot
max_speed = 2**16-1
robot.motor_A1.duty_cycle = int(0.8 * max_speed)
time.sleep(0.3)
robot.stop()