|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
cork.module.sharp.GP2D15
Driver for the Sharp GP2D15 IR Proximity detector.
Constructor Summary | |
GP2D15(com.ajile.drivers.gpio.GpioPin pin)
Constructor for the GP2D15 object |
|
GP2D15(com.ajile.drivers.gpio.GpioPin pin,
int index)
Constructor for the GP2D15 object |
Method Summary | |
void |
addListener(DeviceEventListener listener)
Adds a listener to the GP2D15 object. |
void |
assertEvent(boolean active)
Used internally to signal a device event when the sensors logic leve changes. |
java.lang.String |
getDeviceDestription()
Gets the destription attribute of the Device object |
java.lang.String |
getDeviceName()
Gets the title attribute of the Device object |
int |
getIndex()
Returns the index of the device. |
com.ajile.drivers.gpio.GpioPin |
getIOPin()
Gets the GPIO pin that the divice is attached to. |
boolean |
isObjectDetected()
Tests the state of the device. |
void |
removeListener(DeviceEventListener listener)
Removes a listener to the GP2D15 object. |
void |
setIndex(int index)
Sets the index of the device. |
Constructor Detail |
public GP2D15(com.ajile.drivers.gpio.GpioPin pin)
pin
- com.ajile.drivers.gpio.GpioPin the GPIO pin that the device is
connected to.public GP2D15(com.ajile.drivers.gpio.GpioPin pin, int index)
pin
- com.ajile.drivers.gpio.GpioPin the GPIO pin that the device is
connected to.index
- int This is used when there are multiple devices in the
system, to differentiate devices in the event model.Method Detail |
public void assertEvent(boolean active)
active
- boolean logic state of the devicepublic void addListener(DeviceEventListener listener)
listener
- cork.event.DeviceEventListener the listener who will listen
for changed in teh device.public void removeListener(DeviceEventListener listener)
listener
- cork.event.DeviceEventListener the listener who was
listening for changed in teh device.public boolean isObjectDetected()
public com.ajile.drivers.gpio.GpioPin getIOPin()
public int getIndex()
public java.lang.String getDeviceName()
getDeviceName
in interface Device
public java.lang.String getDeviceDestription()
getDeviceDestription
in interface Device
public void setIndex(int index)
index
- int the new index value
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |