Class PollingBStream
java.lang.Object
com.stuypulse.stuylib.streams.booleans.PollingBStream
- All Implemented Interfaces:
BStream
,BooleanSupplier
A PollingBStream is a BStream but its .get() method is called for you at a certain rate. This is
really helpful when you want to read from a sensor using a debouncer, but you dont always call
.get() in your periodic loop. This will do that for you, and give you the most recent result. It
is not recommended to filter a PollingBStream as you should ideally filter before you poll.
-
Constructor Details
-
PollingBStream
Creates a PollingBStream from an BStream and a time value- Parameters:
stream
- BStream to poll fromdt
- time inbetween each poll
-
-
Method Details