11
11
import edu .wpi .first .wpilibj .TimedRobot ;
12
12
import edu .wpi .first .wpilibj .smartdashboard .SmartDashboard ;
13
13
14
- import com .revrobotics .SparkMaxLimitSwitch ;
14
+ import com .revrobotics .SparkLimitSwitch ;
15
15
import com .revrobotics .CANSparkMax ;
16
- import com .revrobotics .CANSparkMaxLowLevel .MotorType ;
16
+ import com .revrobotics .CANSparkLowLevel .MotorType ;
17
17
18
18
public class Robot extends TimedRobot {
19
19
private Joystick m_stick ;
20
20
private static final int deviceID = 1 ;
21
21
private CANSparkMax m_motor ;
22
- private SparkMaxLimitSwitch m_forwardLimit ;
23
- private SparkMaxLimitSwitch m_reverseLimit ;
22
+ private SparkLimitSwitch m_forwardLimit ;
23
+ private SparkLimitSwitch m_reverseLimit ;
24
24
25
25
public String kEnable ;
26
26
public String kDisable ;
@@ -38,22 +38,22 @@ public void robotInit() {
38
38
m_motor .restoreFactoryDefaults ();
39
39
40
40
/**
41
- * A SparkMaxLimitSwitch object is constructed using the getForwardLimitSwitch() or
41
+ * A SparkLimitSwitch object is constructed using the getForwardLimitSwitch() or
42
42
* getReverseLimitSwitch() method on an existing CANSparkMax object, depending
43
43
* on which direction you would like to limit
44
44
*
45
45
* Limit switches can be configured to one of two polarities:
46
- * com.revrobotics.SparkMaxLimitSwitch.SparkMaxLimitSwitch .Type.kNormallyOpen
47
- * com.revrobotics.SparkMaxLimitSwitch.SparkMaxLimitSwitch .Type.kNormallyClosed
46
+ * com.revrobotics.SparkLimitSwitch.SparkLimitSwitch .Type.kNormallyOpen
47
+ * com.revrobotics.SparkLimitSwitch.SparkLimitSwitch .Type.kNormallyClosed
48
48
*/
49
- m_forwardLimit = m_motor .getForwardLimitSwitch (SparkMaxLimitSwitch .Type .kNormallyClosed );
50
- m_reverseLimit = m_motor .getReverseLimitSwitch (SparkMaxLimitSwitch .Type .kNormallyClosed );
49
+ m_forwardLimit = m_motor .getForwardLimitSwitch (SparkLimitSwitch .Type .kNormallyClosed );
50
+ m_reverseLimit = m_motor .getReverseLimitSwitch (SparkLimitSwitch .Type .kNormallyClosed );
51
51
52
52
m_stick = new Joystick (0 );
53
53
54
54
/**
55
55
* Limit switches are enabled by default when they are intialized. They can be disabled
56
- * by calling enableLimitSwitch(false) on a SparkMaxLimitSwitch object
56
+ * by calling enableLimitSwitch(false) on a SparkLimitSwitch object
57
57
*
58
58
* Limit switches can be reenabled by calling enableLimitSwitch(true)
59
59
*
@@ -74,7 +74,7 @@ public void teleopPeriodic() {
74
74
m_reverseLimit .enableLimitSwitch (SmartDashboard .getBoolean ("Reverse Limit Enabled" , false ));
75
75
76
76
/**
77
- * The isPressed() method can be used on a SparkMaxLimitSwitch object to read the state of the switch.
77
+ * The isPressed() method can be used on a SparkLimitSwitch object to read the state of the switch.
78
78
*
79
79
* In this example, the polarity of the switches are set to normally closed. In this case,
80
80
* isPressed() will return true if the switch is pressed. It will also return true if you do not
0 commit comments