Limit Switch

On my teams robot this year, we have an arm that swings up. We would like to put a limit switch at the top to cut the power to the motor for a certain time. If you can help, I would appreciate it very much. Thank you.

What do you need help with? If you have a specific question we would be glad to help.

For sure you want a mechanical hard stop right after the limit switch to prevent damage.

Yes, we are putting a hard stop. We have the motor running through motor controllers, but I need help incorporating the limit switch into the code.

Which motor controllers are you using? Where have you connected the limit switch? And what programming language are you using?

We are using sparks, but we want them to run through the Digital I/O via PWM.

we will be using magnetic limit switches from rev:

they will be mounted on the outer rail of the elevator with the magnet on the lift its self.

The motor controllers we are using (sparks) already have limit switch ports on it so theres no need for break out boards or extra programming.

We have a bucket kind of system that lifts the cubes up. We also have ramps on the side of our robot to life a robot on each side. These two things are both being powered by a PTO (power take off). This PTO has two motors that go through two sparks. These sparks are plugged into the roborio via one PWM wire that splits into two-going to each spark. We want a limit switch at the bottom of the bucked, so it doesn’t take out our electronics board. If we have a this limit switch connected through one of the sparks and active at the end of the match, will it prevent us from being able to use the ramps that are powered of of the same motor controllers?