New with OLED Output.

Dependencies:   HC_SR04_Ultrasonic_Library OLEDDisplay mbed

Fork of UltraschallSensor by smd.iotkit.ch

Files at this revision

API Documentation at this revision

Comitter:
stefan1691
Date:
Fri Apr 17 18:34:17 2015 +0000
Child:
1:48e4876a3868
Commit message:
Ultraschall Abstandsmesser

Changed in this revision

HC_SR04_Ultrasonic_Library.lib Show annotated file Show diff for this revision Revisions of this file
main.cpp Show annotated file Show diff for this revision Revisions of this file
mbed.bld Show annotated file Show diff for this revision Revisions of this file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/HC_SR04_Ultrasonic_Library.lib	Fri Apr 17 18:34:17 2015 +0000
@@ -0,0 +1,1 @@
+http://developer.mbed.org/users/ejteb/code/HC_SR04_Ultrasonic_Library/#e0f9c9fb4cf3
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/main.cpp	Fri Apr 17 18:34:17 2015 +0000
@@ -0,0 +1,24 @@
+/** Ultraschall Abstandsmesser 
+ */
+#include "mbed.h"
+#include "ultrasonic.h"
+ 
+ void dist(int distance)
+{
+    // Abhandlung der Entfernung
+    printf("Entfernung %dmm\n", distance);
+}
+ 
+ultrasonic mu(D5, D6, .1, 1, &dist);    // setzt den Trigger Pin auf D5, den Echo Pin auf D6
+                                        // liefert all 0.1 Sekunten einen neuen Wert mit einem
+                                        // Timeout von 1 Sekunden. Fuer die Ausgabe des Wertes
+                                        // wird die Funktion dist aufgerufen.
+int main()
+{
+    mu.startUpdates();                  // Start der Abstandsmessung
+    while(1)
+    {
+        mu.checkDistance();             // Pooling vom Distanzmesser, sollte moeglichst oft erfolgen
+        // weitere Abhandlungen
+    }
+}         
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/mbed.bld	Fri Apr 17 18:34:17 2015 +0000
@@ -0,0 +1,1 @@
+http://mbed.org/users/mbed_official/code/mbed/builds/433970e64889
\ No newline at end of file