Package com.pi4j.io.gpio

Examples of com.pi4j.io.gpio.PinState


    public void run() {
        // only process listeners and triggers if the received interrupt event
        // matches the pin number being tracked my this class instance
        if (this.pin.getPin().equals(event.getPin())) {
            if (event.getEventType() == PinEventType.DIGITAL_STATE_CHANGE) {
                PinState state = ((PinDigitalStateChangeEvent) event).getState();

                // process event callbacks for digital listeners
                for (GpioPinListener listener : pin.getListeners()) {
                    if (listener instanceof GpioPinListenerDigital) {
                        ((GpioPinListenerDigital) listener)
View Full Code Here


    public void handlePinEvent(PinEvent event) {
        // only process listeners and triggers if the received interrupt event
        // matches the pin number being tracked my this class instance
        if (this.pin.getPin().equals(event.getPin())) {
            if (event.getEventType() == PinEventType.DIGITAL_STATE_CHANGE) {
                PinState state = ((PinDigitalStateChangeEvent)event).getState();
               
                // process event callbacks for digital listeners
                for (GpioPinListener listener : pin.getListeners()) {
                    if (listener instanceof GpioPinListenerDigital) {                     
                        ((GpioPinListenerDigital)listener).handleGpioPinDigitalStateChangeEvent(new GpioPinDigitalStateChangeEvent(event.getSource(), pin, state));
View Full Code Here

           
            // perform the shutdown options if configured for the pin
            GpioPinShutdown shutdownOptions = pin.getShutdownOptions();
            if (shutdownOptions != null) {
                // get shutdown option configuration
                PinState state = shutdownOptions.getState();
                PinMode mode = shutdownOptions.getMode();
                PinPullResistance resistance = shutdownOptions.getPullResistor();
                Boolean unexport = shutdownOptions.getUnexport();
               
                // perform shutdown actions
View Full Code Here

TOP

Related Classes of com.pi4j.io.gpio.PinState

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.