Where do I turn compressor on in code?

Hello People of Chief Dephi! I’m the programmer for team 4643 and this is our first year using C++ and we have been doing fairly well so far. I recently, however, ran in to the question of turning on the compressor. I looked through all of my files and from that decided to assume that the best place to turn it on would be TeleopPeriodic as well as AutonomusPeriodic. Was I right to assume so? I just want to check with someone who knows what they are doing before we test this on our robot today and I mess things up. Help of any sort is appreciated!

You don’t have to “turn on” the compressor.

See top of
http://wpilib.screenstepslive.com/s/4485/m/13810/l/241865-operating-a-compressor-for-pneumatics

Also checkout section 4.1 in PCM User’s Guide.
http://www.ctr-electronics.com/pcm.html#product_tabs_technical_resources

RobotMap::manipACompressor1->SetClosedLoopControl(1);
This is what I put in both AtonomousPeriodic and TeleopPeriodic. If I was wrong in doing so where can I put them?

What ozrien was trying to say is that this year you don’t have to “turn on” the compressor if you wire your compressor straight to the PCM. It turns on automatically without writing code for it.