Auton won't start (python)

I don’t have all the measurements but this won’t start. It is formatted correctly in the code.
def onauton_autonomous_0():
drivetrain.set_drive_velocity(100, PERCENT)
drivetrain.set_turn_velocity(100, PERCENT)
drivetrain.set_stopping(BRAKE)
ANGLER.set_velocity(100, PERCENT)
ANGLER.set_stopping(HOLD)
drivetrain.drive_for(FORWARD, 1, INCHES)
ANGLER.spin_for(FORWARD, 0, DEGREES)
drivetrain.drive_for(REVERSE, 0, INCHES)
drivetrain.turn_for(LEFT, 0, DEGREES)
ANGLER.spin_for(REVERSE, 0, DEGREES)
drivetrain.drive_for(REVERSE, 0, INCHES)
drivetrain.turn_for(RIGHT, 0, DEGREES)
drivetrain.drive_for(FORWARD, 0, INCHES)
ANGLER.spin_for(FORWARD, 0, DEGREES)
drivetrain.drive_for(REVERSE, 0, INCHES)
drivetrain.turn_for(LEFT, 0, DEGREES)
ANGLER.spin_for(REVERSE, 0, DEGREES)
drivetrain.drive_for(REVERSE, 0, INCHES)

@jpearman you have helped me with code before can you help now.

I need to see the whole program.
Has it been setup to run in competition, this would be a starting point for that.

def pre_auton():
    brain.screen.clear_screen()
    brain.screen.print("pre auton code")
    wait(1, SECONDS)

def autonomous():
    count = 0
    brain.screen.clear_screen()
    while True:
        brain.screen.print_at("Running Auton... %6d" %(count), x=10, y=60)
        count = count + 1
        wait(100, MSEC)

def usercontrol():
    count = 0
    brain.screen.clear_screen()
    while True:
        brain.screen.print_at("Running driver... %6d" %(count), x=10, y=40)
        count = count + 1
        wait(100, MSEC)

comp = Competition(usercontrol, autonomous)

pre_auton()
3 Likes

#------------------------------

Creator: Sawyer Jones

Team: 2011Z Z00M

Model: Conveyer, Angler, Fourbar

Type: AWP 3 Ring Autonomous

#------------------------------

def conveyer_forward():
CONVEYER.spin(FORWARD)

def conveyer_reverse():
CONVEYER.spin(REVERSE)

def conveyer_stop():
CONVEYER.stop()

def angler_up():
ANGLER.spin(FORWARD)

def angler_down():
ANGLER.spin(REVERSE)

def angler_stop():
ANGLER.stop()

def fourbar_up():
FOURBAR.spin(FORWARD)

def fourbar_down():
FOURBAR.spin(REVERSE)

def fourbar_stop():
FOURBAR.stop()

def clamp_close():
CLAMP.spin(FORWARD)

def clamp_open():
CLAMP.spin(REVERSE)

def clamp_stop():
CLAMP.stop()

controller_1.buttonL1.pressed(conveyer_forward)
controller_1.buttonL1.released(conveyer_stop)

controller_1.buttonL2.pressed(conveyer_reverse)
controller_1.buttonL2.released(conveyer_stop)

controller_1.buttonR1.pressed(angler_up)
controller_1.buttonR1.released(angler_stop)

controller_1.buttonR2.pressed(angler_down)
controller_1.buttonR2.released(angler_stop)

controller_1.buttonA.pressed(fourbar_up)
controller_1.buttonA.released(fourbar_stop)

controller_1.buttonB.pressed(fourbar_down)
controller_1.buttonB.released(fourbar_stop)

controller_1.buttonUp.pressed(clamp_open)
controller_1.buttonUp.released(clamp_stop)

controller_1.buttonDown.pressed(clamp_close)
controller_1.buttonDown.released(clamp_stop)

drivetrain.set_drive_velocity(100,PERCENT)
drivetrain.set_stopping(COAST)

CONVEYER.set_velocity(75,PERCENT)
CONVEYER.set_stopping(COAST)

ANGLER.set_velocity(100,PERCENT)
ANGLER.set_stopping(HOLD)

FOURBAR.set_velocity(100,PERCENT)
FOURBAR.set_stopping(HOLD)

CLAMP.set_velocity(100,PERCENT)
CLAMP.set_stopping(HOLD)

