|
SunSPOT API V4.0 |
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
public interface ILightSensor
Simple extension of a scalar type input.
| Method Summary | |
|---|---|
void |
addILightSensorThresholdListener(ILightSensorThresholdListener who)
Adds the specified light sensor threshold listener to receive callbacks from this light sensor. |
int |
getAverageValue()
Take 17 readings, one every 1 msec and average them. |
int |
getAverageValue(int n)
To deal with light sources that change rapidly over time, such as fluorescent light bulbs, it is necessary to take multiple readings and average them. |
ILightSensorThresholdListener[] |
getILightSensorThresholdListeners()
Returns an array of all the light sensor threshold listeners registered on this light sensor. |
void |
removeILightSensorThresholdListener(ILightSensorThresholdListener who)
Removes the specified light sensor threshold listener so that it no longer receives callbacks from this light sensor. |
| Methods inherited from interface com.sun.spot.sensorboard.io.IScalarInput |
|---|
addIScalarInputThresholdListener, areThresholdEventsEnabled, enableThresholdEvents, getHighThreshold, getIndex, getIScalarInputThresholdListeners, getLowThreshold, getRange, getValue, removeIScalarInputThresholdListener, setThresholds, supportsThresholdEvents |
| Method Detail |
|---|
int getAverageValue(int n)
throws IOException
n - the number of readings to take.
IOException
int getAverageValue()
throws IOException
IOExceptionvoid addILightSensorThresholdListener(ILightSensorThresholdListener who)
who - the light sensor threshold listener to add.void removeILightSensorThresholdListener(ILightSensorThresholdListener who)
who - the light sensor threshold listener to remove.ILightSensorThresholdListener[] getILightSensorThresholdListeners()
|
SunSPOT API V4.0 |
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||