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]IOException
public 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]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(ITiButtonEventListener lc) throws IOException
lc
- listener or null[IN]IOException