File tree Expand file tree Collapse file tree 1 file changed +12
-3
lines changed
Hoops/src/main/java/org/firstinspires/ftc/hoops/subsystems Expand file tree Collapse file tree 1 file changed +12
-3
lines changed Original file line number Diff line number Diff line change @@ -12,8 +12,9 @@ public class LauncherSubsystem {
1212
1313 public static double MAX_MOTOR_VELOCITY = 1.0 ;
1414
15- boolean hasHardware ;
15+ public static double MIN_MOTOR_VELOCITY = 0.25 ;
1616
17+ boolean hasHardware ;
1718 EncodedMotor <DcMotorEx > top ;
1819 EncodedMotor <DcMotorEx > bottom ;
1920
@@ -38,8 +39,16 @@ public void Launch(double angleInDegrees) {
3839 // Spin the motors
3940 // TODO: make the motors spit the thing at the right angle
4041 if (hasHardware ) {
41- top .setVelocity (MAX_MOTOR_VELOCITY );
42- bottom .setVelocity (MAX_MOTOR_VELOCITY );
42+ if (angleInDegrees > 0 ) {
43+ top .setVelocity (MAX_MOTOR_VELOCITY );
44+ bottom .setVelocity (MIN_MOTOR_VELOCITY );
45+ } else if (angleInDegrees < 0 ) {
46+ top .setVelocity (MIN_MOTOR_VELOCITY );
47+ bottom .setVelocity (MAX_MOTOR_VELOCITY );
48+ } else {
49+ top .setVelocity (MAX_MOTOR_VELOCITY );
50+ bottom .setVelocity (MAX_MOTOR_VELOCITY );
51+ }
4352 }
4453 }
4554
You can’t perform that action at this time.
0 commit comments