/** * Get the requested analog input pin's conversion value. * @param pin to get conversion values for * @return analog input pin value in Volt */ public double getAnalogValue(GpioPinAnalogInput pin) { return getAnalogValue(pin.getPin()); }
/** * Get the current value in a percentage of the available range instead of a raw value. * * @return percentage value between 0 and 100. */ public float getPercentValue(GpioPinAnalogInput pin){ return getPercentValue(pin.getPin()); }
/** * This method will perform an immediate data acquisition directly to the ADC chip to get the * requested pin's input conversion value. * * @param pin requested input pin to acquire conversion value * @return conversion value for requested analog input pin * @throws IOException */ @Override public double getImmediateValue(GpioPinAnalogInput pin) throws IOException{ return getImmediateValue(pin.getPin()); }
/** * Get the event threshold value for a given analog input pin. * * The event threshold value determines how much change in the * analog input pin's conversion value must occur before the * framework issues an analog input pin change event. A threshold * is necessary to prevent a significant number of analog input * change events from getting propagated and dispatched for input * values that may have an expected range of drift. * * see the DEFAULT_THRESHOLD constant for the default threshold value. * * @param pin analog input pin * @return event threshold value for requested analog input pin */ @Override public double getEventThreshold(GpioPinAnalogInput pin){ return getEventThreshold(pin.getPin()); }
double analog = provider.getAnalogValue(input.getPin()); sb.append(" \t[" + input.getValue() + " -> " + analog + " V] ");
System.out.println(" -> " + provider.getAnalogValue(input.getPin()) + " V");