Go to Post I always love the optimism of [build] week 1. - Donut [more]
Home
Go Back   Chief Delphi > Technical > Programming > C/C++
CD-Media   CD-Spy  
portal register members calendar search Today's Posts Mark Forums Read FAQ rules

 
 
 
Thread Tools Rate Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Spotlight this post!  
Unread 15-02-2010, 23:28
kennypu kennypu is offline
Registered User
FRC #2467
 
Join Date: Jan 2010
Location: Hawaii
Posts: 40
kennypu is an unknown quantity at this point
Compressor won't start

For some reason, our compressor won't start when the code deploys fine, and we have the compressor and pressure gauge switch hooked up correctly ( I think). The compressor should start soon as the robot is turned on correct? The compressor for us doesn't even start even if we enable teleops in the DS. Any help will be appreciated. I may be missing a simple step, so if anybody has an idea, please give suggestions. Here is the code btw:
Code:
#include "WPILib.h"

#include "Vision/AxisCamera2010.h"
#include "Vision/HSLImage.h"
#include "PIDController.h"
#include "Gyro.h"
#include "Target.h"
#include "DashboardDataSender.h"

//#define MINIMUM_SCORE 0.01

/**
 * This is a demo program showing the use of the RobotBase class.
 * The SimpleRobot class is the base of a robot application that will automatically call your
 * Autonomous and OperatorControl methods at the right time as controlled by the switches on
 * the driver station or the field controls.
 */ 
bool moveState = false;
class RobotDemo : public SimpleRobot
{
	RobotDrive myRobot; // robot drive system
	Joystick stick; // only joystick
	Jaguar leftMotors;
	Jaguar rightMotors;
	Compressor compressor;
	Relay relay;
	//DashboardDataSender *dds;
	//Gyro *gyro;
	//PIDOutput *pidOutput;

public:
	RobotDemo(void):
		myRobot(3, 4),	// these must be initialized in the same order
		stick(1),		// as they are declared above.
		leftMotors(1),
		rightMotors(2),
		compressor(4,2)
	{
		
		//start the compressor
		compressor.Start();
		AxisCamera &camera = AxisCamera::getInstance();
		//dds = new DashboardDataSender();
		//gyro = new Gyro(1);
		//pidOutput = new SamplePIDOutput(myRobot);
		GetWatchdog().SetExpiration(0.1);
		
		
	}

	/**
	 * Drive left & right motors for 2 seconds then stop
	 */
	void Autonomous(void)
	{
		GetWatchdog().SetEnabled(false);
		myRobot.Drive(0.5, 0.0); 	// drive forwards half speed
		Wait(2.0); 				//    for 2 seconds
		myRobot.Drive(0.0, 0.0); 	// stop robot
	}

	/**
	 * Runs the motors with arcade steering. 
	 */
	void OperatorControl(void)
	{
		GetWatchdog().SetEnabled(true);
		while (IsOperatorControl())
		{
			GetWatchdog().Feed();
			//myRobot.ArcadeDrive(stick); // drive with arcade style (use right stick)
			if(stick.GetRawButton(1))
			{
				moveState = 0;
			}
			if(stick.GetRawButton(3))
			{
				moveState = 1;
			}
			if(moveState == false)
			{
				//do nothing
			}
			if(moveState == true)
			{
				leftMotors.Set(-stick.GetY());
				rightMotors.Set(stick.GetZ());
				Wait(0.005);
			}
			
			// Create and set up a camera instance. first wait for the camera to start
					// if the robot was just powered on. This gives the camera time to boot.
					//Wait(10.0);
					//printf("Getting camera instance\n");
			
		}
	}
};

START_ROBOT_CLASS(RobotDemo);
as you can see, its quite simple, however I don't know what is going on. Thanks again,
ken
Reply With Quote
 


Thread Tools
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Compressor won't start Alex_2487 C/C++ 6 12-02-2009 16:41
Wind River won't start radau C/C++ 6 19-01-2009 23:09
Won't Download! diaperrash89 Programming 4 25-10-2007 23:02
Running just the compressor (was: free compressor) sciguy125 Pneumatics 15 06-02-2006 18:23
Help! My 2003 Bot compressor won't shut off Jack21 Control System 10 11-02-2004 12:24


All times are GMT -5. The time now is 18:06.

The Chief Delphi Forums are sponsored by Innovation First International, Inc.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2017, Jelsoft Enterprises Ltd.
Copyright © Chief Delphi