Class AnalogInputEvent


public class AnalogInputEvent
extends DeviceEvent
Represents an input event from an analog device.
  • Constructor Details

    • AnalogInputEvent

      public AnalogInputEvent​(int gpio, long epochTime, long nanoTime, float unscaledValue)
      Constructs an input event from an analog device. See (@link com.diozero.api.DeviceEvent} for first 3 parameters.
      Parameters:
      gpio -
      epochTime -
      nanoTime -
      unscaledValue - initial value (unscaled)
  • Method Details

    • getRange

      public float getRange()
      Get the maximum scaled value for the analog input device that generated this event
      Returns:
      the maximum scaled value
    • getUnscaledValue

      public float getUnscaledValue()
      Value from -1..1
      Returns:
      the unscaled value
    • getScaledValue

      public float getScaledValue()
      Value from -range..range
      Returns:
      the scaled value
    • toString

      public String toString()
      Overrides:
      toString in class Object