com.krisharris.mpk
Class AnalogIn

java.lang.Object
  extended by com.krisharris.mpk.AnalogIn

public class AnalogIn
extends java.lang.Object

Used for cacheing and calabrating the Analog inputs

Author:
kristopf

Constructor Summary
AnalogIn()
           
 
Method Summary
 float getFloatValue()
          If you've set calabration beware: this value COULD go below 0 or above 1.
 int getValue()
           
 void setCalabration(float min, float max)
          Sets the calabration for getFloatValue()
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

AnalogIn

public AnalogIn()
Method Detail

setCalabration

public void setCalabration(float min,
                           float max)
Sets the calabration for getFloatValue()

Parameters:
min - number in the range of (0..1023) repersenting the zero value
max - number in the range of (0..1023) repersenting the maximum value

getValue

public int getValue()
Returns:
the value of the analog in (0..1023)

getFloatValue

public float getFloatValue()
If you've set calabration beware: this value COULD go below 0 or above 1. If you have not it will be a floating point value (0...1) repersenting the state of the analog in