/** * default constructor * * @param pin analog input pin */ public AnalogSensorComponent(GpioPinAnalogInput pin) { this.pin = pin; // add pin listener this.pin.addListener(pinListener); }
@Override public double getValue() { return pin.getValue(); } }
/** * 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()); }
@Override public double getValue() { return pin.getValue(); } }
/** * default constructor * * @param pin analog input pin */ public DistanceSensorComponent(GpioPinAnalogInput pin) { this.pin = pin; // add pin listener this.pin.addListener(pinListener); }
/** * 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()); }
@Override public double getValue() { return pin.getValue(); } }
/** * default constructor * * @param pin analog input pin */ public AnalogSensorComponent(GpioPinAnalogInput pin) { this.pin = pin; // add pin listener this.pin.addListener(pinListener); }
/** * 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()); }
@Override public double getValue() { return pin.getValue(); } }
/** * default constructor * * @param pin analog input pin */ public DistanceSensorComponent(GpioPinAnalogInput pin) { this.pin = pin; // add pin listener this.pin.addListener(pinListener); }
/** * 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()); }
sb.append(" \t[" + input.getValue() + "] ");
myInputs[0].addListener(listener); myInputs[1].addListener(listener); myInputs[2].addListener(listener); myInputs[3].addListener(listener);