Pneumatics Code

Hi everyone,

Last year our team didn’t use any pneumatics on our robot so I never learned the code used in Wind River for to activate the compressor, regulators, etc. Could anyone provide me with a quick synopsis about how to program these features in C++ or just show me some source code for pneumatics that you have used? Thanks so much for the help.

This is Team 2502’s Pneumatics code.

http://github.com/keehun/TeamRobotCode/blob/68425b636f9e8afc9b04d1d78fdbfed73d45554c/Pneumatics.cpp

It’s somewhat complicated but that’s because we have it multithreaded and the kicker is programmed to automatically retract after half a second.

Otherwise, the constructor section is probably the most important. If you want a clear cut simple example, let me know!

Thanks,
Keehun

read http://first.wpi.edu/Images/CMS/First/WPI_Robotics_Library_Users_Guide.pdf

I’m having problems with the compressor as well. I have the coding down, however I am not sure if the pwms are connected in the right direction. Is the ground (the black cable, for a regular white,red,black pwm) suppose to face in towards the sidecar or outtowards the edges? Also, I could not find the pin specs for the relay either, which pin is ground, +12, etc.?

EDIT:
okay I’m not sure whats wrong with ours. The compressor is functional, we have tested it with the battery. The relay is plugged into the relay port 1, and the pressure switch is on digital IO 1, both of the ground pins are facing out.
For the code,
I initialize the compressor using Compressor *m_com; at the beginning of the class, and declare it in the constructor: m_com = new Compressor(1,1); I do m_com->Start(); on the next line. This should start the compressor correct? It shows no activity for some reason.

great thanks for the help guys

Dude, omg. Thanks so much. Saved us a ton of time and problems.