Files
Robotics-at-Home-with-Raspb…/ch-5/4-pwm/motors_convert_speed.py
T
Danny Staple 481cac28de Ch-5 clean
2022-03-20 22:24:56 +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()