public class TiButton extends Object implements ITiEventListener
| Constructor and Description |
|---|
TiButton(TiGPIO gpio,
int signalPinID)
TiButton initialization, default:highLevel=false
|
TiButton(TiGPIO gpio,
int signalPinID,
boolean highLevel)
TiButton initialization
|
| Modifier and Type | Method and Description |
|---|---|
long |
getEventTime()
Gets the event occur time, unit:us
|
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(ITiButtonEventListener lc)
Set the TiButton event listener
|
public TiButton(TiGPIO gpio, int signalPinID) throws IOException
gpio - TiGPIO object[IN]signalPinID - signal pin id[IN]IOExceptionpublic TiButton(TiGPIO gpio, int signalPinID, boolean highLevel) throws IOException
gpio - TiGPIO object[IN]signalPinID - signal pin id[IN]highLevel - true:high level active, false:low level active[IN]IOExceptionpublic long getEventTime()
public int getSignalPinID()
public TiEventType getType()
ITiEventListenergetType in interface ITiEventListenerpublic void onEvent(ITiEvent evt)
ITiEventListeneronEvent in interface ITiEventListenerevt - event objectpublic void setEventListener(ITiButtonEventListener lc) throws IOException
lc - listener or null[IN]IOException