Skip to content

Commit 15a03ca

Browse files
author
Robotics
committed
messing with speed controllers
1 parent 381b2dc commit 15a03ca

File tree

11 files changed

+49
-12
lines changed

11 files changed

+49
-12
lines changed
0 Bytes
Binary file not shown.
0 Bytes
Binary file not shown.
0 Bytes
Binary file not shown.
0 Bytes
Binary file not shown.
4.46 KB
Binary file not shown.
0 Bytes
Binary file not shown.
0 Bytes
Binary file not shown.

FRC2020/src/main/java/frc/robot/Robot.java

Lines changed: 25 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -145,18 +145,39 @@ public void teleopPeriodic() {
145145
if (OI.getXboxLeftBumper() == true) {
146146
if (OI.harvester() == true) {
147147
BallManagement.harvesterForward();
148-
} else if (OI.conveyor() == true) {
148+
} else {
149+
BallManagement.harvesterStop();
150+
}
151+
152+
if (OI.conveyor() == true) {
149153
BallManagement.conveyorBackward();
150-
} else if (OI.loader() == true) {
154+
} else {
155+
BallManagement.conveyorStop();
156+
}
157+
158+
if (OI.loader() == true) {
151159
BallManagement.loaderBackward();
160+
} else {
161+
BallManagement.loaderStop();
152162
}
163+
153164
} else {
154165
if (OI.harvester() == true) {
155166
BallManagement.harvesterBackward();
156-
} else if (OI.conveyor() == true) {
167+
} else {
168+
BallManagement.harvesterStop();
169+
}
170+
171+
if (OI.conveyor() == true) {
157172
BallManagement.conveyorForward();
158-
} else if (OI.loader() == true) {
173+
} else {
174+
BallManagement.conveyorStop();
175+
}
176+
177+
if (OI.loader() == true) {
159178
BallManagement.loaderForward();
179+
} else {
180+
BallManagement.loaderStop();
160181
}
161182
}
162183

FRC2020/src/main/java/frc/robot/RobotMap.java

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
import edu.wpi.first.wpilibj.Relay;
66
import edu.wpi.first.wpilibj.XboxController;
77
import edu.wpi.first.wpilibj.DigitalInput;
8-
import edu.wpi.first.wpilibj.Talon;
8+
import edu.wpi.first.wpilibj.VictorSP;
99
import com.ctre.phoenix.motorcontrol.can.WPI_TalonSRX;
1010
import com.revrobotics.ColorSensorV3;
1111
import com.revrobotics.ColorMatch;
@@ -20,9 +20,12 @@ public class RobotMap {
2020
public static WPI_TalonSRX Harvester = new WPI_TalonSRX(6);
2121

2222
// TalonSR motors setup
23-
public static Talon Conveyor = new Talon(1);
24-
public static Talon Spinner = new Talon(2);
25-
public static Talon Loader = new Talon(3);
23+
public static VictorSP Conveyor = new VictorSP(1);
24+
public static VictorSP Spinner = new VictorSP(2);
25+
public static VictorSP Loader = new VictorSP(3);
26+
27+
28+
2629

2730
// Digital Input setup
2831
public static DigitalInput topLimitSwitch = new DigitalInput(0);

FRC2020/src/main/java/frc/robot/commands/Detector.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,8 +27,9 @@ protected void initialize(boolean color) {
2727
}
2828

2929
protected void execute() {
30+
int script_choice=0;
3031
if (false) {
31-
int script_choice = get_script_choice();
32+
script_choice = get_script_choice();
3233
obj.update_choice(script_choice);
3334

3435
// Store networktables output

0 commit comments

Comments
 (0)