07 | Push Button

Push buttons provide a simple way for users to interact with a physical system and are found in most electronic devices (for example the power button on your PC). In this tutorial we'll learn how to detect when a button is pressed and then modify the code to count the number of times we press the button.



Parts List
  • Sparkfun RedBoard

  • 1x Push Button
Circuit Schematic



  • Open the LINX - Digital Input 1 Channel example from the LabVIEW Example Finder.

  • Select the DI channel connected to the push button.

  • Run the VI, and press the button.

  • Modify the VI to count the number of times the button is pressed.
  • Modify the code to display the count value on LEDs.

  • Use 3 buttons to control the Red, Green and Blue values of an RGB LED.