Skip to content

Commit

Permalink
imported shooter component to robot.py and made an injecting button i…
Browse files Browse the repository at this point in the history
…n teleopperiodic
  • Loading branch information
fotnitfpro000 committed Jan 13, 2024
1 parent 2bbee83 commit b19a013
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions robot.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
import magicbot

from components.chassis import Chassis
from components.shooter import Shooter

from utilities.scalers import rescale_js

Expand All @@ -14,6 +15,7 @@ class MyRobot(magicbot.MagicRobot):

# Components
chassis: Chassis
shooter: Shooter

max_speed = magicbot.tunable(Chassis.max_wheel_speed * 0.95)

Expand Down Expand Up @@ -60,6 +62,10 @@ def teleopPeriodic(self) -> None:
if self.rumble_timer.hasElapsed(self.rumble_duration):
self.gamepad.setRumble(wpilib.XboxController.RumbleType.kBothRumble, 0)

# injecting
if self.gamepad.getBButton():
self.shooter.inject()

def testInit(self) -> None:
pass

Expand Down

0 comments on commit b19a013

Please sign in to comment.