File tree Expand file tree Collapse file tree 5 files changed +13
-9
lines changed
HatchbotInlined/subsystems
HatchbotTraditional/subsystems Expand file tree Collapse file tree 5 files changed +13
-9
lines changed Original file line number Diff line number Diff line change @@ -19,7 +19,7 @@ def robotInit(self):
1919 """Robot initialization function"""
2020
2121 # Object for dealing with the Power Distribution Panel (PDP).
22- self .pdp = wpilib .PowerDistribution ()
22+ self .pdp = wpilib .PowerDistribution (0 )
2323
2424 # Put the PDP itself to the dashboard
2525 wpilib .SmartDashboard .putData ("PDP" , self .pdp )
Original file line number Diff line number Diff line change 88import wpilib
99import ntcore
1010
11+ CAN_BUS = 0
1112PNUE_MOD_TYPE = wpilib .PneumaticsModuleType .CTREPCM
1213
1314
@@ -18,10 +19,10 @@ class MyRobot(wpilib.TimedRobot):
1819
1920 def robotInit (self ):
2021 # A way of demonstrating the difference between the game data strings
21- self .blue = wpilib .Solenoid (PNUE_MOD_TYPE , 0 )
22- self .red = wpilib .Solenoid (PNUE_MOD_TYPE , 1 )
23- self .green = wpilib .Solenoid (PNUE_MOD_TYPE , 2 )
24- self .yellow = wpilib .Solenoid (PNUE_MOD_TYPE , 3 )
22+ self .blue = wpilib .Solenoid (CAN_BUS , PNUE_MOD_TYPE , 0 )
23+ self .red = wpilib .Solenoid (CAN_BUS , PNUE_MOD_TYPE , 1 )
24+ self .green = wpilib .Solenoid (CAN_BUS , PNUE_MOD_TYPE , 2 )
25+ self .yellow = wpilib .Solenoid (CAN_BUS , PNUE_MOD_TYPE , 3 )
2526 # Set game data to empty string by default
2627 self .gameData = ""
2728 # Get the SmartDashboard table from networktables
Original file line number Diff line number Diff line change @@ -16,9 +16,10 @@ def __init__(self) -> None:
1616 super ().__init__ ()
1717
1818 self .hatchSolenoid = wpilib .DoubleSolenoid (
19+ 0 ,
1920 constants .kHatchSolenoidModule ,
2021 constants .kHatchSolenoidModuleType ,
21- * constants .kHatchSolenoidPorts
22+ * constants .kHatchSolenoidPorts ,
2223 )
2324
2425 def grabHatch (self ) -> commands2 .Command :
Original file line number Diff line number Diff line change @@ -15,9 +15,10 @@ def __init__(self) -> None:
1515 super ().__init__ ()
1616
1717 self .hatchSolenoid = wpilib .DoubleSolenoid (
18+ 0 ,
1819 constants .kHatchSolenoidModule ,
1920 constants .kHatchSolenoidModuleType ,
20- * constants .kHatchSolenoidPorts
21+ * constants .kHatchSolenoidPorts ,
2122 )
2223
2324 def grabHatch (self ) -> None :
Original file line number Diff line number Diff line change @@ -28,19 +28,20 @@ def robotInit(self):
2828 # Solenoid corresponds to a single solenoid.
2929 # In this case, it's connected to channel 0 of a PH with the default CAN ID.
3030 self .solenoid = wpilib .Solenoid (
31- moduleType = wpilib .PneumaticsModuleType .REVPH , channel = 0
31+ busId = 0 , moduleType = wpilib .PneumaticsModuleType .REVPH , channel = 0
3232 )
3333
3434 # DoubleSolenoid corresponds to a double solenoid.
3535 # In this case, it's connected to channels 1 and 2 of a PH with the default CAN ID.
3636 self .doubleSolenoid = wpilib .DoubleSolenoid (
37+ busId = 0 ,
3738 moduleType = wpilib .PneumaticsModuleType .REVPH ,
3839 forwardChannel = 1 ,
3940 reverseChannel = 2 ,
4041 )
4142
4243 # Compressor connected to a PH with a default CAN ID (1)
43- self .compressor = wpilib .Compressor (wpilib .PneumaticsModuleType .REVPH )
44+ self .compressor = wpilib .Compressor (0 , wpilib .PneumaticsModuleType .REVPH )
4445
4546 self .kSolenoidButton = 1
4647 self .kDoubleSolenoidForwardButton = 2
You can’t perform that action at this time.
0 commit comments