Class AnalogInputEvent


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

      • 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 - the gpio number that this event is related to
        epochTime - time in milliseconds since Jan 1st 1970
        nanoTime - monotonic time in nanoseconds
        unscaledValue - initial value (unscaled)
    • Method Detail

      • 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