Detecting push button presses

In this recipe, we will learn how to create a program that will print a message when the push button is pressed. Push buttons are a great way to create user interaction on your devices. This board comes with two push buttons, A and B, so you can create all sorts of different interactions with your users by reading and responding to push button events.