Skip to content

Commit

Permalink
refactor: update 'CANSparkMax' class name to 'SparkMax', and its low …
Browse files Browse the repository at this point in the history
…level property
  • Loading branch information
megarubber committed Jan 23, 2025
1 parent d588ad2 commit 97371df
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 6 deletions.
8 changes: 4 additions & 4 deletions autonomous-navX-neo-with-spark/robot.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,11 +10,11 @@ class MyRobot(wpilib.TimedRobot):
def robotInit(self):
"""Robot initialization function"""
# creating spark max like encoders in setup
self.sparkMaxEncoderLeft = rev.CANSparkMax(
52, rev.CANSparkMax.MotorType.kBrushless
self.sparkMaxEncoderLeft = rev.SparkMax(
52, rev.SparkLowLevel.MotorType.kBrushless
)
self.sparkMaxEnocderRight = rev.CANSparkMax(
51, rev.CANSparkMax.MotorType.kBrushless
self.sparkMaxEnocderRight = rev.SparkMax(
51, rev.SparkLowLevel.MotorType.kBrushless
)
# create navX to my robot
self.navx = AHRS.create_spi()
Expand Down
2 changes: 1 addition & 1 deletion max-neo-encoder/robot.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
class MyRobot(wpilib.TimedRobot):
def robotInit(self):
"""Robot initialization function"""
self.motor = rev.CANSparkMax(52, rev.CANSparkMax.MotorType.kBrushless)
self.motor = rev.SparkMax(52, rev.SparkLowLevel.MotorType.kBrushless)

# Configure the encoder
self.encoder = self.motor.getEncoder()
Expand Down
2 changes: 1 addition & 1 deletion neo-motor/robot.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ class MyRobot(wpilib.TimedRobot):
def robotInit(self):
"""Robot initialization function"""

self.rev_motor = rev.CANSparkMax(CAN_ID, rev.CANSparkMax.MotorType.kBrushless)
self.rev_motor = rev.SparkMax(CAN_ID, rev.SparkLowLevel.MotorType.kBrushless)
self.pid_controller = self.rev_motor.getPIDController()

Kp, Ki, Kd = (0.1, 0, 0.1)
Expand Down

0 comments on commit 97371df

Please sign in to comment.