Package com.pi4j.io.gpio

Examples of com.pi4j.io.gpio.GpioPin


                throw new GpioPinExistsException(pin);
            }
        }

        // create new GPIO pin instance
        GpioPin gpioPin = new GpioPinImpl(this, provider, pin);

        // set the gpio pin name
        if (name != null) {
            gpioPin.setName(name);
        }

        // export this pin
        gpioPin.export(mode);

        // add this new pin instance to the managed collection
        pins.add(gpioPin);

        // return new new pin instance
View Full Code Here


    public void unprovisionPin(GpioPin... pin) {
        if (pin == null || pin.length == 0) {
            throw new IllegalArgumentException("Missing pin argument.");
        }
        for (int index = (pin.length-1); index >= 0; index--) {
            GpioPin p  = pin[index];
           
            // ensure the requested pin has been provisioned
            if (!pins.contains(p)) {
                throw new GpioPinNotProvisionedException(p.getPin());
            }
            // remove all listeners and triggers
            if (p instanceof GpioPinInput) {
                ((GpioPinInput)p).removeAllListeners();
                ((GpioPinInput)p).removeAllTriggers();
View Full Code Here

TOP

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

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.