Christopher Hasler
/
GP2D12rangefinder
test program for IRRangefinder, returns all three possible readings sequentialy.
Revision 0:01f84727e31f, committed 2010-11-25
- Comitter:
- littlexc
- Date:
- Thu Nov 25 15:35:45 2010 +0000
- Commit message:
Changed in this revision
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