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: source.cpp
- Revision:
- 0:01d408baf267
diff -r 000000000000 -r 01d408baf267 source.cpp
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/source.cpp Sun Dec 23 18:08:03 2018 +0000
@@ -0,0 +1,22 @@
+#include "header.h"
+
+AnalogIn sonar(p16);
+BusOut leds(LED1, LED2, LED3, LED4);
+
+void test(void)
+{
+ float mesure1, mesure2;
+
+ mesure1 = sonar.read();
+ wait(0.5);
+ mesure2 = sonar.read();
+
+ if (abs(mesure1 - mesure2) < 0.1f)
+ {
+ leds = 15;
+ }
+ else
+ {
+ leds = 0;
+ }
+}
\ No newline at end of file