public class TiMQ extends Object implements ITiEventListener
Constructor and Description |
---|
TiMQ(TiGPIO gpio,
int signalPinID)
TiMQn initialization, without adc
|
TiMQ(TiGPIO gpio,
int signalPinID,
TiADC adc,
int analogChannelID)
TiMQn initialization, with adc
|
Modifier and Type | Method and Description |
---|---|
int |
getAnalogOutput()
Gets the analog output value of AOUT
|
int |
getDigitalOutput()
Gets the value of DOUT
|
long |
getEventTime()
Gets the event time
|
int |
getSignalPinID()
Gets the signal pin id
|
TiEventType |
getType()
the event type of the listener
|
boolean |
isGreaterThanThreshold()
Check if greater than the threshold value
|
void |
onEvent(ITiEvent evt)
triggered when the event occurs
|
void |
setEventListener(ITiMQEventListener lc)
Set the TiMQn event listener
|
public TiMQ(TiGPIO gpio, int signalPinID) throws IOException
gpio
- TiGPIO object[IN]signalPinID
- signal pin id[IN]IOException
public TiMQ(TiGPIO gpio, int signalPinID, TiADC adc, int analogChannelID) throws IOException
gpio
- TiGPIO object[IN]signalPinID
- signal pin id[IN]adc
- TiADC object[IN]analogChannelID
- analog channel id[IN]IOException
public int getAnalogOutput() throws IOException
IOException
public int getDigitalOutput() throws IOException
IOException
public long getEventTime()
public int getSignalPinID()
public TiEventType getType()
ITiEventListener
getType
in interface ITiEventListener
public boolean isGreaterThanThreshold() throws IOException
IOException
public void onEvent(ITiEvent evt)
ITiEventListener
onEvent
in interface ITiEventListener
evt
- event objectpublic void setEventListener(ITiMQEventListener lc) throws IOException
lc
- listener object or null[IN]IOException