lejos.nxt.addon
Class RCXRotationSensor.Reader

java.lang.Object
  extended by java.lang.Thread
      extended by lejos.nxt.addon.RCXRotationSensor.Reader
All Implemented Interfaces:
Runnable
Enclosing class:
RCXRotationSensor

protected class RCXRotationSensor.Reader
extends Thread


Field Summary
 
Fields inherited from class java.lang.Thread
MAX_PRIORITY, MIN_PRIORITY, NORM_PRIORITY
 
Constructor Summary
protected RCXRotationSensor.Reader()
           
 
Method Summary
 void run()
          Sensor reader thread.
 
Methods inherited from class java.lang.Thread
currentThread, getPriority, interrupt, interrupted, isAlive, isDaemon, isInterrupted, join, join, setDaemon, setPriority, sleep, start, yield
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

RCXRotationSensor.Reader

protected RCXRotationSensor.Reader()
Method Detail

run

public void run()
Sensor reader thread. Reads the current phase of the sensor and computes the new count. NOTE: There is a problem with this sensor when a read spans the point at which the sensor output changes from one value to another. The result of this can be a "ghost value". For instance if the read occurs when moving from state 2 to state 0 then a false reading of state 1 may be read. To reduce this problem a new state is not accepted until two consecutive reads return the same state.

Specified by:
run in interface Runnable
Overrides:
run in class Thread