Programing two bumpers Help please

I recently got a vex robot and LOVE it. I am getting the hang of programing it but have run into a problem: I clearly know how to progam one bumper switch but I want to put two bumpers on each side of my vex robot with the same code. I have tried almost everything i know and can’t seem to find a solution. I want it once it hits a wall to back up and turn a little. but it will only work for one bumper !please help!

What part of the programming are you having trouble with(please post the code you are working with)? I’m glad you are enjoying the system!

I want to program a bumper in port 7 to do this same code but i cant figure out the code to put i hope this helps

CHANGE: “bumper = GetDigitalInput[6]”
To: “bumper = GetDigitalInput[7]”

Also, Make sure pin 7 is set to INPUT [Click on the “CONFIG” icon at the top of the flow chart and make sure the arrow points towards the pin (the little circle)]

sorry if i did not clarify i want two bumpers one in port 7 and one in port 6 to preform that that code

What you need is a second if statement containing the code you would like to run when the second button is pressed. Then change the condition in the if statement to the correct bumper switch.

do i need to define a second variable

Thank you very much IT WORK just like i would like it to

Another suggestion, if you want the bumpers to execute the same code, you could insert an OR condition into one if statement. That way, you would not need to use two if statements, which speeds up the code.

It would look like this:

if(bumper == 1 || bumper2 == 1)