public class AnalogTrigger extends SensorBase implements Sendable
Modifier and Type | Class and Description |
---|---|
class |
AnalogTrigger.AnalogTriggerException
Exceptions dealing with improper operation of the Analog trigger.
|
Modifier and Type | Field and Description |
---|---|
protected AnalogInput |
m_analogInput |
protected int |
m_index |
protected boolean |
m_ownsAnalog |
protected int |
m_port
Where the analog trigger is attached.
|
kAnalogInputChannels, kAnalogOutputChannels, kDigitalChannels, kPCMModules, kPDPChannels, kPDPModules, kPwmChannels, kRelayChannels, kSolenoidChannels, kSystemClockTicksPerMicrosecond
Constructor and Description |
---|
AnalogTrigger(AnalogInput channel)
Construct an analog trigger given an analog channel.
|
AnalogTrigger(int channel)
Constructor for an analog trigger given a channel number.
|
Modifier and Type | Method and Description |
---|---|
AnalogTriggerOutput |
createOutput(AnalogTriggerOutput.AnalogTriggerType type)
Creates an AnalogTriggerOutput object.
|
void |
free()
Release the resources used by this object.
|
int |
getIndex()
Return the index of the analog trigger.
|
boolean |
getInWindow()
Return the InWindow output of the analog trigger.
|
boolean |
getTriggerState()
Return the TriggerState output of the analog trigger.
|
void |
initSendable(SendableBuilder builder)
Initializes this
Sendable object. |
void |
setAveraged(boolean useAveragedValue)
Configure the analog trigger to use the averaged vs.
|
void |
setFiltered(boolean useFilteredValue)
Configure the analog trigger to use a filtered value.
|
void |
setLimitsRaw(int lower,
int upper)
Set the upper and lower limits of the analog trigger.
|
void |
setLimitsVoltage(double lower,
double upper)
Set the upper and lower limits of the analog trigger.
|
checkAnalogInputChannel, checkAnalogOutputChannel, checkDigitalChannel, checkPDPChannel, checkPDPModule, checkPWMChannel, checkRelayChannel, checkSolenoidChannel, checkSolenoidModule, getDefaultSolenoidModule, setDefaultSolenoidModule
addChild, getName, getSubsystem, setName, setName, setName, setSubsystem
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
getName, getSubsystem, setName, setName, setSubsystem
protected int m_port
protected int m_index
protected AnalogInput m_analogInput
protected boolean m_ownsAnalog
public AnalogTrigger(int channel)
channel
- the port to use for the analog triggerpublic AnalogTrigger(AnalogInput channel)
channel
- the AnalogInput to use for the analog triggerpublic void free()
free
in class SendableBase
public void setLimitsRaw(int lower, int upper)
lower
- the lower raw limitupper
- the upper raw limitpublic void setLimitsVoltage(double lower, double upper)
lower
- the lower voltage limitupper
- the upper voltage limitpublic void setAveraged(boolean useAveragedValue)
useAveragedValue
- true to use an averaged value, false otherwisepublic void setFiltered(boolean useFilteredValue)
useFilteredValue
- true to use a filtered value, false otherwisepublic int getIndex()
public boolean getInWindow()
public boolean getTriggerState()
public AnalogTriggerOutput createOutput(AnalogTriggerOutput.AnalogTriggerType type)
type
- An enum of the type of output object to create.public void initSendable(SendableBuilder builder)
Sendable
Sendable
object.initSendable
in interface Sendable
builder
- sendable builder