Limit Switch + arm

I’m trying to get my arm to stop moving down when a limit switch is pressed. The problem I’m having is:

Assigning Rx Input to a channel that controls 2 motors; moving inverse of each other. I can’t easily explain the problem but any help would be appreciated. This isn’t my first time with sensors, and have done slightly more complicated programs but this whole inverse thing is bugging me.


Here is an example program of how to do what you are doing.
To invert a motor put a “-” in front of the variable you enter in the motor block.

just checking: if (rx1 <= 255 && rx1 > 127 && topLimit == 0)
since my motors are moving inverse of each other (and on the same rx channel), when the limit switch is depressed, at least one motor has a value in between 255 and 128. Wouldn’t that make moving the arm impossible? That was my main problem - getting the RxInput block to distinguish between the 2 motors.

Thanks again.

if - doesn’t work correctly then do this (255-var)

I’m assuming they are moving together on the same axis and not dependability. If they are independent and each have their own limit switch just double the code.