Luca Mottola
/
AthensFall19-DISCO-ButtonBusy
Example using the user button on DISCO L475E IOT01
Diff: main.cpp
- Revision:
- 0:e7c102a4c673
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); + } + } +}