Limit Switch vexcode

I am using vexcode text (just updated it yesterday so the program is the latest version). I want to add a limit switch to my robot, does anyone know where to find example programs including a limit switch. I just want a simple if limit switch was hit then move four drive motors to the right (no drivetrain).

This isn’t quite an example of limit switch code, but here’s a help page for limit switches/ 3-wire devices: https://help.vex.com/article/405-how-to-configure-vex-3-wire-devices-vexcode-v5-text
This page is a reference for programming it: https://api.vexcode.cloud/v5/html/classvex_1_1limit.html
And this is an example with a bump switch, which would probably be pretty similar to what you want: https://help.vex.com/article/187-how-to-use-an-if-else-statement
Hopefully that helps you :smiley:

4 Likes