Sun SPOT API
Green Release  


com.sun.spot.sensorboard.io
Class BinaryScalar

java.lang.Object
  extended by com.sun.spot.sensorboard.io.BinaryScalar
All Implemented Interfaces:
IInputPin, IScalarInput

public class BinaryScalar
extends Object
implements IScalarInput, IInputPin

Class to allow using a ScalarInput as though it is an GPIO InputPin.

Author:
arshan

Constructor Summary
BinaryScalar(PinDescriptor idx, int r, IADCController cntrl)
          Constructor
 
Method Summary
 PinDescriptor getIndex()
           
 int getRange()
           
 int getValue()
           
 boolean isHigh()
           
 boolean isLow()
           
 void waitForChange()
          Blocks the caller waiting for a change.
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

BinaryScalar

public BinaryScalar(PinDescriptor idx,
                    int r,
                    IADCController cntrl)
Constructor

Parameters:
idx - Pin that
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

isLow

public boolean isLow()
Specified by:
isLow in interface IInputPin
Returns:
true if the input bit is low.

isHigh

public boolean isHigh()
Specified by:
isHigh in interface IInputPin
Returns:
true if the input bit is high.

waitForChange

public void waitForChange()
Description copied from interface: IInputPin
Blocks the caller waiting for a change.

Specified by:
waitForChange in interface IInputPin

getIndex

public PinDescriptor getIndex()

Sun SPOT API
Green Release  


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