|
RobotCore 1.0
WPILib port to raspberry Pi
|
Public Member Functions | |
| BooleanEvent (EventLoop loop, BooleanSupplier signal) | |
| final boolean | getAsBoolean () |
| final void | ifHigh (Runnable action) |
| BooleanEvent | negate () |
| BooleanEvent | and (BooleanSupplier other) |
| BooleanEvent | or (BooleanSupplier other) |
| BooleanEvent | rising () |
| BooleanEvent | falling () |
| BooleanEvent | debounce (Time period) |
| BooleanEvent | debounce (double seconds) |
| BooleanEvent | debounce (Time period, Debouncer.DebounceType type) |
| BooleanEvent | debounce (double seconds, Debouncer.DebounceType type) |
Protected Attributes | |
| final EventLoop | m_loop |
This class provides an easy way to link actions to active high logic signals. Each object represents a digital signal to which callback actions can be bound using ifHigh(Runnable).
BooleanEvents can easily be composed for advanced functionality using and(BooleanSupplier), or(BooleanSupplier), and negate().
To get a new BooleanEvent that triggers when this one changes see falling() and rising().
Definition at line 27 of file BooleanEvent.java.
| org.wpilib.event.BooleanEvent.BooleanEvent | ( | EventLoop | loop, |
| BooleanSupplier | signal ) |
Creates a new event that is active when the condition is true.
| loop | the loop that polls this event. |
| signal | the digital signal represented by this object. |
Definition at line 42 of file BooleanEvent.java.
| BooleanEvent org.wpilib.event.BooleanEvent.and | ( | BooleanSupplier | other | ) |
Composes this event with another event, returning a new event that is active when both events are active.
The events must use the same event loop. If the events use different event loops, the composed signal won't update until both loops are polled.
| other | the event to compose with. |
Definition at line 106 of file BooleanEvent.java.
| BooleanEvent org.wpilib.event.BooleanEvent.debounce | ( | double | seconds | ) |
Creates a new debounced event from this event - it will become active when this event has been active for longer than the specified period.
| seconds | The debounce period in seconds. |
Definition at line 186 of file BooleanEvent.java.
| BooleanEvent org.wpilib.event.BooleanEvent.debounce | ( | double | seconds, |
| Debouncer.DebounceType | type ) |
Creates a new debounced event from this event - it will become active when this event has been active for longer than the specified period.
| seconds | The debounce period in seconds. |
| type | The debounce type. |
Definition at line 210 of file BooleanEvent.java.
| BooleanEvent org.wpilib.event.BooleanEvent.debounce | ( | Time | period | ) |
Creates a new debounced event from this event - it will become active when this event has been active for longer than the specified period.
| period | The debounce period. |
Definition at line 175 of file BooleanEvent.java.
| BooleanEvent org.wpilib.event.BooleanEvent.debounce | ( | Time | period, |
| Debouncer.DebounceType | type ) |
Creates a new debounced event from this event - it will become active when this event has been active for longer than the specified period.
| period | The debounce period. |
| type | The debounce type. |
Definition at line 198 of file BooleanEvent.java.
| BooleanEvent org.wpilib.event.BooleanEvent.falling | ( | ) |
Creates a new event that triggers when this one changes from true to false.
Definition at line 152 of file BooleanEvent.java.
| final boolean org.wpilib.event.BooleanEvent.getAsBoolean | ( | ) |
Returns the state of this signal (high or low) as of the last loop poll.
Definition at line 56 of file BooleanEvent.java.
| final void org.wpilib.event.BooleanEvent.ifHigh | ( | Runnable | action | ) |
Bind an action to this event.
| action | the action to run if this event is active. |
Definition at line 65 of file BooleanEvent.java.
| BooleanEvent org.wpilib.event.BooleanEvent.negate | ( | ) |
Creates a new event that is active when this event is inactive.
Definition at line 92 of file BooleanEvent.java.
| BooleanEvent org.wpilib.event.BooleanEvent.or | ( | BooleanSupplier | other | ) |
Composes this event with another event, returning a new event that is active when either event is active.
The events must use the same event loop. If the events use different event loops, the composed signal won't update until both loops are polled.
| other | the event to compose with. |
Definition at line 121 of file BooleanEvent.java.
| BooleanEvent org.wpilib.event.BooleanEvent.rising | ( | ) |
Creates a new event that triggers when this one changes from false to true.
Definition at line 131 of file BooleanEvent.java.
|
protected |
Poller loop.
Definition at line 29 of file BooleanEvent.java.