@Override public void invoke(GpioPin pin, PinState state) { if (targetPin != null) { targetPin.setState(state); } } }
/** * Set the current GPIO digital output pin state * based for LIGHT OFF */ @Override public void off() { // turn the light OFF by settings the GPIO pin to the off state pin.setState(offState); }
@Override public void invoke(GpioPin pin, PinState state) { if (targetPin != null) { targetPin.setState(targetPinState); } } }
/** * Set the current GPIO digital output pin state * based for LIGHT OFF */ @Override public void off() { // turn the light OFF by settings the GPIO pin to the off state pin.setState(offState); }
@Override public void invoke(GpioPin pin, PinState state) { if (targetPin != null) { targetPin.setState(targetPinState); } } }
/** * Set the current GPIO digital output pin state * based for LIGHT OFF */ @Override public void off() { // turn the light OFF by settings the GPIO pin to the off state pin.setState(offState); }
@Override public void invoke(GpioPin pin, PinState state) { if (targetPin != null) { targetPin.setState(state); } } }
/** * Set the current GPIO digital output pin state * based for LIGHT ON */ @Override public void on() { // turn the light ON by settings the GPIO pin to the on state pin.setState(onState); }
/** * Set the current GPIO digital output pin state * based for LIGHT ON */ @Override public void on() { // turn the light ON by settings the GPIO pin to the on state pin.setState(onState); }
/** * Set the current GPIO digital output pin state * based for LIGHT ON */ @Override public void on() { // turn the light ON by settings the GPIO pin to the on state pin.setState(onState); }
/** * Set the current GPIO digital output pin state * based for LIGHT ON */ @Override public void on() { // turn the light ON by settings the GPIO pin to the on state pin.setState(onState); }
public void run() { // cancel the blinking task blinkTask.cancel(true); // set the pin to the stop blinking state pin.setState(stopState); } }
public void run() { // cancel the blinking task blinkTask.cancel(true); // set the pin to the stop blinking state pin.setState(stopState); } }
public void run() { pin.setState(inactiveState); // invoke callback if one was defined if(callback != null){ try { callback.call(); } catch (Exception e) { e.printStackTrace(); } } } }
public void run() { pin.setState(inactiveState); // invoke callback if one was defined if(callback != null){ try { callback.call(); } catch (Exception e) { e.printStackTrace(); } } } }
@Override public GpioPinDigitalOutput provisionDigitalOutputPin(GpioProvider provider, Pin pin, String name, PinState defaultState) { // create new GPIO pin instance GpioPinDigitalOutput gpioPin = (GpioPinDigitalOutput)provisionPin(provider, pin, name, PinMode.DIGITAL_OUTPUT, defaultState); // apply default state if (defaultState != null) { gpioPin.setState(defaultState); } // return new new pin instance return gpioPin; }
@Override public GpioPinDigitalOutput provisionDigitalOutputPin(GpioProvider provider, Pin pin, String name, PinState defaultState) { // create new GPIO pin instance GpioPinDigitalOutput gpioPin = (GpioPinDigitalOutput)provisionPin(provider, pin, name, PinMode.DIGITAL_OUTPUT, defaultState); // apply default state if (defaultState != null) { gpioPin.setState(defaultState); } // return new new pin instance return gpioPin; }
@Override protected void closeDevice() { Logger.debug("closeDevice()"); digitalOutputPin.setState(false); digitalOutputPin.unexport(); GpioFactory.getInstance().unprovisionPin(digitalOutputPin); }