Too much turn #2257
-
|
Hi, I'm a beginner, and I don't know much about coding robots with python. This is what I got so far: from pybricks.hubs import PrimeHub
from pybricks.pupdevices import Motor, ColorSensor, UltrasonicSensor, ForceSensor
from pybricks.parameters import Button, Color, Direction, Port, Side, Stop, Axis
from pybricks.robotics import DriveBase
from pybricks.tools import wait, StopWatch
hub = PrimeHub()
left_motor = Motor(Port.A, Direction.COUNTERCLOCKWISE)
right_motor = Motor(Port.B, Direction.CLOCKWISE)
drive_base = DriveBase(left_motor, right_motor, wheel_diameter=56, axle_track=104)
drive_base.use_gyro(True)
drive_base.turn(90)My robot isn't turning 90 degrees though, and I'm trying to use the gyro. |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 5 replies
-
|
What happened instead? Did it turn a different amount or did it not do anything at all? |
Beta Was this translation helpful? Give feedback.
-
|
When your program ends, the motors stop, so it also stops correcting. To get a better picture, you could add a wait block to wait a few seconds to prevent the program from ending right away. Also be sure to accurately measure the dimensions and check out these tips. They explain what to do if the robot turns too far or not far enough. |
Beta Was this translation helpful? Give feedback.

When your program ends, the motors stop, so it also stops correcting. To get a better picture, you could add a wait block to wait a few seconds to prevent the program from ending right away.
Also be sure to accurately measure the dimensions and check out these tips. They explain what to do if the robot turns too far or not far enough.