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.
Revision 0:01d408baf267, committed 2018-12-23
- Comitter:
- corentinlenel
- Date:
- Sun Dec 23 18:08:03 2018 +0000
- Commit message:
- Test du capteur de distance MS-EZ4.
Changed in this revision
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/header.h Sun Dec 23 18:08:03 2018 +0000 @@ -0,0 +1,3 @@ +#include "mbed.h" + +void test(void); \ No newline at end of file
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/main.cpp Sun Dec 23 18:08:03 2018 +0000
@@ -0,0 +1,9 @@
+#include "header.h"
+
+int main()
+{
+ while(1)
+ {
+ test();
+ }
+}
\ No newline at end of file
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/mbed.bld Sun Dec 23 18:08:03 2018 +0000 @@ -0,0 +1,1 @@ +https://os.mbed.com/users/mbed_official/code/mbed/builds/3a7713b1edbc \ No newline at end of file
--- /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