Skip to content

Instantly share code, notes, and snippets.

@hitherejoe
Created April 30, 2017 17:55
Show Gist options
  • Save hitherejoe/057c3f7ad6e7be7f2fb35e43fb7a3f62 to your computer and use it in GitHub Desktop.
Save hitherejoe/057c3f7ad6e7be7f2fb35e43fb7a3f62 to your computer and use it in GitHub Desktop.
public void openPushButtonGpioPin(Button.OnButtonEventListener buttonCallback) {
try {
Button button = new Button(BoardDefaults.getPushButtonGpioPin(),
Button.LogicState.PRESSED_WHEN_LOW);
button.setOnButtonEventListener(buttonCallback);
} catch (IOException error) {
Timber.e(error, "There was an error configuring the push button GPIO pin");
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment