test program for IRRangefinder, returns all three possible readings sequentialy.

Dependencies:   mbed GP2xx

Files at this revision

API Documentation at this revision

Comitter:
littlexc
Date:
Thu Nov 25 15:35:45 2010 +0000
Commit message:

Changed in this revision

GP2xx.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
diff -r 000000000000 -r 01f84727e31f GP2xx.lib
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/GP2xx.lib	Thu Nov 25 15:35:45 2010 +0000
@@ -0,0 +1,1 @@
+http://mbed.org/users/littlexc/code/GP2xx/#e3ea40a41d27
diff -r 000000000000 -r 01f84727e31f main.cpp
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/main.cpp	Thu Nov 25 15:35:45 2010 +0000
@@ -0,0 +1,17 @@
+#include <mbed.h>
+#include <GP2xx.h>
+
+
+Serial pc(USBTX, USBRX); // tx, rx
+IRRangeFinder LS(p18,1);
+
+DigitalOut led1 (LED1);
+
+int main() {
+    pc.printf("Hello World!\n");
+    while (1) {
+        led1=!led1;
+        pc.printf("LS read %d LS read float %F LS read voltage %d\n", LS.read(), LS.read_f(), LS.read_v());
+        wait(0.1);
+    }
+}
\ No newline at end of file
diff -r 000000000000 -r 01f84727e31f mbed.bld
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/mbed.bld	Thu Nov 25 15:35:45 2010 +0000
@@ -0,0 +1,1 @@
+http://mbed.org/users/mbed_official/code/mbed/builds/e2ac27c8e93e