|
|
|
![]() |
|
|||||||
|
||||||||
![]() |
| Thread Tools | Rate Thread | Display Modes |
|
#1
|
|||
|
|||
|
Help programming pneumatics
This is our teams first time using pneumatics. We have everything hooked up but are having issues with the programming part using LabVIEW. We would like the piston to extend when button "A" is pressed and retract when button "A" is released. How would we achieve this. Thanks in advance!
Last edited by itwasntme455 : 02-23-2016 at 12:22 AM. Reason: enter programming program |
|
#2
|
||||
|
||||
|
Re: Help programming pneumatics
You will just need to set the value of the pneumatic to one position while the button is being pressed, and the other when it is not.
Psuedocode: Code:
if (A button is pressed) {
pneumatic.set(on);
} else {
pneumatic.set(off);
}
Code:
Solenoid solenoid = new Solenoid(port);
if (operator.getRawButton(1)) {//example
solenoid.set(true);
} else {
solenoid.set(false);
}
Code:
DoubleSolenoid solenoid = new DoubleSolenoid(portA, portB);
if (operator.getRawButton(1)) {
solenoid.set(DoubleSolenoid.Value.kForward);
} else {
solenoid.set(DoubleSolenoid.Value.kReverse);
}
|
|
#3
|
|||
|
|||
|
Re: Help programming pneumatics
How about in LabVIEW?
|
|
#4
|
||||
|
||||
|
Re: Help programming pneumatics
Sorry, my team has only used C++ and Java. Here are a few links that might be helpful:
http://www.chiefdelphi.com/forums/sh...ad.php?t=73821 http://www.team476.com/wpimages/wp1798b5a5_05_06.jpg http://www.chiefdelphi.com/forums/sh...ad.php?t=90429 I hope this helps! |
|
#5
|
|||
|
|||
|
Re: Help programming pneumatics
Like so:
![]() In the false state of the case structure in Teleop, the solenoid must be set to reverse instead of forward. Additionally, in Begin, make sure your PCM ID and solenoid channels match how you wired your robot; the forward channel is the channel wired to the end of the solenoid connected to the part of the piston further from the rod, while the reverse channel should be set to the closer end. If you're unsure, just guess and switch it if it's backwards. Last edited by thatnameistaken : 02-23-2016 at 03:35 AM. Reason: Reworded to flow better |
|
#6
|
|||||
|
|||||
|
Re: Help programming pneumatics
Here's another example
|
![]() |
| Thread Tools | |
| Display Modes | Rate This Thread |
|
|