Miguel Rogel
/
sensorPulse
Programa para usar sensor MaxSonar EZ01 con la libreria MaxSonar
Diff: main.cpp
- Revision:
- 0:0915212278c6
diff -r 000000000000 -r 0915212278c6 main.cpp --- /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); + } +}