V5 Autonomous issues

My code has been having issues loading and starting. I can get it to work but sometimes it goes back to the original code or does not even want to start I have tried it on both the downloaded and online versions of the coder.

Welcome to the forum! To accurately help we will definitely need pictures.

2 Likes

This is what I have on me the rest of

myVariable = 0

def when_started1():
    global myVariable
    pass

def onauton_autonomous_0():
    global myVariable
    # The robot will drive forward to line up with the roller
    drivetrain.set_drive_velocity(50, PERCENT)
    drivetrain.drive_for(FORWARD, 210, MM, wait=True)
    wait(2, SECONDS)
    # The robot will turn around to line up the arm with the roller
    drivetrain.set_turn_velocity(50, PERCENT)
    drivetrain.turn_for(RIGHT, 138, DEGREES, wait=True)
    # The robots will move to the roller
    drivetrain.set_drive_velocity(50, PERCENT)
    drivetrain.drive_for(REVERSE, 680, MM, wait=True)
    # The wheel will move the roller and after 10 seconds will stop
    Roller.set_velocity(50, PERCENT)
    wait(10, SECONDS)
    Roller.set_stopping(BRAKE)
    # The robot will drive forward to line up with the second roller
    drivetrain.set_drive_velocity(50, PERCENT)
    drivetrain.drive_for(FORWARD, 200, MM, wait=True)

# create a function for handling the starting and stopping of all autonomous tasks
def vexcode_auton_function():
    # Start the autonomous control tasks
    auton_task_0 = Thread( onauton_autonomous_0 )
    # wait for the driver control period to end
    while( competition.is_autonomous() and competition.is_enabled() ):
        # wait 10 milliseconds before checking again
        wait( 10, MSEC )
    # Stop the autonomous control tasks
    auton_task_0.stop()

def vexcode_driver_function():
    # Start the driver control tasks

    # wait for the driver control period to end
    while( competition.is_driver_control() and competition.is_enabled() ):
        # wait 10 milliseconds before checking again
        wait( 10, MSEC )
    # Stop the driver control tasks


# register the competition functions
competition = Competition( vexcode_driver_function, vexcode_auton_function )

when_started1()

it is on another computer

I don’t think that it is something within the code. I have noticed that sometimes it won’t save if there is a bad internet connection . I would also look to make sure that you do have a copy of it on your computer, or al lest on a flash drive.

Feel free to comment if you have another questions or want me to look into it further.