SunSPOT API V6.0


com.sun.spot.sensorboard.peripheral
Interface ILightSensor

All Superinterfaces:
ILightSensor, IResource, IScalarInput, ITransducer

Deprecated. Use ILightSensor instead

public interface ILightSensor
extends IScalarInput, ILightSensor

Simple extension of a scalar type input.

Author:
arshan & Ron Goldman

Method Summary
 void addILightSensorThresholdListener(ILightSensorThresholdListener who)
          Deprecated. Adds the specified light sensor threshold listener to receive callbacks from this light sensor.
 int getAverageValue()
          Deprecated. Take 17 readings, one every 1 msec and average them.
 int getAverageValue(int n)
          Deprecated. 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()
          Deprecated. Returns an array of all the light sensor threshold listeners registered on this light sensor.
 void removeILightSensorThresholdListener(ILightSensorThresholdListener who)
          Deprecated. 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
 
Methods inherited from interface com.sun.spot.resources.transducers.ITransducer
createSensorEvent, getDescription, getMaxSamplingRate, saveEventState
 
Methods inherited from interface com.sun.spot.resources.IResource
addTag, getTags, getTagValue, hasTag, removeTag
 
Methods inherited from interface com.sun.spot.resources.transducers.ILightSensor
getValue
 
Methods inherited from interface com.sun.spot.resources.transducers.ITransducer
createSensorEvent, getDescription, getMaxSamplingRate, saveEventState
 
Methods inherited from interface com.sun.spot.resources.IResource
addTag, getTags, getTagValue, hasTag, removeTag
 

Method Detail

getAverageValue

int getAverageValue(int n)
                    throws IOException
Deprecated. 
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. This method sleeps for 1 millisecond between readings. At least one reading is always taken, even if n <= 0.

Specified by:
getAverageValue in interface ILightSensor
Parameters:
n - the number of readings to take.
Returns:
the averaged light intensity.
Throws:
IOException

getAverageValue

int getAverageValue()
                    throws IOException
Deprecated. 
Take 17 readings, one every 1 msec and average them. Equivalent to getAverageValue(17);

Specified by:
getAverageValue in interface ILightSensor
Returns:
the averaged light intensity.
Throws:
IOException

addILightSensorThresholdListener

void addILightSensorThresholdListener(ILightSensorThresholdListener who)
Deprecated. 
Adds the specified light sensor threshold listener to receive callbacks from this light sensor. Callbacks occur when the light sensor reading falls below or equal to the low threshold value, or when it rises above or equal to the high threshold value.

Parameters:
who - the light sensor threshold listener to add.

removeILightSensorThresholdListener

void removeILightSensorThresholdListener(ILightSensorThresholdListener who)
Deprecated. 
Removes the specified light sensor threshold listener so that it no longer receives callbacks from this light sensor. This method performs no function, nor does it throw an exception, if the listener specified by the argument was not previously added to this light sensor.

Parameters:
who - the light sensor threshold listener to remove.

getILightSensorThresholdListeners

ILightSensorThresholdListener[] getILightSensorThresholdListeners()
Deprecated. 
Returns an array of all the light sensor threshold listeners registered on this light sensor.

Returns:
all of this light sensor's ILightSensorThresholdListener or an empty array if no light sensor threshold listeners are currently registered.

SunSPOT API V6.0


Copyright © 2006-2010 Oracle. All Rights Reserved.