SunSPOT API V6.0


com.sun.spot.sensorboard.io
Class OutputPin

java.lang.Object
  extended by com.sun.spot.resources.Resource
      extended by com.sun.spot.sensorboard.io.OutputPin
All Implemented Interfaces:
IResource, IOutputPin, ITransducer, IBasicPin

public class OutputPin
extends Resource
implements IBasicPin, IOutputPin, IOutputPin

Accessor object for output only GPIO pins.


Constructor Summary
OutputPin(PinDescriptor idx, IGPIOController cntrl)
          Do not call: for internal use only.
 
Method Summary
 SensorEvent createSensorEvent()
          Create a SensorEvent of the appropriate type for this sensor.
 boolean equals(Object obj)
          Indicates whether some other object is "equal to" this output pin.
 String getDescription()
          This method returns a readable description of the sensor.
 PinDescriptor getIndex()
          Return the PinDescriptor for this pin.
 double getMaxSamplingRate()
          Return the maximum sampling rate per second for this sensor.
 boolean getState()
          Return the current state of this pin.
 int hashCode()
          Returns a hash code value for the object.
 void saveEventState(SensorEvent evt)
          Save the current sensor state in the specified event.
 void setHigh()
          Set the value of this pin to high.
 void setHigh(boolean high)
          Set the value of this pin.
 void setLow()
          Set the value of this pin to low.
 String toString()
          Return the name of this pin
 
Methods inherited from class com.sun.spot.resources.Resource
addTag, getTags, getTagValue, hasTag, removeTag
 
Methods inherited from class java.lang.Object
getClass, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface com.sun.spot.resources.IResource
addTag, getTags, getTagValue, hasTag, removeTag
 

Constructor Detail

OutputPin

public OutputPin(PinDescriptor idx,
                 IGPIOController cntrl)
Do not call: for internal use only. Use EDemoBoard#getOutputPins() to get an array of all available high current output pins: H0-H3. Use EDemoBoard#getIOPins() to get an array of all available bidirectional digital pins: D0-D4.

Method Detail

toString

public String toString()
Return the name of this pin

Overrides:
toString in class Object
Returns:
the name of this pin

getIndex

public PinDescriptor getIndex()
Return the PinDescriptor for this pin.

Specified by:
getIndex in interface IBasicPin
Returns:
PinDescriptor for this output

setHigh

public void setHigh()
Set the value of this pin to high.

Specified by:
setHigh in interface IOutputPin

setLow

public void setLow()
Set the value of this pin to low.

Specified by:
setLow in interface IOutputPin

setHigh

public void setHigh(boolean high)
Set the value of this pin.

Specified by:
setHigh in interface IOutputPin
Parameters:
high - if true then pin is set to high

getState

public boolean getState()
Return the current state of this pin.

Specified by:
getState in interface IOutputPin
Returns:
current state of this pin

equals

public boolean equals(Object obj)
Indicates whether some other object is "equal to" this output pin.

Overrides:
equals in class Object
Parameters:
obj - the reference object with which to compare.
Returns:
true if this output pin is the same as the obj argument; false otherwise.
See Also:
Boolean.hashCode(), Hashtable

hashCode

public int hashCode()
Returns a hash code value for the object.

Overrides:
hashCode in class Object
Returns:
a hash code value for this object.
See Also:
Object.equals(java.lang.Object), Hashtable

getDescription

public String getDescription()
Description copied from interface: ITransducer
This method returns a readable description of the sensor. The description should tell the essentials of the sensor, including at least the sensor type (accelerometer, microphone, thermometer). The returned string MUST not be null or an empty string.

Specified by:
getDescription in interface ITransducer
Returns:
the description of the sensor

getMaxSamplingRate

public double getMaxSamplingRate()
Description copied from interface: ITransducer
Return the maximum sampling rate per second for this sensor.

Specified by:
getMaxSamplingRate in interface ITransducer
Returns:
the maximum sampling rate per second for this sensor or 0 if not applicable.

createSensorEvent

public SensorEvent createSensorEvent()
Description copied from interface: ITransducer
Create a SensorEvent of the appropriate type for this sensor.

Specified by:
createSensorEvent in interface ITransducer
Returns:
a SensorEvent of the appropriate type for this sensor.

saveEventState

public void saveEventState(SensorEvent evt)
Description copied from interface: ITransducer
Save the current sensor state in the specified event.

Specified by:
saveEventState in interface ITransducer
Parameters:
evt - the event to store the sensor state in

SunSPOT API V6.0


Copyright © 2006-2010 Oracle. All Rights Reserved.