Trying to play battle bots using bumper switch to kill controller..?


#1

In my vex class we are trying to play battle bots. I want stop the controller from working when the bumper switch is pressed. We are only using graphical at this time. Please help…
Thank You…


#2

Instead of a forever Loop put the driver controls in a repeat until Loop. Then have it run until the bumper is hit.


#3

Thanks, I believe we tried that already, but I will try again.


#4

Something like this should do it.

038d762754ff89dbe35d34a931485443.PNG


#5

Thanks…Any Idea how to do the same thing except with 2 bumper switches…?


#6

I suggest assigning a variable, call it “BUMPED”, before the loop starts, with an initial value of false. Have the “while” loop test for “BUMPED” = false. Inside the loop, test for either bumper being true, and if so, make “BUMPED” = true, so the loop will exit.


#7

Can you post a pic of this in graphical robotc? Thanks…


#8

Here you go. I tested this, and motors stop when either button is pressed.



bumped.jpg

bumped.jpg


#9

ltpro1997, would you mind posting the code that you mentioned you tried but didn’t work?


#10

Sorry, I wiped it.
The code you showed worked great. Thank you


#11

Would you mind sharing a photo or a blueprint of your bumper bots? I’d like my post-season teams to build me few for a school demonstration so kids can have some fun when learning about the program…