Skip to content

Commit ab11d70

Browse files
author
Robotics
committed
added sensors (rotation + dist)
1 parent 063d2b3 commit ab11d70

File tree

12 files changed

+8
-9
lines changed

12 files changed

+8
-9
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.
6.6 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: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -135,6 +135,8 @@ public void robotPeriodic() {
135135
SmartDashboard.putNumber("Shooter Velocity", -1 * shooterVel);
136136
SmartDashboard.putNumber("Top Limit switch", RobotMap.topLimitSwitch.get() ? 1:0); // converts boolean to int
137137
SmartDashboard.putNumber("Bottom Limit Switch", RobotMap.bottomLimitSwitch.get() ? 1:0);
138+
SmartDashboard.putNumber("Distance sensor value(in)", RobotMap.distanceSensor.getValue() * 0.125);
139+
SmartDashboard.putNumber("Encoder velocity(rpm)", RobotMap.CANCoder.getVelocity() / -360.0);
138140

139141
if (ColorCycle.colorCycleValue == 3) {
140142
ColorCycle.colorCycleStop();

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

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
import edu.wpi.first.wpilibj.Joystick;
55
import edu.wpi.first.wpilibj.Relay;
66
import edu.wpi.first.wpilibj.XboxController;
7+
import edu.wpi.first.wpilibj.AnalogInput;
78
import edu.wpi.first.wpilibj.DigitalInput;
89
import edu.wpi.first.wpilibj.Spark;
910
import com.ctre.phoenix.motorcontrol.can.WPI_TalonSRX;
@@ -51,6 +52,9 @@ public class RobotMap {
5152
// RPM SenSor setup
5253
public static CANCoder CANCoder = new CANCoder(7);
5354

55+
// Distance sensor setup
56+
public static AnalogInput distanceSensor = new AnalogInput(0);
57+
5458
// Relay
5559
public static Relay GreenLED = new Relay(3);
5660
}

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -37,10 +37,10 @@ protected boolean isFinished() {
3737
}
3838

3939
protected void end() {
40-
Robot.winch.winchStop();
40+
Winch.winchStop();
4141
}
4242

4343
protected void interrupted() {
44-
Robot.winch.winchStop();
44+
Winch.winchStop();
4545
}
4646
}

0 commit comments

Comments
 (0)