Skip to content

Commit

Permalink
Update input.py (#786)
Browse files Browse the repository at this point in the history
  • Loading branch information
npentrel authored Nov 8, 2024
1 parent b630e05 commit 027cc89
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions src/viam/components/input/input.py
Original file line number Diff line number Diff line change
Expand Up @@ -156,7 +156,7 @@ async def get_controls(self, *, extra: Optional[Dict[str, Any]] = None, timeout:
# Get the controller from the machine.
my_controller = Controller.from_robot(
myRobotWithController, "my_controller")
robot=machine, "my_controller")
# Get the list of Controls provided by the controller.
controls = await my_controller.get_controls()
Expand All @@ -183,7 +183,7 @@ async def get_events(
# Get the controller from the machine.
my_controller = Controller.from_robot(
myRobotWithController, "my_controller")
robot=machine, "my_controller")
# Get the most recent Event for each Control.
recent_events = await my_controller.get_events()
Expand Down Expand Up @@ -247,7 +247,7 @@ async def main():
# Get your controller from the machine.
my_controller = Controller.from_robot(
myRobotWithController, "my_controller")
robot=machine, "my_controller")
# Run the handleController function.
await handle_controller(my_controller)
Expand Down Expand Up @@ -276,12 +276,13 @@ async def trigger_event(
"""Directly send an Event (such as a button press) from external code
::
my_controller = Controller.from_robot(
robot=machine, name="my_controller")
# Get your controller from the machine.
my_controller = Controller.from_robot(
myRobotWithController, "my_controller")
robot=machine, "my_controller")
# Define a "Button is Pressed" event for the control BUTTON_START.
button_is_pressed_event = Event(
Expand Down

0 comments on commit 027cc89

Please sign in to comment.