
test program for IRRangefinder, returns all three possible readings sequentialy.
main.cpp
- Committer:
- littlexc
- Date:
- 2010-11-25
- Revision:
- 0:01f84727e31f
File content as of revision 0:01f84727e31f:
#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); } }