public class TiGeneralSensor extends Object implements ITiEventListener
Constructor and Description |
---|
TiGeneralSensor(TiGPIO gpio,
int signalPinID)
TiGeneralSensor initialization, without adc
|
TiGeneralSensor(TiGPIO gpio,
int signalPinID,
TiADC adc,
int analogChannelID)
TiGeneralSensor 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
|
void |
onEvent(ITiEvent evt)
triggered when the event occurs
|
void |
setEventListener(ITiGeneralSensorEventListener lc)
Set the TiGeneralSensor event listener
|
public TiGeneralSensor(TiGPIO gpio, int signalPinID) throws IOException
gpio
- TiGPIO object[IN]signalPinID
- signal pin id[IN]analogChannelID
- analog channel id[IN]IOException
public TiGeneralSensor(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 void onEvent(ITiEvent evt)
ITiEventListener
onEvent
in interface ITiEventListener
evt
- event objectpublic void setEventListener(ITiGeneralSensorEventListener lc) throws IOException
lc
- listener object or null[IN]IOException