/** * Set the shutdown/terminate value that the DAC should apply to the given GPIO pin * when the class is destroyed/terminated. * * @param value the shutdown value to apply to the given pin(s) * @param pin analog output pin (vararg: one or more pins) */ public void setShutdownValue(Number value, GpioPinAnalogOutput ... pin){ for(GpioPinAnalogOutput p : pin) { setShutdownValue(value, p.getPin()); } }
/** * Set the current analog value as a percentage of the available range instead of a raw value. * Thr framework will automatically convert the percentage to a scaled number in the ADC's value range. * * @return percentage value between 0 and 100. */ @Override public void setPercentValue(GpioPinAnalogOutput pin, Number percent){ setPercentValue(pin.getPin(), percent); }
/** * Get the shutdown/terminate value that the DAC should apply to the given GPIO pin * when the class is destroyed/terminated. * * @param pin analog output pin * @return return the shutdown value if one has been defined, else NULL. */ public Number getShutdownValue(GpioPinAnalogOutput pin){ return getShutdownValue(pin.getPin()); } }
@Override public void setValue(double value, GpioPinAnalogOutput... pin) { if (pin == null || pin.length == 0) { throw new IllegalArgumentException("Missing pin argument."); } for (GpioPinAnalogOutput p : pin) { // ensure the requested pin has been provisioned if (!pins.contains(p)) { throw new GpioPinNotProvisionedException(p.getPin()); } // set pin PWM value p.setValue(value); } }
@Override public void setValue(double value, GpioPinAnalogOutput... pin) { if (pin == null || pin.length == 0) { throw new IllegalArgumentException("Missing pin argument."); } for (GpioPinAnalogOutput p : pin) { // ensure the requested pin has been provisioned if (!pins.contains(p)) { throw new GpioPinNotProvisionedException(p.getPin()); } // set pin PWM value p.setValue(value); } }