Autonomous beginner help programming

Code is written here

# Begin project code
def autonomous():
    if competetion=True 
    brain.screen.print("autonomous signal recieved")
    drivetrain.set_drive_velocity(80,PERCENT)
    drivetrain.set_turn_velocity(80, PERCENT)
    armmotor_4.set_velocity(90, PERCENT)
    clawmotor_3.set_velocity(90,PERCENT)
    wait(2,SECONDS)
    drivetrain.drive_for(FORWARD, 1000,MM)
    drivetrain.turn_for(RIGHT,90,DEGREES)
    drivetrain.drive_for(FORWARD,300,MM)
    drivetrain.drive_for(REVERSE, 300,MM)
    drivetrain.turn_for(LEFT, 180, DEGREES)
    clawmotor_3.spin_to_position(90,DEGREES)
competetion = Competition(driver_control, autonomous)

What’s your question ? (aside from the fact the code won’t work)

5 Likes

Are you sure you are using the competition template correctly? Also, if you want to test your code like it is at a competition, when clicking the program, select timed run instead so that it will run autonomous for 15 seconds, then driver control for 105 seconds.

How would you suggest I improve it?

Does it do what you want?

What exactly do you want to improve? Please give clearer details before posting

Start by removing this unneeded, and incorrect, line of code.

if competetion=True
2 Likes