ev3dev-lang-python
ev3dev-lang-python copied to clipboard
How do I create a program that runs a motor forever at a specific RPM?
I tried using SpeedRPM with run_forever, but I can't figure out what the code should look like.
#!/usr/bin/env pybricks-micropython
from pybricks.ev3devices import InfraredSensor, Motor, ColorSensor
from pybricks.parameters import Port, Button, Color, ImageFile, SoundFile, Stop
from pybricks.tools import wait
from pybricks.robotics import DriveBase
from pybricks.hubs import EV3Brick
# Initialize the EV3 Brick.
ev3 = EV3Brick()
# Initialize the motors.
motor = Motor(Port.C)
while True:
motor.run(speed)