Added basic driver example use code to the library documentation.
[pub/lufa.git] / LUFA / Drivers / Board / Buttons.h
index d06781d..e112683 100644 (file)
  *
  *  For possible BOARD makefile values, see \ref Group_BoardTypes.
  *
+ *  <b>Example Usage:</b>
+ *  \code
+ *      // Initialise the button driver before first use
+ *      Buttons_Init();
+ *
+ *      printf("Waiting for button press...\r\n");
+ *
+ *      // Loop until a board button has been pressed
+ *      uint8_t ButtonPress;
+ *      while (!(ButtonPress = Buttons_GetStatus())) {};
+ *
+ *      // Display which button was pressed (assuming two board buttons)
+ *      printf("Button pressed: %s\r\n", (ButtonPress == BUTTONS_BUTTON1) ? "Button 1" : "Button 2");
+ *  \endcode
+ * 
  *  @{
  */