Package com.pi4j.io.gpio.exception

Examples of com.pi4j.io.gpio.exception.InvalidPinModeException


    }

    @Override
    public void setMode(Pin pin, PinMode mode) {
        if (!pin.getSupportedPinModes().contains(mode)) {
            throw new InvalidPinModeException(pin, "Invalid pin mode [" + mode.getName() + "]; pin [" + pin.getName() + "] does not support this mode.");
        }

        if (!pin.getSupportedPinModes().contains(mode)) {
            throw new UnsupportedPinModeException(pin, mode);
        }
View Full Code Here


        PinMode mode = getMode(pin);
       
        // only permit invocation on pins set to DIGITAL_OUTPUT modes
        if (mode != PinMode.DIGITAL_OUTPUT) {
            throw new InvalidPinModeException(pin, "Invalid pin mode on pin [" + pin.getName() + "]; cannot setState() when pin mode is [" + mode.getName() + "]");
        }

        // for digital output pins, we will echo the event feedback
        dispatchPinDigitalStateChangeEvent(pin, state);
View Full Code Here

       
        PinMode mode = getMode(pin);

        // only permit invocation on pins set to DIGITAL modes
        if (!PinMode.allDigital().contains(mode)) {
            throw new InvalidPinModeException(pin, "Invalid pin mode on pin [" + pin.getName() + "]; cannot getState() when pin mode is [" + mode.getName() + "]");
        }

        // return cached pin state
        return getPinCache(pin).getState();          
    }
View Full Code Here

       
        PinMode mode = getMode(pin);

        // only permit invocation on pins set to OUTPUT modes
        if (!PinMode.allOutput().contains(mode)) {
            throw new InvalidPinModeException(pin, "Invalid pin mode on pin [" + pin.getName() + "]; cannot setValue(" + value + ") when pin mode is [" + mode.getName() + "]");
        }

        // for digital analog pins, we will echo the event feedback
        dispatchPinAnalogValueChangeEvent(pin, value);
View Full Code Here

        }
       
        PinMode mode = getMode(pin);

        if (mode != PinMode.PWM_OUTPUT) {
            throw new InvalidPinModeException(pin, "Invalid pin mode [" + mode.getName() + "]; unable to setPwm(" + value + ")");
        }
       
        // cache pin PWM value
        getPinCache(pin).setPwmValue(value);                      
    }
View Full Code Here

TOP

Related Classes of com.pi4j.io.gpio.exception.InvalidPinModeException

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.