Need help codeing bumpers

i am trying to code two bumpers one will say that during competition it will run autonomous the other when pressed will cut off autonomous. is this possible ant help would be well appreciated.

hmm you know you can’t press bumpers during autonomous, right? It would have to hit a barrier of some sort.

Configure the bumper with vex::bumper bumpername = vex::bumper(Brain.ThreeWirePort.x)
(https://help.vex.com/article/194-robot-config-three-wire-port-vexcode)

then you can use the bumpers in if statements like
if(bumpername.pressing()){do a backflip}
if(bumpername2.pressing()){don’t}

i am trying to set it up so at a competition i can tell the brain to run an antonymous code or not

In that case I’d suggest just using a jumper pin, if it’s plugged in, run the autonomous. If it is missing, don’t.