|
SunSPOT API V6.0 |
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectcom.sun.spot.resources.Resource
com.sun.spot.sensorboard.io.AnalogInput
public class AnalogInput
Simple implementation of IAnalogInput.
Note: By default the maximum rate that a scalar input can be read is ~58 Hz, i.e. reading it every 17.1 milliseconds. For faster readings the ADT7411 must be set to use its fast conversion rate that will allow reading every 0.579 milliseconds (or 1667 Hz). Note that setting the ADT7411 to fast mode may cause readings of A0 to become inaccurate.
| Field Summary | |
|---|---|
protected PinDescriptor |
index
|
protected IADCController |
myController
|
| Constructor Summary | |
|---|---|
AnalogInput(PinDescriptor idx,
IADCController cntrl)
|
|
| Method Summary | |
|---|---|
SensorEvent |
createSensorEvent()
Create a SensorEvent of the appropriate type for this sensor. |
double |
getAccuracy()
Returns the accuracy of the sensor (in the current measurement range) as a percentage of reading (=data value). |
String |
getDescription()
This method returns a readable description of the sensor. |
PinDescriptor |
getIndex()
Return the PinDescriptor associated with this input pin. |
double |
getMaxSamplingRate()
Return the maximum sampling rate per second for this sensor. |
double |
getMaxValue()
Returns the current maximum value of the sensor (in the current measurement range). |
double |
getMinValue()
Returns the current minimum value of the sensor (in the current measurement range). |
double |
getResolution()
Returns the resolution of the range (in the current measurement range). |
double |
getVoltage()
Get the ADC value in voltage |
void |
saveEventState(SensorEvent evt)
Save the current sensor state in the specified event. |
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 |
|---|
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Methods inherited from interface com.sun.spot.resources.IResource |
|---|
addTag, getTags, getTagValue, hasTag, removeTag |
| Field Detail |
|---|
protected PinDescriptor index
protected IADCController myController
| Constructor Detail |
|---|
public AnalogInput(PinDescriptor idx,
IADCController cntrl)
| Method Detail |
|---|
public String toString()
toString in class Objectpublic PinDescriptor getIndex()
getIndex in interface IBasicPinpublic double getVoltage()
getVoltage in interface IAnalogInputpublic String getDescription()
ITransducer
getDescription in interface ITransducerpublic double getMaxSamplingRate()
ITransducer
getMaxSamplingRate in interface ITransducerpublic double getMinValue()
IMeasurementInfo
getMinValue in interface IMeasurementInfopublic double getMaxValue()
IMeasurementInfo
getMaxValue in interface IMeasurementInfopublic double getResolution()
IMeasurementInfo
getResolution in interface IMeasurementInfopublic double getAccuracy()
IMeasurementInfo
getAccuracy in interface IMeasurementInfopublic SensorEvent createSensorEvent()
ITransducer
createSensorEvent in interface ITransducerpublic void saveEventState(SensorEvent evt)
ITransducer
saveEventState in interface ITransducerevt - the event to store the sensor state in
|
SunSPOT API V6.0 |
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||