Full application
Dependencies: mbed libTCS34725 lib_LoRaWAN
Diff: main.cpp
- Revision:
- 0:1cadcdcf4521
- Child:
- 1:c3a839871165
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/main.cpp Wed Jan 16 13:05:42 2019 +0000 @@ -0,0 +1,29 @@ +#include "mbed.h" + +InterruptIn button(USER_BUTTON); + +DigitalOut led(LED1); + +double delay = 0.5; // 500 ms + +void pressed() +{ + delay = 0.1; // 100 ms +} + +void released() +{ + delay = 0.5; // 500 ms +} + +int main() +{ + // Assign functions to button + button.fall(&pressed); + button.rise(&released); + + while (1) { + led = !led; + wait(delay); + } +}