![](/media/cache/img/default_profile.jpg.50x50_q85.jpg)
read user button
Diff: main.cpp
- Revision:
- 1:52e576abcb8a
- Parent:
- 0:c9d8fcdda4d0
--- a/main.cpp Fri Feb 21 12:57:03 2014 +0000 +++ b/main.cpp Thu May 05 02:43:46 2016 +0000 @@ -1,9 +1,11 @@ #include "mbed.h" -DigitalIn mybutton(USER_BUTTON); +DigitalIn mybutton(PC_13); DigitalOut myled(LED1); int main() { + + while(1) { if (mybutton == 0) { // Button is pressed myled = !myled; // Toggle the LED state