joseph chen
/
Nucleo_read_button
read user button
Revision 1:52e576abcb8a, committed 2016-05-05
- Comitter:
- ittraining
- Date:
- Thu May 05 02:43:46 2016 +0000
- Parent:
- 0:c9d8fcdda4d0
- Commit message:
- read button
Changed in this revision
main.cpp | Show annotated file Show diff for this revision Revisions of this file |
mbed.bld | Show annotated file Show diff for this revision Revisions of this file |
--- 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
--- a/mbed.bld Fri Feb 21 12:57:03 2014 +0000 +++ b/mbed.bld Thu May 05 02:43:46 2016 +0000 @@ -1,1 +1,1 @@ -http://mbed.org/users/mbed_official/code/mbed/builds/ed8466a608b4 \ No newline at end of file +http://mbed.org/users/mbed_official/code/mbed/builds/aae6fcc7d9bb \ No newline at end of file