def onauton_autonomous_0():
drivetrain.set_drive_velocity(100, PERCENT)
drivetrain.set_turn_velocity(100, PERCENT)
drivetrain.set_stopping(BRAKE)
ANGLER.set_velocity(100, PERCENT)
ANGLER.set_stopping(HOLD)
drivetrain.drive_for(FORWARD, 1, INCHES)
ANGLER.spin_for(FORWARD, 0, DEGREES)
drivetrain.drive_for(REVERSE, 0, INCHES)
drivetrain.turn_for(LEFT, 0, DEGREES)
ANGLER.spin_for(REVERSE, 0, DEGREES)
drivetrain.drive_for(REVERSE, 0, INCHES)
drivetrain.turn_for(RIGHT, 0, DEGREES)
drivetrain.drive_for(FORWARD, 0, INCHES)
ANGLER.spin_for(FORWARD, 0, DEGREES)
drivetrain.drive_for(REVERSE, 0, INCHES)
drivetrain.turn_for(LEFT, 0, DEGREES)
ANGLER.spin_for(REVERSE, 0, DEGREES)
drivetrain.drive_for(REVERSE, 0, INCHES)

I hope this helps @jpearman

copy-paste your code in either backticks (```) or code tags [code] [~/code] without the ~

Where are you calling your autonomous function? You have it defined, but you have to call it by

def onauton_autonomous_0():
    //stuff you want to run

onauton_autonomous_0()
2 Likes

Idk what you mean by copy in backticks or code tags

Just put ``` before and after you copy-paste the code you wrote. This automatically formats it correctly, and makes it easier to read

1 Like

‘’'#------------------------------

Creator: Sawyer Jones

Team: 2011Z Z00M

Model: Conveyer, Angler, Fourbar

Type: AWP 3 Ring Autonomous

#------------------------------

def conveyer_forward():
CONVEYER.spin(FORWARD)

def conveyer_reverse():
CONVEYER.spin(REVERSE)

def conveyer_stop():
CONVEYER.stop()

def angler_up():
ANGLER.spin(FORWARD)

def angler_down():
ANGLER.spin(REVERSE)

def angler_stop():
ANGLER.stop()

def fourbar_up():
FOURBAR.spin(FORWARD)

def fourbar_down():
FOURBAR.spin(REVERSE)

def fourbar_stop():
FOURBAR.stop()

def clamp_close():
CLAMP.spin(FORWARD)

def clamp_open():
CLAMP.spin(REVERSE)

def clamp_stop():
CLAMP.stop()

controller_1.buttonL1.pressed(conveyer_forward)
controller_1.buttonL1.released(conveyer_stop)

controller_1.buttonL2.pressed(conveyer_reverse)
controller_1.buttonL2.released(conveyer_stop)

controller_1.buttonR1.pressed(angler_up)
controller_1.buttonR1.released(angler_stop)

controller_1.buttonR2.pressed(angler_down)
controller_1.buttonR2.released(angler_stop)

controller_1.buttonA.pressed(fourbar_up)
controller_1.buttonA.released(fourbar_stop)

controller_1.buttonB.pressed(fourbar_down)
controller_1.buttonB.released(fourbar_stop)

controller_1.buttonUp.pressed(clamp_open)
controller_1.buttonUp.released(clamp_stop)

controller_1.buttonDown.pressed(clamp_close)
controller_1.buttonDown.released(clamp_stop)

drivetrain.set_drive_velocity(100,PERCENT)
drivetrain.set_stopping(COAST)

CONVEYER.set_velocity(75,PERCENT)
CONVEYER.set_stopping(COAST)

ANGLER.set_velocity(100,PERCENT)
ANGLER.set_stopping(HOLD)

FOURBAR.set_velocity(100,PERCENT)
FOURBAR.set_stopping(HOLD)

CLAMP.set_velocity(100,PERCENT)
CLAMP.set_stopping(HOLD)

def onauton_autonomous_0():
drivetrain.set_drive_velocity(100, PERCENT)
drivetrain.set_turn_velocity(100, PERCENT)
drivetrain.set_stopping(BRAKE)
ANGLER.set_velocity(100, PERCENT)
ANGLER.set_stopping(HOLD)
drivetrain.drive_for(FORWARD, 1, INCHES)
ANGLER.spin_for(FORWARD, 0, DEGREES)
drivetrain.drive_for(REVERSE, 0, INCHES)
drivetrain.turn_for(LEFT, 0, DEGREES)
ANGLER.spin_for(REVERSE, 0, DEGREES)
drivetrain.drive_for(REVERSE, 0, INCHES)
drivetrain.turn_for(RIGHT, 0, DEGREES)
drivetrain.drive_for(FORWARD, 0, INCHES)
ANGLER.spin_for(FORWARD, 0, DEGREES)
drivetrain.drive_for(REVERSE, 0, INCHES)
drivetrain.turn_for(LEFT, 0, DEGREES)
ANGLER.spin_for(REVERSE, 0, DEGREES)
drivetrain.drive_for(REVERSE, 0, INCHES)‘’’

I attempted to but I never did that

The triple backtics at the beginning and end need to go on their own lines.

```
Your code goes here
```

and it looks like you used single quotes – the “backtic” character is the key to the left of 1 and above tab on most keyboards.

Or alternately, paste your code in, highlight it all, and click the </> button.

1 Like
#------------------------------
#
#   Creator: Sawyer Jones
#
#   Team: 2011Z Z00M
#
#   Model: Conveyer, Angler, Fourbar
#
#   Type: AWP 3 Ring Autonomous 
#
#------------------------------






def conveyer_forward():
    CONVEYER.spin(FORWARD)

def conveyer_reverse():
    CONVEYER.spin(REVERSE)

def conveyer_stop():
    CONVEYER.stop()


def angler_up():
    ANGLER.spin(FORWARD)

def angler_down():
    ANGLER.spin(REVERSE)

def angler_stop():
    ANGLER.stop()
 



def fourbar_up():
    FOURBAR.spin(FORWARD)

def fourbar_down():
    FOURBAR.spin(REVERSE)

def fourbar_stop():
    FOURBAR.stop()


def clamp_close():
    CLAMP.spin(FORWARD)

def clamp_open():
    CLAMP.spin(REVERSE)

def clamp_stop():
    CLAMP.stop()










controller_1.buttonL1.pressed(conveyer_forward)
controller_1.buttonL1.released(conveyer_stop)

controller_1.buttonL2.pressed(conveyer_reverse)
controller_1.buttonL2.released(conveyer_stop)


controller_1.buttonR1.pressed(angler_up)
controller_1.buttonR1.released(angler_stop)

controller_1.buttonR2.pressed(angler_down)
controller_1.buttonR2.released(angler_stop)


controller_1.buttonA.pressed(fourbar_up)
controller_1.buttonA.released(fourbar_stop)

controller_1.buttonB.pressed(fourbar_down)
controller_1.buttonB.released(fourbar_stop)


controller_1.buttonUp.pressed(clamp_open)
controller_1.buttonUp.released(clamp_stop)

controller_1.buttonDown.pressed(clamp_close)
controller_1.buttonDown.released(clamp_stop)








drivetrain.set_drive_velocity(100,PERCENT)
drivetrain.set_stopping(COAST)

CONVEYER.set_velocity(75,PERCENT)
CONVEYER.set_stopping(COAST)

ANGLER.set_velocity(100,PERCENT)
ANGLER.set_stopping(HOLD)

FOURBAR.set_velocity(100,PERCENT)
FOURBAR.set_stopping(HOLD)

CLAMP.set_velocity(100,PERCENT)
CLAMP.set_stopping(HOLD)






def onauton_autonomous_0():
    drivetrain.set_drive_velocity(100, PERCENT)
    drivetrain.set_turn_velocity(100, PERCENT)
    drivetrain.set_stopping(BRAKE)
    ANGLER.set_velocity(100, PERCENT)
    ANGLER.set_stopping(HOLD)
    drivetrain.drive_for(FORWARD, 1, INCHES)
    ANGLER.spin_for(FORWARD, 0, DEGREES)
    drivetrain.drive_for(REVERSE, 0, INCHES)
    drivetrain.turn_for(LEFT, 0, DEGREES)
    ANGLER.spin_for(REVERSE, 0, DEGREES)
    drivetrain.drive_for(REVERSE, 0, INCHES)
    drivetrain.turn_for(RIGHT, 0, DEGREES)
    drivetrain.drive_for(FORWARD, 0, INCHES)
    ANGLER.spin_for(FORWARD, 0, DEGREES)
    drivetrain.drive_for(REVERSE, 0, INCHES)
    drivetrain.turn_for(LEFT, 0, DEGREES)
    ANGLER.spin_for(REVERSE, 0, DEGREES)
    drivetrain.drive_for(REVERSE, 0, INCHES)







    

Thanks that is really helpful

@jpearman can you look at it for the whole code

I don’t see the competition template being used. Create a new program that uses the competition template seen in the VEXCode example files, and paste your code in the opcontrol function.

2 Likes

How do you do this Connor

Or anyone that can do it

I showed you yesterday

2 Likes

Oh ok I didn’t know that was what it was called thanks

I will tell you if it works