Class AsyncDigitalInput
- java.lang.Object
-
- edu.wpi.first.wpilibj.InterruptableSensorBase
-
- edu.wpi.first.wpilibj.DigitalSource
-
- edu.wpi.first.wpilibj.DigitalInput
-
- io.github.frc5024.asynchal.sensors.AsyncDigitalInput
-
public class AsyncDigitalInput extends DigitalInput implements Pollable
An asynchronous wrapper forDigitalInput
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from class edu.wpi.first.wpilibj.InterruptableSensorBase
InterruptableSensorBase.WaitResult
-
-
Field Summary
-
Fields inherited from class edu.wpi.first.wpilibj.InterruptableSensorBase
m_interrupt, m_isSynchronousInterrupt
-
-
Constructor Summary
Constructors Constructor Description AsyncDigitalInput(int channel)
Create an instance of a Digital Input class.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
checkForUpdates()
Check for, and handle any updates since the last call.void
close()
void
registerReleaseCallback(java.lang.Runnable callback)
Register a callback function to be run when the input is pulled lowvoid
registerTriggerCallback(java.lang.Runnable callback)
Register a callback function to be run when the input is pulled high-
Methods inherited from class edu.wpi.first.wpilibj.DigitalInput
get, getAnalogTriggerTypeForRouting, getChannel, getPortHandleForRouting, initSendable, isAnalogTrigger, setSimDevice
-
Methods inherited from class edu.wpi.first.wpilibj.InterruptableSensorBase
allocateInterrupts, cancelInterrupts, disableInterrupts, enableInterrupts, readFallingTimestamp, readRisingTimestamp, requestInterrupts, requestInterrupts, requestInterrupts, setUpSourceEdge, waitForInterrupt, waitForInterrupt
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface edu.wpi.first.wpilibj.Sendable
addChild, getName, getSubsystem, setName, setName, setName, setName, setSubsystem
-
-
-
-
Method Detail
-
checkForUpdates
public void checkForUpdates()
Description copied from interface:Pollable
Check for, and handle any updates since the last call. This should only be called from the Poller- Specified by:
checkForUpdates
in interfacePollable
-
registerTriggerCallback
public void registerTriggerCallback(java.lang.Runnable callback)
Register a callback function to be run when the input is pulled high- Parameters:
callback
- Callback function
-
registerReleaseCallback
public void registerReleaseCallback(java.lang.Runnable callback)
Register a callback function to be run when the input is pulled low- Parameters:
callback
- Callback function
-
close
public void close()
- Specified by:
close
in interfacejava.lang.AutoCloseable
- Overrides:
close
in classDigitalInput
-
-