Examples of InvalidPinException


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

    }
   
    @Override
    public void export(Pin pin, PinMode mode) {
        if (!hasPin(pin)) {
            throw new InvalidPinException(pin);
        }
       
        if (!pin.getSupportedPinModes().contains(mode)) {
            throw new UnsupportedPinModeException(pin, mode);
        }
View Full Code Here

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

    }
   
    @Override
    public boolean isExported(Pin pin) {
        if (!hasPin(pin)) {
            throw new InvalidPinException(pin);
        }
       
        // return cached exported state
        return getPinCache(pin).isExported();
    }
View Full Code Here

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

    }

    @Override
    public void unexport(Pin pin) {
        if (!hasPin(pin)) {
            throw new InvalidPinException(pin);
        }
       
        // cache exported state
        getPinCache(pin).setExported(false);
    }
View Full Code Here

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

    }

    @Override
    public PinMode getMode(Pin pin) {
        if (!hasPin(pin)) {
            throw new InvalidPinException(pin);
        }

        // return cached mode value
        return getPinCache(pin).getMode();
    }
View Full Code Here

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

   
   
    @Override
    public void setPullResistance(Pin pin, PinPullResistance resistance) {
        if (!hasPin(pin)) {
            throw new InvalidPinException(pin);
        }
       
        if (!pin.getSupportedPinPullResistance().contains(resistance)) {
            throw new UnsupportedPinPullResistanceException(pin, resistance);
        }
View Full Code Here

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

    }

    @Override
    public PinPullResistance getPullResistance(Pin pin) {
        if (!hasPin(pin)) {
            throw new InvalidPinException(pin);
        }
       
        // return cached resistance
        return getPinCache(pin).getResistance();
    }
View Full Code Here

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

    }
   
    @Override
    public void setState(Pin pin, PinState state) {
        if (!hasPin(pin)) {
            throw new InvalidPinException(pin);
        }

        PinMode mode = getMode(pin);
       
        // only permit invocation on pins set to DIGITAL_OUTPUT modes
View Full Code Here

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

    }

    @Override
    public PinState getState(Pin pin) {
        if (!hasPin(pin)) {
            throw new InvalidPinException(pin);
        }
       
        PinMode mode = getMode(pin);

        // only permit invocation on pins set to DIGITAL modes
View Full Code Here

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

    }

    @Override
    public void setValue(Pin pin, double value) {
        if (!hasPin(pin)) {
            throw new InvalidPinException(pin);
        }
       
        PinMode mode = getMode(pin);

        // only permit invocation on pins set to OUTPUT modes
View Full Code Here

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

    }

    @Override
    public double getValue(Pin pin) {
        if (!hasPin(pin)) {
            throw new InvalidPinException(pin);
        }

        PinMode mode = getMode(pin);
       
        if (mode == PinMode.DIGITAL_OUTPUT) {
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.