mirror of
https://github.com/wpilibsuite/allwpilib
synced 2026-06-22 01:11:42 +00:00
Looks like a race condition happened in the landing of the examples PR and #8479 which caused some of the python examples to fail.
This commit is contained in:
@@ -20,17 +20,17 @@ class Intake:
|
||||
)
|
||||
|
||||
def deploy(self) -> None:
|
||||
self.piston.set(wpilib.DoubleSolenoid.Value.kForward)
|
||||
self.piston.setDutyCycle(wpilib.DoubleSolenoid.Value.kForward)
|
||||
|
||||
def retract(self) -> None:
|
||||
self.piston.set(wpilib.DoubleSolenoid.Value.kReverse)
|
||||
self.motor.set(0) # turn off the motor
|
||||
self.piston.setDutyCycle(wpilib.DoubleSolenoid.Value.kReverse)
|
||||
self.motor.setDutyCycle(0) # turn off the motor
|
||||
|
||||
def activate(self, velocity: float) -> None:
|
||||
if self.isDeployed():
|
||||
self.motor.set(velocity)
|
||||
self.motor.setDutyCycle(velocity)
|
||||
else: # if piston isn't open, do nothing
|
||||
self.motor.set(0)
|
||||
self.motor.setDutyCycle(0)
|
||||
|
||||
def isDeployed(self) -> bool:
|
||||
return self.piston.get() == wpilib.DoubleSolenoid.Value.kForward
|
||||
|
||||
Reference in New Issue
Block a user