Skip to content

Add non-PWM examples #22

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 15 commits into from
Sep 16, 2020
4 changes: 2 additions & 2 deletions examples/limit-switch/robot.py
Original file line number Diff line number Diff line change
Expand Up @@ -65,10 +65,10 @@ def teleopPeriodic(self):
# pressed. It will also return true if you do not have a switch
# connected. get() will return false when the switch is released.
wpilib.SmartDashboard.putBoolean(
"Forward Limit Enabled", self.forwardLimit.get()
"Forward Limit Switch", self.forwardLimit.get()
)
wpilib.SmartDashboard.putBoolean(
"Reverse Limit Enabled", self.reverseLimit.get()
"Reverse Limit Switch", self.reverseLimit.get()
)


Expand Down
4 changes: 2 additions & 2 deletions examples/position-pid-control/robot.py
Original file line number Diff line number Diff line change
Expand Up @@ -109,8 +109,8 @@ def teleopPeriodic(self):
self.pidController.setReference(rotations, rev.ControlType.kPosition)

# Push Setpoint and the motor's current position to SmartDashboard.
wpilib.SmartDashboard.putNumber("Setpoint", rotations)
wpilib.SmartDashboard.putNumber("Process Variable", self.encoder.getPosition())
wpilib.SmartDashboard.putNumber("SetPoint", rotations)
wpilib.SmartDashboard.putNumber("ProcessVariable", self.encoder.getPosition())


if __name__ == "__main__":
Expand Down
6 changes: 3 additions & 3 deletions examples/velocity-pid-control/robot.py
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ def robotInit(self):
# configuration parameters in the SPARK MAX to their factory default
# state. If no argument is passed, these parameters will not persist
# between power cycles
self.motor.restoreFactoryDefaults()
# self.motor.restoreFactoryDefaults()

# Set PID Constants
self.pidController.setP(self.kP)
Expand Down Expand Up @@ -110,8 +110,8 @@ def teleopPeriodic(self):
self.pidController.setReference(setpoint, rev.ControlType.kVelocity)

# Push Setpoint and the motor's current velocity to SmartDashboard.
wpilib.SmartDashboard.putNumber("Setpoint", setpoint)
wpilib.SmartDashboard.putNumber("Process Variable", self.encoder.getVelocity())
wpilib.SmartDashboard.putNumber("SetPoint", setpoint)
wpilib.SmartDashboard.putNumber("ProcessVariable", self.encoder.getVelocity())


if __name__ == "__main__":
Expand Down