RoboRIO red comm light, not accepting code?

Our PDP is giving us an orange light, and our roboRIO is giving us a red comm light. When we deploy code, eclipse reports it as deployed, but the roboRIO does not seem to get the new code. The ni web browser does NOT report a sticky fault.
Technical Details:
RoboRIO is imaged
Can ID’s are correct
No fuses appear to be blown
Driver station can connect, but does not report any code

Is the roboRIO perhaps set to not run the user program on startup?

1 Like

Commenting out the auto code I had added fixed the red comm light. Does anyone mind reading through the code to see what might be causing the error?

void AutonomousInit()
	{

		//gyro->Reset();
	}

	void AutonomousPeriodic()
	{

/*
	SmartDashboard::PutNumber("Gyro Angle:", Angle);
if (automode == 1)
{
	gyro->GetAngle();
{
	if (Angle == 90)
	{
		robottime = false;
	} else {
		robottime = true;
	}
}
if(robottime == true)
{
	robot->Drive(0,-1);
}
if (robottime == false)
{
	robot->Drive(0,-1);
}
}
if (automode == 2)
{
	gyro->GetAngle();
	if (Angle == 45)
	{
		robottime = false;
	} else {
		robottime = true;
	}
	if (robottime == true)
	{
		robot->Drive(0, -.5);
	}
	if (robottime == false)
	{
		robot->Drive(0,0);
	}
}
*/
}

is using a selector based on joystick button during robotinit causing this?

I’d wager that either robot or gyro is an uninitialized pointer.

That doesn’t seem to be it. To clarify, eclipse doesn’t give us any errors when we deploy or build; the roboRIO gives us a red comm light when we deploy it, and it gets no code. It gets code fine if auto is commented out. Here’s a sample with the robotinit part to clarify that:

#include "WPILib.h"

class Robot: public IterativeRobot
{
private:
	//Initializing livewindow
	LiveWindow *lw;
	//Initializing stick
	Joystick *stick;
	//Initializing the Chassis parts
	Talon *kFrontLeftMotor;
	Talon *kFrontRightMotor;
	RobotDrive *robot;
	Relay *Fan;
	DoubleSolenoid *shifter;
	Encoder *ChassisEnc;
	Encoder *OtherEnc;
	//Initializing the values for Cheesy Drive
	float Rotation;
	float Acceleration;
	float rightMultiplier;
	float leftMultiplier;
    double automode;
    Gyro *gyro;
    bool robottime;
    double Angle;


	void RobotInit()
	{

		SmartDashboard::init();
		lw = LiveWindow::GetInstance();
		stick = new Joystick(0);
		kFrontLeftMotor = new Talon(0);
		kFrontRightMotor = new Talon(1);
		robot = new RobotDrive(kFrontRightMotor, kFrontLeftMotor);
		Fan = new Relay (3);


		/* Setting the shifter as a DoubleSolenoid
		 * Because we're using both pistons off of
		 * one Double Solenoid
		 */
		shifter = new DoubleSolenoid (0,1);

		ChassisEnc = new Encoder (0,1, false, Encoder::EncodingType::k4X);
		OtherEnc= new Encoder (8,9, false, Encoder::EncodingType::k4X);

		//Setting it so the fan is off by default
		Fan->Set(Relay::kOff);


		//Setting the Rotation and Accel values
		Rotation = stick->GetRawAxis(1);
		Acceleration = stick->GetRawAxis(3);

	    /*Setting the multipliers
	     * so that they don't allow
	     * a robot to go full forward
	     * while going full turn
	     */

		rightMultiplier = Rotation + Acceleration;
		leftMultiplier = Rotation - Acceleration;

		//Setting the shifter to Low Gear
		shifter->Set(DoubleSolenoid::kReverse);
		robot->SetInvertedMotor(RobotDrive::kFrontLeftMotor, true);
		robot->SetInvertedMotor(RobotDrive::kFrontRightMotor, true);

		ChassisEnc->SetDistancePerPulse(11.04);
		OtherEnc->SetDistancePerPulse(11.04);

	/*gyro = new Gyro (2);
	Angle = gyro->GetAngle();

	if (stick->GetRawButton(1))

		{
			automode = 1;
		}
		if (stick->GetRawButton(2))

The gyro constructor is commented out in the code you just posted, and your gyro appears to be on a channel that won’t work. It needs to be on Channels 0 or 1.

Yeah, it was commented out after deploying, along with the auto code. Confused about the second sentence, doesn’t the gyro have four ports it can plug into? Sorry for slow replies BTW, school WiFi does not let me post on chief Delphi, other than starting threads.

1 Like

The Analog Accumulators used for the gyro are only on channels 0 and 1.

See Gyro: http://first.wpi.edu/FRC/roborio/release/docs/cpp/classGyro.html
And AnalogInput kAccumulatorChannels : http://first.wpi.edu/FRC/roborio/release/docs/cpp/classAnalogInput.html

Try looking at the logs on the Dashboard. Usually they’ll give you an error.

1 Like

Changing gyro port to 1 fixed it! Thanks. The only thing I can’t figure out is how to have multiple auto modes without using the selectable chooser. It seems that only works with command based robot?