View Single Post
  Spotlight this post!  
Unread 02-02-2011, 16:20
Alan Anderson's Avatar
Alan Anderson Alan Anderson is offline
Software Architect
FRC #0045 (TechnoKats)
Team Role: Mentor
 
Join Date: Feb 2004
Rookie Year: 2004
Location: Kokomo, Indiana
Posts: 9,113
Alan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond repute
Re: Compressor programming please help

The Compressor class takes care of all the logic for you. All you need to do is create a Compressor object with the proper Relay and Digital I/O pins specified, and tell it to start.

Code:
Compressor *myCompressor = new Compressor(1, 5); 
myCompressor->Start();
It will turn on and off all by itself after that.

The pressure switch is a simple SPST switch. It does not matter which side of the connection is which. One side goes to a black "ground" wire on a Digital I/O, and the other side goes to a white "signal" wire. The red "+5" wire should not be connected, and for safety the end of it should be wrapped in electrical tape to prevent it from touching anything.

Last edited by Alan Anderson : 02-02-2011 at 16:22.
Reply With Quote