I’m somewhat new to programming, and am wondering if someone could give me some help with programming my pneumatics. Basically what I want it to do is when I press one of the digital buttons the pneeumatics open and stay open until I press a different button.
I am using EasyC V2 but if you could post code from any program I could probably translate it
Basically, this lets you have one button that you can press which causes the pneumatics to fire one way, and have another button you can press which releases the pneumatics to spring back the other way (or fire back depending on if it’s double acting vs single acting).
You’ll need to set up two variables by double clicking on the Variables block underneath void OperatorControl (or your own custom function if that’s how you have it set up), typing int, then ClawOpenButton, going down a line and typing int, then ClawClosedButton (or whatever variable names you want to use for that)
It is very important that this code executes in a loop, because otherwise the program will only check your joystick and set your pneumatics once, but you want it to check and set continually while the robot is on.
The code I posted was a really simple program for retracting or extending the piston when the button was held and the opposite when it is released. Of course, once you get good at programming you can then program it so if you simply press the button the piston will stay extended until you press it again but that is a bit more advanced.
Anyways, there are many ways to perform tasks when it comes to programming and you just have to play around until you find what you want and what suits your needs.
Hopefully you understand all that we have said so far and again if you need anything just post back here and hell if you really want shoot me a PM, I will be more then happy to help you!
Thanks guys. I got a program that works. Also a quick question is there an easy way to set like a buffer zone on the analog controls so I don’t accidentally bump the robot in a direction that I don’t want to go on easyc v2?
Alternatively, you can just use a Joystick to digital latch instead of a Joystick to digital output. This simplifies the code because for digital latch, you press the button one time without holding it and then to release it you press that same button again.
my team is also using the pneumatic system and we have not done any tests but on the specs (http://www.vexrobotics.com/pneumatics.html) the force is 54N! that is roughly 34x vex motor power, is that accurate? Does the force decrease as the piston extends? If so, what is the average force? Why aren’t pneumatics used more often if they are that powerful (even if their stroke size is 2 inches)?
Well for starters they’re expensive, only have a limited amount of shots and are simply not practical in some situations ( drive trains etc ). Don’t get me wrong, they can be really helpful in some situations, but not so much in other situations :(.