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:
- 7:dc463bf54be6
- Parent:
- 6:6c1c38d4faa4
- Child:
- 8:49f2b6a515ac
--- a/main.cpp Sat Mar 13 16:46:56 2021 +0100
+++ b/main.cpp Sat Mar 13 16:51:00 2021 +0100
@@ -4,22 +4,22 @@
using namespace std::chrono;
-InterruptIn user_button(USER_BUTTON);
-DigitalOut led(LED1);
+InterruptIn user_button(USER_BUTTON);
+DigitalOut led(LED1);
BufferedSerial pc(USBTX, USBRX);
-bool executeMainTask = false;
-Timer user_button_timer, loop_timer;
-int Ts_ms = 50;
+bool executeMainTask = false;
+Timer user_button_timer, loop_timer;
+int Ts_ms = 50;
-void button_fall();
-void button_rise();
+void button_fall();
+void button_rise();
-AnalogIn analogIn(PA_0);
-float dist = 0.0f;
+AnalogIn analogIn(PA_0);
+float dist = 0.0f;
-float floatNumber = 0.003713f;
-int integerNumber = 777;
+float floatNumber = 0.003713f;
+int integerNumber = 777;
int main()
{
@@ -60,8 +60,7 @@
int T_loop_ms = duration_cast<milliseconds>(loop_timer.elapsed_time()).count();
int dT_loop_ms = Ts_ms - T_loop_ms;
- printf("T_loop_ms: %d\r\n", dT_loop_ms);
- thread_sleep_for(500);
+ thread_sleep_for(dT_loop_ms);
}
}