Skip to content

Commit

Permalink
added functions
Browse files Browse the repository at this point in the history
  • Loading branch information
alexl1239 committed Aug 30, 2024
1 parent 868756d commit 6f1d79d
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 1 deletion.
1 change: 1 addition & 0 deletions config.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,5 +22,6 @@

arm_id_1 = 10 #placeholders
arm_id_2 = 11
arm_speed = 1

arm_CONFIG: TalonConfig = TalonConfig(0.5, 0, 0, 0, 0, brake_mode=True)
13 changes: 12 additions & 1 deletion subsystem/arm.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ def __init__(self):

self.motor: TalonFX = TalonFX(
can_id=config.arm_id_1,
config=config.arm_config,
config=config.arm_CONFIG,
inverted=False #placeholder
)

Expand All @@ -26,5 +26,16 @@ def init(self):
self.motor.init()
self.motor_follower.init()

self.motor_follwer.follow(self.motor, True)

def raise_arm(self):
self.motor.set_target_velocity(config.arm_speed)

def lower_arm(self):
self.motor.set_target_velocity(-config.arm_speed)

def stop_arm(self):
self.motor.set_target_velocity(-config.arm_speed)



0 comments on commit 6f1d79d

Please sign in to comment.