![]() |
Pneumatics Coding
Hi. I'm the new lead programmer on our team and we want to use pneumatics on our bot. We've never done pneumatics before, so I don't know how to code it AT ALL! If anyone could give me any resources on how to code the Pneumatics or even some sample code it would be much appreciated! :D :D :D
|
Re: Pneumatics Coding
Here's some code to run a spike relay to control your compressor, and it uses a pressure sensor to turn it off.
Code:
/*Code:
/*Code:
/* |
Re: Pneumatics Coding
While you certainly can go with a fully manual method like Bennett has suggested, WPILib will take care of most of that for you. This is all that you really need to do for the compressor.
Code:
Compressor compressor = new Compressor(1, 2);I recommend putting this in your main Robot class, where the compressor is declared as a class variable and you initialize and start in your robotInit() method. You can also create a pneumatics subsystem, and have its default command run the compressor.start() method in the initialize() method. For operating solenoids, the WPILib documentation has an example, you can find that here: http://wpilib.screenstepslive.com/s/...ders-solenoids. If you have any more questions, feel free to ask. |
| All times are GMT -5. The time now is 11:45. |
Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2017, Jelsoft Enterprises Ltd.
Copyright © Chief Delphi