Skip to content

Commit 359f792

Browse files
author
Asymons
committed
Working Code for Robot In Progress
1 parent 8516b28 commit 359f792

File tree

9 files changed

+35
-28
lines changed

9 files changed

+35
-28
lines changed
336 Bytes
Binary file not shown.
Binary file not shown.
934 Bytes
Binary file not shown.
Binary file not shown.

Raider/dist/FRCUserProgram.jar

1.43 KB
Binary file not shown.

Raider/src/org/usfirst/frc/team4716/robot/Robot.java

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,8 @@
11

22
package org.usfirst.frc.team4716.robot;
33

4-
import java.io.FileReader;
5-
64
import org.usfirst.frc.team4716.robot.commands.Auto.DoNothing;
5+
import org.usfirst.frc.team4716.robot.commands.DriveTrain.DriveForwardTime;
76
import org.usfirst.frc.team4716.robot.subsystems.DriveTrain;
87

98
import edu.wpi.first.wpilibj.IterativeRobot;
@@ -36,6 +35,7 @@ public void robotInit() {
3635
oi = new OI();
3736
chooser = new SendableChooser();
3837
chooser.addDefault("Nothing", new DoNothing());
38+
chooser.addObject("Drive Forward Time", new DriveForwardTime(1.0,5.0));
3939
// chooser.addObject("Low Goal", object);
4040

4141
SmartDashboard.putData("Auto mode", chooser);
@@ -101,6 +101,7 @@ public void teleopInit() {
101101
*/
102102
public void teleopPeriodic() {
103103
Scheduler.getInstance().run();
104+
System.out.println(Robot.drivetrain.getUltrasonicLeft());
104105
}
105106

106107
/**

Raider/src/org/usfirst/frc/team4716/robot/subsystems/Bucket.java

Lines changed: 26 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -14,35 +14,35 @@
1414
*/
1515
public class Bucket extends Subsystem {
1616

17-
// public enum Direction {
18-
// UP, DOWN
19-
// }
20-
//
21-
// SpeedController MOTOR_BUCKET_OPS,
22-
// MOTOR_BALL_INTAKE;
23-
//
24-
// DigitalInput LIMIT_UP,
25-
// LIMIT_DOWN;
26-
//
27-
// DoubleSolenoid PISTON_EJECT;
28-
// boolean isPoked;
29-
//
30-
// Thread BACKGROUND_JOB;
17+
public enum Direction {
18+
UP, DOWN
19+
}
20+
21+
SpeedController MOTOR_BUCKET_OPS,
22+
MOTOR_BALL_INTAKE;
23+
24+
DigitalInput LIMIT_UP,
25+
LIMIT_DOWN;
26+
27+
DoubleSolenoid PISTON_EJECT;
28+
boolean isPoked;
29+
30+
Thread BACKGROUND_JOB;
3131
//
3232
public Bucket(){
3333
//
34-
// MOTOR_BUCKET_OPS = new Talon(RobotMap.MOTOR_BUCKET_OPS_PORT);
35-
// MOTOR_BALL_INTAKE = new Talon(RobotMap.MOTOR_BALL_INTAKE_PORT);
36-
//
37-
// LIMIT_UP = new DigitalInput(RobotMap.SWTICH_UP_PORT);
38-
// LIMIT_DOWN = new DigitalInput(RobotMap.SWITCH_DOWN_PORT);
39-
//
40-
// PISTON_EJECT = new DoubleSolenoid(RobotMap.PISTON_EJECT_MODULE_NUMBER
41-
// , RobotMap.PISTON_EJECT_FORWARD_CHANNEL
42-
// , RobotMap.PISTON_EJECT_REVERSE_CHANNEL);
43-
// PISTON_EJECT.set(DoubleSolenoid.Value.kReverse);
44-
// isPoked = false;
45-
//
34+
MOTOR_BUCKET_OPS = new Talon(2);
35+
MOTOR_BALL_INTAKE = new Talon(3);
36+
37+
LIMIT_UP = new DigitalInput(0);
38+
LIMIT_DOWN = new DigitalInput(1);
39+
40+
PISTON_EJECT = new DoubleSolenoid(1
41+
, 0
42+
, 1);
43+
PISTON_EJECT.set(DoubleSolenoid.Value.kReverse);
44+
isPoked = false;
45+
4646
// BACKGROUND_JOB = new Thread(new BucketBackgroundTask(this.MOTOR_BALL_INTAKE));
4747
// BACKGROUND_JOB.start();
4848
}

Raider/src/org/usfirst/frc/team4716/robot/subsystems/DriveTrain.java

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -65,6 +65,8 @@ public DriveTrain(){
6565
SOLENOID_DRIVE_BACK_RIGHT = new DoubleSolenoid(0,6,7);
6666
SOLENOID = new DoubleSolenoid(1, 0, 1);
6767

68+
ultrasonicLeft = new Ultrasonic(0,1);
69+
6870
// /*Encoder Initialzation*/
6971
// encoderDriveLeft = new Encoder(RobotMap.ENCODER_DRIVE_LEFT_PORT_A, RobotMap.ENCODER_DRIVE_LEFT_PORT_B);
7072
// encoderDriveRight = new Encoder(RobotMap.ENCODER_DRIVE_RIGHT_PORT_A, RobotMap.ENCODER_DRIVE_RIGHT_PORT_B);
@@ -183,6 +185,10 @@ public double getGyro(){
183185
return gyro.getAngle();
184186
}
185187

188+
public double getUltrasonicLeft(){
189+
return ultrasonicLeft.getRangeInches();
190+
}
191+
186192

187193
// AUTONOMOUS METHODS
188194

Raider/sysProps.xml

0 Bytes
Binary file not shown.

0 commit comments

Comments
 (0)