Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
Diff: main.cpp
- Revision:
- 1:4010b3131918
- Parent:
- 0:cbc40e6ff273
- Child:
- 2:1dece5699c8b
--- a/main.cpp Wed Feb 27 21:07:55 2019 +0000 +++ b/main.cpp Thu Feb 28 12:19:46 2019 +0000 @@ -4,6 +4,7 @@ #include "Logger.h" #include "BusyWaiter.h" + // Set the used LED DigitalOut led1(LED1); @@ -16,13 +17,19 @@ // Set the logger handler Logger logger(true); + int main () { - Logger logger(false); + + // Waiting for the console connection + busy_waiter.wait(2000); + + logger.log("Code written by Loic Guibert.\r\n"); // defining which waiting mechanism we want to use bool deep_sleep_mode = true; - logger.log("Entering blinking state.\n"); + // Gives the mode + logger.log("Entering blinking state. Deep Mode: %s", deep_sleep_mode ? "true\r\n" : "false\r\n"); while (true) { // Blink LED by inversing its state @@ -36,15 +43,15 @@ ThisThread::sleep_for(wait_time); } else { /* As seen on the TP1's doc: - Using the BusyWaiter::wait() method - the class is provided to you and + Using the BusyWaiter::wait() method w- the class is provided to you and * you must include it into your project. */ busy_waiter.wait(wait_time); } if (led1.read() == 0) { - logger.log("LED state: 0.\n"); + logger.log("LED state: 0.\r\n"); } else { - logger.log("LED state: 1.\n"); + logger.log("LED state: 1.\r\n"); } }