forked from caloisio/mentorbot
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #9 from 1757WestwoodRobotics/rev-modules
REV modules
- Loading branch information
Showing
18 changed files
with
825 additions
and
379 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,21 +1,19 @@ | ||
import typing | ||
from subsystems.hornsubsystem import HornSubsystem | ||
from commands2 import CommandBase | ||
|
||
|
||
class HornHonk(CommandBase): | ||
def __init__(self, horn: HornSubsystem, amount: typing.Callable[[], float]) -> None: | ||
def __init__(self, horn: HornSubsystem) -> None: | ||
CommandBase.__init__(self) | ||
self.horn = horn | ||
self.hornStrength = amount | ||
|
||
self.hornOutput = lambda strength: self.horn.horn.set(strength) | ||
|
||
self.setName(__class__.__name__) | ||
self.addRequirements([self.horn]) | ||
|
||
def execute(self) -> None: | ||
self.hornOutput(self.hornStrength()) | ||
self.hornOutput(1.0) | ||
|
||
def end(self, interrupted: bool) -> None: | ||
self.hornOutput(0.0) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.