SunSPOT API V2.0


com.sun.spot.sensorboard.io
Class ScalarInput

java.lang.Object
  extended by com.sun.spot.sensorboard.io.ScalarInput
All Implemented Interfaces:
IScalarInput
Direct Known Subclasses:
LightSensor

public class ScalarInput
extends Object
implements IScalarInput

simple concrete implementation of IScalarInput.


Constructor Summary
ScalarInput(PinDescriptor idx, int r, IADCController cntrl)
           
 
Method Summary
 int getRange()
           
 int getValue()
           
 float getVoltage()
          Get the ADC value in voltage
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ScalarInput

public ScalarInput(PinDescriptor idx,
                   int r,
                   IADCController cntrl)
Method Detail

getValue

public int getValue()
Specified by:
getValue in interface IScalarInput
Returns:
current value of the input

getRange

public int getRange()
             throws IOException
Specified by:
getRange in interface IScalarInput
Returns:
maximum possible value that could be returned from the input device
Throws:
IOException

getVoltage

public float getVoltage()
Get the ADC value in voltage

Returns:
Voltage applied to the ADC pin.

SunSPOT API V2.0


Copyright © 2007 Sun Microsystems, Inc. All Rights Reserved.