Class RCXRotationSensor.Reader

  • All Implemented Interfaces:
    java.lang.Runnable
    Enclosing class:
    RCXRotationSensor

    protected class RCXRotationSensor.Reader
    extends java.lang.Thread
    • Nested Class Summary

      • Nested classes/interfaces inherited from class java.lang.Thread

        java.lang.Thread.State, java.lang.Thread.UncaughtExceptionHandler
    • Field Summary

      • Fields inherited from class java.lang.Thread

        MAX_PRIORITY, MIN_PRIORITY, NORM_PRIORITY
    • Constructor Summary

      Constructors 
      Modifier Constructor Description
      protected Reader()  
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      void run()
      Sensor reader thread.
      • Methods inherited from class java.lang.Thread

        activeCount, checkAccess, clone, countStackFrames, currentThread, dumpStack, enumerate, getAllStackTraces, getContextClassLoader, getDefaultUncaughtExceptionHandler, getId, getName, getPriority, getStackTrace, getState, getThreadGroup, getUncaughtExceptionHandler, holdsLock, interrupt, interrupted, isAlive, isDaemon, isInterrupted, join, join, join, onSpinWait, resume, setContextClassLoader, setDaemon, setDefaultUncaughtExceptionHandler, setName, setPriority, setUncaughtExceptionHandler, sleep, sleep, start, stop, suspend, toString, yield
      • Methods inherited from class java.lang.Object

        equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
    • Constructor Detail

      • Reader

        protected 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 java.lang.Runnable
        Overrides:
        run in class java.lang.Thread