|
|
|
![]() |
|
|||||||
|
||||||||
![]() |
|
|
Thread Tools | Rate Thread | Display Modes |
|
|
|
#1
|
|||
|
|||
|
Has anyone figured out limit switches for 2015
i do not know how to code limit switches in 2015 labview, can someone comment a picture and show me how to do it, i have it done in begin all i need is teleop
|
|
#2
|
|||||
|
|||||
|
Re: Has anyone figured out limit switches for 2015
What do you want the limit switch to do? Describe exactly what you want the robot to do when the switch is open and when it is closed, and we can help you program it to do that.
|
|
#3
|
|||
|
|||
|
Re: Has anyone figured out limit switches for 2015
when the limit switch is pressed i want the cim motor to stop going that direction so it doesn't de-rail
|
|
#4
|
|||||
|
|||||
|
Re: Has anyone figured out limit switches for 2015
That's a pretty typical use of a limit switch. Here's how I would do it, using an In Range and Coerce function. When the switch value is not true, the motor control is allowed to vary between -1 and +1. When the switch is true, the motor is only allowed to be between -1 and 0, keeping it from traveling any farther forward.
|
|
#5
|
|||
|
|||
|
Re: Has anyone figured out limit switches for 2015
How do you get the motor control dbl to show up
|
|
#6
|
|||||
|
|||||
|
Re: Has anyone figured out limit switches for 2015
In my snippet, that was just a placeholder to represent the value you want to send to the motor. How you come up with that value is up to you. You can get it from a joystick axis, or select between different values based on joystick buttons, or compute it using PID based on sensor feedback, or anything you want.
|
|
#7
|
|||
|
|||
|
Re: Has anyone figured out limit switches for 2015
thank you for the explanation
|
|
#8
|
||||
|
||||
|
Re: Has anyone figured out limit switches for 2015
hey this is kind of a followup, but has anyone figured out how to do it with c++???
|
|
#9
|
||||
|
||||
|
Re: Has anyone figured out limit switches for 2015
This might help....the examples are in Java, but the class names are pretty similar.
http://wpilib.screenstepslive.com/s/...ommit=S earch |
|
#10
|
|||
|
|||
|
Re: Has anyone figured out limit switches for 2015
Quote:
Website of LabVIEW Tutorials for FRC |
|
#11
|
||||
|
||||
|
Re: Has anyone figured out limit switches for 2015
Quote:
Quote:
thanks, both of you guys, for the examples, it is a huge amount better than what i had before (•‿•) Edit: In hind sight I really should have thought about searching for that on the WPILib website Last edited by TheJuanRing : 05-02-2015 at 17:32. |
|
#12
|
|||
|
|||
|
What motor controllers are you using? With the new controller you can connect the limit switch directly to the controller and it will function without any additional code. https://www.google.com/url?sa=t&sour...dAP2YN2BXa9lJQ
|
![]() |
| Thread Tools | |
| Display Modes | Rate This Thread |
|
|