Luca Mottola
/
AthensFall19-DISCO-ButtonBusy
Example using the user button on DISCO L475E IOT01
Revision 0:e7c102a4c673, committed 2018-11-08
- Comitter:
- lmottola
- Date:
- Thu Nov 08 16:59:47 2018 +0000
- Commit message:
- Initial commit
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 |
diff -r 000000000000 -r e7c102a4c673 main.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/main.cpp Thu Nov 08 16:59:47 2018 +0000 @@ -0,0 +1,15 @@ +#include "mbed.h" + +DigitalIn button(USER_BUTTON); // Change to match your board +DigitalOut led(LED1); + +#define BUTTON_PRESS 0 + +int main() { + while(1) { + if(BUTTON_PRESS == button){ + led = !led; + wait(1); + } + } +}
diff -r 000000000000 -r e7c102a4c673 mbed.bld --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/mbed.bld Thu Nov 08 16:59:47 2018 +0000 @@ -0,0 +1,1 @@ +https://os.mbed.com/users/mbed_official/code/mbed/builds/e95d10626187 \ No newline at end of file