View Single Post
  #1   Spotlight this post!  
Unread 05-02-2008, 19:31
ShotgunNinja's Avatar
ShotgunNinja ShotgunNinja is offline
Programming Mentor, FRC 4247
AKA: Nicholas Iannone
FRC #4247 (CougarBOTS)
Team Role: Mentor
 
Join Date: Jan 2008
Rookie Year: 2006
Location: Milwaukee, WI
Posts: 159
ShotgunNinja is a jewel in the roughShotgunNinja is a jewel in the roughShotgunNinja is a jewel in the roughShotgunNinja is a jewel in the rough
Automated Air Compressor code

In case anyone needed some help with putting on an automated air compressor, here is some code that may be able to help. In order to use this, you would need a single pressure switch attached to a relay and an input, and a relay for the air compressor.

In Initialize:
Code:
InitPressureSwitch(psInput, psRelay);
And in a new function:
Code:
void PressureSwitch(void)
{
   unsigned char pswitch;

   pswitch = GetDigitalInput(psInput);
   if (pswitch)
   {
      SetRelay(airpump, 1, 0);
   }
   else
   {
      SetRelay(airpump, 0, 0);
   }
}
You also need to appropriately set the values of airpump, psInput, and psRelay.
__________________
Team #2970 Alum
Team #1652 Alum
2006: School Mascot for Team 1652
2007-2008: Programmer for Team 1652 (Robot Mafia)
2009: Programmer on Team 1652 (Robot Mafia), Programmer on Team 2970 (eSchool eBots)
2010-2016: Volunteer, Wisconsin Regional
2017: Programming Mentor, FRC 4247 (CougarBOTS, Obama SCTE, Milwaukee, WI)