|
|
|
![]() |
|
|||||||
|
||||||||
![]() |
|
|
Thread Tools | Rate Thread | Display Modes |
|
|
|
#1
|
|||||
|
|||||
|
Re: Switch
That depends on where the switch is (on robot or on the Driver Station).
A limit switch on the robot that stops the winch would connect to a Digital Input. Here are two examples of using Linit Switches: ![]() |
|
#2
|
|||
|
|||
|
Re: Switch
How would the left one work?
|
|
#3
|
|||||
|
|||||
|
Re: Switch
The left one just checks to see IF the driver joystick is ordering forward motion AND the limit switch in that direction is being depressed, THEN make the power to the motor =0.
If the motor is moving away from the limit switch or the limit switch hasn't been hit, then it's safe to let the motor do what the driver ordered. |
|
#4
|
|||
|
|||
|
Re: Switch
The switch would need to make a motor stop and then a pneumatic to extend when it is pressed. Would I just remove the joystick and axis bits from that code?
|
|
#5
|
|||||
|
|||||
|
Re: Switch
You can remove the Joystick as long as you have something telling the motor to move and how fast. It could be triggered in a sequence, for instance.
As far as triggering pneumatics when the switch gets depressed, you could set that up as a completely separate action -- If limit switch, then set solenoid. But it all depends on how you want to reverse or reset these actions. It sounds like you might want this to be a sequence of steps in Periodic Tasks. |
|
#6
|
|||
|
|||
|
Re: Switch
Periodic is exactly where I was going to put it. What vi would a limit switch be?
|
|
#7
|
|||||
|
|||||
|
Re: Switch
Limit switches are Digital Inputs.
WPI Robotics Library -> IO -> DigitalInput Get returns a true or false. |
![]() |
| Thread Tools | |
| Display Modes | Rate This Thread |
|
|