nanovm.nibo.drivers
Class DistanceSensor

java.lang.Object
  extended by nanovm.nibo.drivers.DistanceSensor

public class DistanceSensor
extends java.lang.Object

Encapsulates the information about the five IR-reflex-sensors. You will have to call the update Method first to get actual values.


Field Summary
static int FRONT
          ID of the front IR-sensor
static int LEFT
          ID of the left IR-sensor
static int LEFT_FRONT
          ID of the left front IR-sensor
static int MAXIMUM
          Maximum value from IR-sensor
static int MINIMUM
          Minimum value from IR-sensor
static int RIGHT
          ID of the right IR-sensor
static int RIGHT_FRONT
          ID of the right front IR-sensor
 
Constructor Summary
DistanceSensor()
           
 
Method Summary
static boolean getEnabled()
          get status of IR-reflex-sensors
static int getSensor(int sensor)
          get the value of the IR-reflex-sensor with the given ID
static void setEnabled(boolean enable)
          enable and disable the IR-reflex-sensors
static void update()
          update all values
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

MAXIMUM

public static final int MAXIMUM
Maximum value from IR-sensor

See Also:
Constant Field Values

MINIMUM

public static final int MINIMUM
Minimum value from IR-sensor

See Also:
Constant Field Values

LEFT

public static final int LEFT
ID of the left IR-sensor

See Also:
Constant Field Values

LEFT_FRONT

public static final int LEFT_FRONT
ID of the left front IR-sensor

See Also:
Constant Field Values

FRONT

public static final int FRONT
ID of the front IR-sensor

See Also:
Constant Field Values

RIGHT_FRONT

public static final int RIGHT_FRONT
ID of the right front IR-sensor

See Also:
Constant Field Values

RIGHT

public static final int RIGHT
ID of the right IR-sensor

See Also:
Constant Field Values
Constructor Detail

DistanceSensor

public DistanceSensor()
Method Detail

update

public static void update()
update all values


getSensor

public static int getSensor(int sensor)
get the value of the IR-reflex-sensor with the given ID

Parameters:
sensor - ID of the IR-sensor
Returns:
value of the IR-sensor

setEnabled

public static void setEnabled(boolean enable)
enable and disable the IR-reflex-sensors

Parameters:
enable - true to enable sensors

getEnabled

public static boolean getEnabled()
get status of IR-reflex-sensors

Returns:
true when sensors are enabled