Programa para usar sensor MaxSonar EZ01 con la libreria MaxSonar

Dependencies:   MaxSonar mbed

Files at this revision

API Documentation at this revision

Comitter:
migool
Date:
Thu Mar 27 23:31:23 2014 +0000
Commit message:
Revision commit to "senorpulse"

Changed in this revision

MaxSonar.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/MaxSonar.lib	Thu Mar 27 23:31:23 2014 +0000
@@ -0,0 +1,1 @@
+http://mbed.org/users/migool/code/MaxSonar/#de1c628c1495
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/main.cpp	Thu Mar 27 23:31:23 2014 +0000
@@ -0,0 +1,15 @@
+#include "mbed.h"
+#include "MaxSonar.h"
+Serial pc(USBTX, USBRX);
+MaxSonar sensor(PTD4);
+float in;
+float cm;
+
+int main() { 
+    while(1) {    
+    in=sensor.getinches();
+    cm=sensor.getcm();
+    pc.printf("in: %f, cm: %f", in,cm);
+    wait(2);
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/mbed.bld	Thu Mar 27 23:31:23 2014 +0000
@@ -0,0 +1,1 @@
+http://world3.dev.mbed.org/users/mbed_official/code/mbed/builds/824293ae5e43
\ No newline at end of file