public abstract class Trigger extends Object implements Sendable
get()
method to get the full functionality
of the Trigger class.Modifier and Type | Class and Description |
---|---|
class |
Trigger.ButtonScheduler
An internal class of
Trigger . |
Constructor and Description |
---|
Trigger() |
Modifier and Type | Method and Description |
---|---|
void |
cancelWhenActive(Command command)
Cancels a command when the trigger becomes active
|
abstract boolean |
get()
Returns whether or not the trigger is active
This method will be called repeatedly a command is linked to the Trigger.
|
String |
getSmartDashboardType()
These methods continue to return the "Button" SmartDashboard type until we decided
to create a Trigger widget type for the dashboard.
|
edu.wpi.first.wpilibj.tables.ITable |
getTable() |
void |
initTable(edu.wpi.first.wpilibj.tables.ITable table)
Initializes a table for this sendable object.
|
void |
toggleWhenActive(Command command)
Toggles a command when the trigger becomes active
|
void |
whenActive(Command command)
Starts the given command whenever the trigger just becomes active.
|
void |
whenInactive(Command command)
Starts the command when the trigger becomes inactive
|
void |
whileActive(Command command)
Constantly starts the given command while the button is held.
|
public abstract boolean get()
public void whenActive(Command command)
command
- the command to startpublic void whileActive(Command command)
Command.start()
will be called repeatedly while the trigger is active,
and will be canceled when the trigger becomes inactive.command
- the command to startpublic void whenInactive(Command command)
command
- the command to startpublic void toggleWhenActive(Command command)
command
- the command to togglepublic void cancelWhenActive(Command command)
command
- the command to cancelpublic String getSmartDashboardType()
getSmartDashboardType
in interface Sendable
public void initTable(edu.wpi.first.wpilibj.tables.ITable table)
Sendable
Copyright © 2015. All rights reserved.