Skip to content
Discussion options

You must be logged in to vote

Hi,

Almost your program:

from pybricks.pupdevices import Motor 
from pybricks.parameters import Port, Direction
from pybricks.robotics import DriveBase
# Configure robot

leftWheel = Motor(Port.A, Direction.COUNTERCLOCKWISE)
rightWheel = Motor(Port.B, Direction.CLOCKWISE)
drive = DriveBase(leftWheel, rightWheel, 56, 128)
drive.use_gyro(True)

def AllDrive(distance, speed, goFast, goSlow, angle):
    if angle == 0:
        drive.settings(straight_speed=500, straight_acceleration=[500,100])
        drive.settings(straight_speed=speed, straight_acceleration=[goFast, goSlow])
        drive.straight(distance)
    elif angle != 0:
        drive.turn(angle)
# lowered speed from 1000 to 900
AllDrive

Replies: 1 comment 2 replies

Comment options

You must be logged in to vote
2 replies
@lawofkato
Comment options

@BertLindeman
Comment options

Answer selected by lawofkato
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants