项目:2014CataBot
文件:Debug.java
public static void log(String[] text) {
for (int i = 0; i < text.length; i++) {
if (text[i] == null || text[i].trim().equals("")) {
continue;
}
Line line = lines[i % 6];
int pos = 1;
String out = text[i].trim();
/*if (text.length > 6) {
pos = i < 6 ? 1 : DriverStationLCD.kLineLength / 2;
out = out.substring(0,(DriverStationLCD.kLineLength / 2) - 1); // Constrain
}*/
ds.println(line,pos,out);
}
update();
}
项目:aeronautical-facilitation
文件:AeronauticalFacilitation.java
/**
* This function is called periodically during operator control
*/
public void teleopPeriodic() {
display.println(Line.kUser1,1,"Lauch: " + launchercontroller.launcherswitch() + " ");
display.updateLCD();
Scheduler.getInstance().run();
if (alliance == 0) {
arduino.setPattern("1");
pattern = 1;
} else if (alliance == 1){
arduino.setPattern("2");
pattern = 2;
} else {
arduino.setPattern("0");
pattern = 0;
}
}
项目:aeronautical-facilitation
文件:AeronauticalFacilitation.java
public void disabledPeriodic() {
display.println(Line.kUser1,"Lauch: " + launchercontroller.launcherswitch() + " ");
display.updateLCD();
digital1 = driverStation.getDigitalIn(1);
digital2 = driverStation.getDigitalIn(2);
digital3 = driverStation.getDigitalIn(3);
alliance = driverStation.getAlliance().value;
if (digital1 == true && digital2 == false && digital3 == false) {
arduino.setPattern("4");
pattern = 1;
} else if (digital2 == true && digital1 == false && digital3 == false) {
arduino.setPattern("5");
pattern = 5;
} else if (digital3 == true && digital1 == false && digital2 == false) {
arduino.setPattern("6");
pattern = 6;
} else {
arduino.setPattern("0");
pattern = 0;
}
}
项目:FRCTesting
文件:Debug.java
public static void log(String[] text) {
for (int i = 0; i < text.length; i++) {
if (text[i] == null || text[i].trim().equals("")) {
continue;
}
Line line = lines[i % 6];
int pos = 1;
String out = text[i].trim();
/*if (text.length > 6) {
pos = i < 6 ? 1 : DriverStationLCD.kLineLength / 2;
out = out.substring(0,out);
}
update();
}
项目:ScraperBike2013
文件:ScraperBike.java
/**
* This method is called periodically during operator control.
* <p/>
* This method is called approximately 200 times a second.
*/
public void teleopPeriodic() {
System.out.println("dio 6: " + !RobotMap.armsExtendedFore.get() + ",dio 7: " + !RobotMap.armsExtendedAft.get() + ",dio 9: " + !RobotMap.armsHome.get());
display.updateLCD();
RobotMap.debug = DriverStation.getInstance().getDigitalIn(1);
RobotMap.debugTable = DriverStation.getInstance().getDigitalIn(2);
Scheduler.getInstance().run();
display.println(Line.kUser1,"Aspect Ratio: " + RobotMap.Top.aspect);
display.println(Line.kUser2,"CenX: " + RobotMap.Top.cenX);
display.println(Line.kUser3,"CenY: " + RobotMap.Top.cenY);
display.println(Line.kUser4,"distance (in): " + RobotMap.Top.getRange());
//display.println(Line.kUser5,"distance (ft): " + RobotMap.Top.getRange()/12);
display.println(Line.kUser5,"shoot RPM: " + RobotMap.shootEncoder.getRate()*60);
display.println(Line.kUser6,"shoot encoder: " + (((double)RobotMap.shootEncoder.get())/360));
this.debugToTable("Encoder getrate",RobotMap.shootEncoder.getRate());
this.debugToTable("Encoder get",RobotMap.shootEncoder.get());
display.updateLCD();
}
项目:2484-tesla-2013
文件:Robot_Tesla_2013.java
/**
* This function is called once each time the robot enters autonomous mode.
*/
public void autonomous()
{
reset();
getWatchdog().setEnabled(false);
m_LCD.println(Line.kUser6,LCDCol,"Driving");
autoLoop(-.5,-.6,1.75f);
m_LCD.println(Line.kUser6,"Firing 1");
m_Shooter.Fire();
autoLoop(0,3.0f);
m_LCD.println(Line.kUser6,"Firing 2");
m_Shooter.Fire();
autoLoop(0,"Firing 3");
m_Shooter.Fire();
autoLoop(0,"Turning Off");
m_Shooter.TurnOff();
autoLoop(0,0.25f);
m_LCD.println(Line.kUser6," ");
}
项目:2014CataBot
文件:Debug.java
/**
* Log to Driver Station LCD.
*
* @param ln The line number from 1 to 6.
* @param col The column - either 1 or 2.
* @param text The line to send.
*/
public static void log(int ln,int col,String text) {
Line line = lines[ln - 1];
int pos = col == 1 ? 1 : (DriverStationLCD.kLineLength / 2);
text = text.trim();//.substring(0,(DriverStationLCD.kLineLength / 2) - 1); // Constrain
clearLine(ln);
ds.println(line,text);
update();
}
项目:aeronautical-facilitation
文件:AeronauticalFacilitation.java
项目:aeronautical-facilitation
文件:DriveTrain.java
项目:aeronautical-facilitation
文件:DriveTrain.java
项目:FRCTesting
文件:Debug.java
项目:ScraperBike2013
文件:ScraperBike.java
/**
* This function is run when the robot is first started up and should be
* used for any initialization code.
*/
public void robotinit() {
// instantiate the command used for the autonomous period
//status = new String();
nt = NetworkTable.getTable("ST");
debugTable = NetworkTable.getTable("Debug");
nt.putString("Status","Initializing");
nt.putBoolean("AutoAlign",false);
pusher = new Pusher();
DriveTrain = new DriveTrain(); // must be before Arms constructor
arms = new Arms();
VerticalAxis = new VerticalTurretAxis();
shooterController = new Shooter();
display = DriverStationLCD.getInstance();
OI.initialize();
display.updateLCD();
display.println(Line.kUser1,"Initializing... ");
display.println(Line.kUser2," ");
display.println(Line.kUser3," ");
display.println(Line.kUser4," ");
display.println(Line.kUser5," ");
display.println(Line.kUser6," ");
display.updateLCD();
compressor = new Compressor(RobotMap.pressureSwitch,RobotMap.compressorRelay);
compressor.start();
RobotMap.shootEncoder.start();
nt.putString("Status","Initialized");
tp = new TargetParser();
updateSolenoids = new UpdateSolenoidModule();
updateSolenoids.start();
//shooterElevationPID = new ShooterElevationPID(RobotMap.shooterElevationKp,RobotMap.shooterElevationKi,RobotMap.shooterElevationKd);
//shooterElevationPID.start();
RobotMap.shootEncoder.setdistancePerpulse((1.0/360.0));
}
项目:2484-tesla-2013
文件:Robot_Tesla_2013.java
/**
* Call this to reset the robot.
*/
public void reset()
{
//Pistons
//if (m_ArmPistonOut) //If Arm is out..
//{
// m_ArmSolIn.set(true); //pull it back in
// m_ArmSolOut.set(false);
//}
//Variables
m_TrigRightWasDown = false;
//m_ArmPistonOut = false;
//m_XButWasDown = false;
//m_ArmPistonBringIn = false;
//m_BackButWasDown = false;
//m_XBackButWasDown = false;
m_YButWasDown = false;
m_FrisbeeMotorSpin = false;
//m_SetSpin = 0;
m_BButWasDown = false;
m_FrisbeeFired = false;
m_ShotsFired = 0;
//Strings
//m_LCD.println(Line.kUser1,ArmPosBegin);
//m_LCD.println(Line.kUser2,ArmDirBegin);
m_LCD.println(Line.kUser4,FrisbeeBegin);
m_LCD.println(Line.kUser5,ShotsBegin);
m_LCD.println(Line.kUser6," ");
m_LCD.updateLCD();
}
项目:2484-tesla-2013
文件:Robot_Tesla_2013.java
/**
* Call this to use the Frisbee shooter.
*/
public void frisbee()
{
if (m_BButpressed)
{
if (m_FrisbeeMotorSpin)
{
m_FrisbeeMotorSpin = false;
m_Shooter.TurnOff();
//m_SetSpin = 0; //Stopping spin
}
else
{
m_FrisbeeMotorSpin = true;
//m_Shooter.TurnOn();
//m_SetSpin = 1; //Spinning full power
}
//m_FrisbeeMotor.set(m_SetSpin*-1); //Seting spin
}
if (m_Shooter.GetState() < Shooter.SHOOTER_ON)
{
m_LCD.println(Line.kUser4,NoSpinString);
}
else
{
m_LCD.println(Line.kUser4,SpunUpString);
}
if (m_TrigRightpressed)
{
m_Shooter.Fire();
m_ShotsFired++;
m_LCD.println(Line.kUser5,m_ShotsFired + Shotsstring);
// if (!m_FrisbeeFired)
// {
// m_FrisbeeFired = true;
// m_FrisbeeSolIn.set(true);
// m_FrisbeeSolOut.set(false); //Pushing frisbee into firing motor
// m_ShotsFired++;
// m_LCD.println(Line.kUser5,m_ShotsFired + Shotsstring);
// }
// else
// {
// m_FrisbeeFired = false;
// m_FrisbeeSolIn.set(false);
// m_FrisbeeSolOut.set(true); //Grabbing another frisbee
// }
}
}
版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 dio@foxmail.com 举报,一经查实,本站将立刻删除。