mirror of
https://github.com/wpilibsuite/allwpilib
synced 2026-06-19 00:41:43 +00:00
[wpilib] Rename PneumaticsModuleType constants
This commit is contained in:
@@ -30,7 +30,7 @@ kWheelDiameterInches = 6
|
||||
kEncoderDistancePerPulse = (kWheelDiameterInches * math.pi) / kEncoderCPR
|
||||
|
||||
# Hatch
|
||||
kHatchSolenoidModuleType = wpilib.PneumaticsModuleType.CTREPCM
|
||||
kHatchSolenoidModuleType = wpilib.PneumaticsModuleType.CTRE_PCM
|
||||
kHatchSolenoidModule = 0
|
||||
kHatchSolenoidPorts = (0, 1)
|
||||
|
||||
|
||||
@@ -30,7 +30,7 @@ kWheelDiameterInches = 6
|
||||
kEncoderDistancePerPulse = (kWheelDiameterInches * math.pi) / kEncoderCPR
|
||||
|
||||
# Hatch
|
||||
kHatchSolenoidModuleType = wpilib.PneumaticsModuleType.CTREPCM
|
||||
kHatchSolenoidModuleType = wpilib.PneumaticsModuleType.CTRE_PCM
|
||||
kHatchSolenoidModule = 0
|
||||
kHatchSolenoidPorts = (0, 1)
|
||||
|
||||
|
||||
@@ -18,7 +18,7 @@ class Intake(Subsystem):
|
||||
# Double solenoid connected to two channels of a PCM with the default CAN ID
|
||||
self.pistons = wpilib.DoubleSolenoid(
|
||||
0,
|
||||
wpilib.PneumaticsModuleType.CTREPCM,
|
||||
wpilib.PneumaticsModuleType.CTRE_PCM,
|
||||
IntakeConstants.kSolenoidPorts[0],
|
||||
IntakeConstants.kSolenoidPorts[1],
|
||||
)
|
||||
|
||||
@@ -29,7 +29,7 @@ class Pneumatics(Subsystem):
|
||||
)
|
||||
|
||||
# Compressor connected to a PCM with a default CAN ID (0)
|
||||
self.compressor = wpilib.Compressor(0, wpilib.PneumaticsModuleType.CTREPCM)
|
||||
self.compressor = wpilib.Compressor(0, wpilib.PneumaticsModuleType.CTRE_PCM)
|
||||
|
||||
def getPressure(self) -> float:
|
||||
"""Query the analog pressure sensor.
|
||||
|
||||
@@ -33,21 +33,21 @@ class MyRobot(wpilib.TimedRobot):
|
||||
# Solenoid corresponds to a single solenoid.
|
||||
# In this case, it's connected to channel 0 of a PH with the default CAN ID.
|
||||
self.solenoid = wpilib.Solenoid(
|
||||
busId=0, moduleType=wpilib.PneumaticsModuleType.REVPH, channel=0
|
||||
busId=0, moduleType=wpilib.PneumaticsModuleType.REV_PH, channel=0
|
||||
)
|
||||
|
||||
# DoubleSolenoid corresponds to a double solenoid.
|
||||
# In this case, it's connected to channels 1 and 2 of a PH with the default CAN ID.
|
||||
self.doubleSolenoid = wpilib.DoubleSolenoid(
|
||||
busId=0,
|
||||
moduleType=wpilib.PneumaticsModuleType.REVPH,
|
||||
moduleType=wpilib.PneumaticsModuleType.REV_PH,
|
||||
forwardChannel=1,
|
||||
reverseChannel=2,
|
||||
)
|
||||
|
||||
# Compressor connected to a PH with a default CAN ID (1)
|
||||
self.compressor = wpilib.Compressor(
|
||||
busId=0, moduleType=wpilib.PneumaticsModuleType.REVPH
|
||||
busId=0, moduleType=wpilib.PneumaticsModuleType.REV_PH
|
||||
)
|
||||
|
||||
# Publish elements to dashboard.
|
||||
|
||||
@@ -14,7 +14,7 @@ class Intake:
|
||||
self.motor = wpilib.PWMSparkMax(IntakeConstants.MOTOR_PORT)
|
||||
self.piston = wpilib.DoubleSolenoid(
|
||||
0,
|
||||
wpilib.PneumaticsModuleType.CTREPCM,
|
||||
wpilib.PneumaticsModuleType.CTRE_PCM,
|
||||
IntakeConstants.PISTON_FWD_CHANNEL,
|
||||
IntakeConstants.PISTON_REV_CHANNEL,
|
||||
)
|
||||
|
||||
Reference in New Issue
Block a user