Full application
Dependencies: mbed libTCS34725 lib_LoRaWAN
Diff: main.cpp
- Revision:
- 2:7040e447d0df
- Parent:
- 1:c3a839871165
- Child:
- 3:67413b100ac3
--- a/main.cpp Wed Jan 16 13:19:41 2019 +0000 +++ b/main.cpp Wed Jan 16 13:40:11 2019 +0000 @@ -1,29 +1,33 @@ #include "mbed.h" -InterruptIn button(PG_0); - -DigitalOut led(PD_14); +InterruptIn button1(PG_0); +Serial pc(USBTX, USBRX); +DigitalOut ledRED(PD_14); double delay = 0.5; // 500 ms -void pressed() +void BTN1pressed() { delay = 0.1; // 100 ms } -void released() +void BTN1released() { delay = 0.5; // 500 ms } int main() { - // Assign functions to button - button.fall(&pressed); - button.rise(&released); + // Assign functions to button1 + button1.fall(&BTN1pressed); + button1.rise(&BTN1released); + + //serial communication + pc.baud(115200); + pc.printf("Welcome at University of Antwerp #STEM2019 \r\n"); while (1) { - led = !led; + ledRED = !ledRED; wait(delay); } }