-
-
Save hitherejoe/b8421d91fa1a35fa7095e872a48d0b98 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public void openSolenoidGpioPins() { | |
solenoids.add(configureGpioPin(BoardDefaults.getFirstSolenoidGpioPin())); | |
solenoids.add(configureGpioPin(BoardDefaults.getSecondSolenoidGpioPin())); | |
solenoids.add(configureGpioPin(BoardDefaults.getThirdSolenoidGpioPin())); | |
solenoids.add(configureGpioPin(BoardDefaults.getFourthSolenoidGpioPin())); | |
solenoids.add(configureGpioPin(BoardDefaults.getFifthSolenoidGpioPin())); | |
solenoids.add(configureGpioPin(BoardDefaults.getSixthSolenoidGpioPin())); | |
} | |
private Gpio configureGpioPin(String pin) { | |
Gpio gpioPin = null; | |
try { | |
gpioPin = peripheralManagerService.openGpio(pin); | |
gpioPin.setDirection(DIRECTION_OUT_INITIALLY_LOW); | |
gpioPin.setActiveType(ACTIVE_HIGH); | |
} catch (IOException e) { | |
e.printStackTrace(); | |
} | |
return gpioPin; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment