Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How do I create a program that runs a motor forever at a specific RPM? #778

Open
FinnThom opened this issue Oct 1, 2021 · 1 comment
Open

Comments

@FinnThom
Copy link

FinnThom commented Oct 1, 2021

I tried using SpeedRPM with run_forever, but I can't figure out what the code should look like.

@KooshaKayani
Copy link

KooshaKayani commented Oct 7, 2021

#!/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)

@dlech dlech transferred this issue from ev3dev/ev3dev Oct 7, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants