Files
Robotics-at-Home-with-Raspb…/ch-05/4-pwm/motors_convert_speed.py
T
2023-01-18 13:57:13 +00:00

9 lines
129 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()