![](/media/cache/group/default_image.jpg.50x50_q85.jpg)
Read the user button state on the Nucleo board.
Dependencies: mbed
main.cpp
- Committer:
- bcostm
- Date:
- 2014-02-21
- Revision:
- 0:c9d8fcdda4d0
File content as of revision 0:c9d8fcdda4d0:
#include "mbed.h" DigitalIn mybutton(USER_BUTTON); DigitalOut myled(LED1); int main() { while(1) { if (mybutton == 0) { // Button is pressed myled = !myled; // Toggle the LED state wait(0.2); // 200 ms } } }