View Single Post
  #1   Spotlight this post!  
Unread 31-01-2013, 13:00
gitlitz gitlitz is offline
Registered User
FRC #4590
 
Join Date: Jan 2013
Location: israel
Posts: 11
gitlitz is an unknown quantity at this point
Problem with the compressor class

Hey, I am from team 4590.

We are having trouble with the compressor- it does nothing.
The pressure switch is connected to DigitalInput 1 and the Spike to Relay 2.
This is our full simple code:

note: when we use the Relay.Set() function (and don't use the Compressor class at all) the compressor works.

Code:
#include "WPILib.h"
 
class RobotDemo : public SimpleRobot
{
	Joystick stick;
	Compressor comp;

public:
	RobotDemo(void):
		stick(1),
		comp(1,2)
	{
		comp.Start();
	}

	void Autonomous(void)
	{
		Wait(2.0); 				
	}

	void OperatorControl(void)
	{
		while (IsOperatorControl())
		{
			Wait(0.005);
		}
	}
	
	void Test() {

	}
};

START_ROBOT_CLASS(RobotDemo);
Reply With Quote