Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 11 additions & 8 deletions PowerUp2018/.classpath
Original file line number Diff line number Diff line change
@@ -1,10 +1,13 @@
<?xml version="1.0" encoding="UTF-8"?>
<classpath>
<classpathentry kind="src" path="src"/>
<classpathentry kind="var" path="wpilib" sourcepath="wpilib.sources"/>
<classpathentry kind="var" path="networktables" sourcepath="ntcore.sources"/>
<classpathentry kind="var" path="opencv" sourcepath="opencv.sources"/>
<classpathentry kind="var" path="cscore" sourcepath="cscore.sources"/>
<classpathentry kind="var" path="wpiutil" sourcepath="wpiutil.sources"/>
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.8"/>
<classpathentry kind="output" path="bin"/>
<classpathentry kind="src" path="src"/>
<classpathentry kind="var" path="wpilib" sourcepath="wpilib.sources"/>
<classpathentry kind="var" path="networktables" sourcepath="ntcore.sources"/>
<classpathentry kind="var" path="opencv" sourcepath="opencv.sources"/>
<classpathentry kind="var" path="cscore" sourcepath="cscore.sources"/>
<classpathentry kind="var" path="wpiutil" sourcepath="wpiutil.sources"/>
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.8"/>
<classpathentry kind="var" path="USERLIBS_DIR/mindsensors-javadoc.jar"/>
<classpathentry kind="var" path="USERLIBS_DIR/mindsensors.jar"/>
<classpathentry kind="output" path="bin"/>
</classpath>
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
package org.usfirst.frc.team6351.robot.subsystems;

import com.mindsensors.CANLight;

import edu.wpi.first.wpilibj.DriverStation;
import edu.wpi.first.wpilibj.command.Subsystem;

/**
*
*/
public class RGBLights extends Subsystem {

// Put methods for controlling this subsystem
// here. Call these from Commands.

//Verify CAN ID Number
CANLight lights = new CANLight(3);

public void initDefaultCommand() {
// Set the default command for a subsystem here.
//setDefaultCommand(new MySpecialCommand());
}

public void blinkPCB_LED() {
//Meant for debugging purposes
lights.blinkLED(10);
}
public void setToColor(int red, int green, int blue) {
lights.showRGB(red, green, blue);
}
public void setRainbowFade() {
lights.reset();
lights.fade(0,7);
}
public void setToAllianceColor() {
DriverStation ds = DriverStation.getInstance();
if (ds.getAlliance() == DriverStation.Alliance.Red) {
lights.showRGB(255, 51, 0);
} else if (ds.getAlliance() == DriverStation.Alliance.Blue) {
lights.showRGB(0, 102, 255);
} else if (ds.getAlliance() == DriverStation.Alliance.Invalid) {
lights.showRGB(255, 200, 0); // yellow
}
}
public void setToEndMatchFlash() {
//Flash between red and blue near end of match
lights.writeRegister(0, 0.25, 0, 102, 255);
lights.writeRegister(1, 0.25, 255, 51, 0);
lights.cycle(0, 1);
}

}