![](/media/cache/group/default_image.jpg.50x50_q85.jpg)
Drivers for Pololu irs09a short range infra red sensor.
Dependencies: mbed
Diff: ShortRangeSensor_Test.cpp
- Revision:
- 0:fba97a03cd3c
diff -r 000000000000 -r fba97a03cd3c ShortRangeSensor_Test.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/ShortRangeSensor_Test.cpp Fri Mar 25 22:09:43 2016 +0000 @@ -0,0 +1,20 @@ +#include "mbed.h" +#include "ShortRangeSensor.h" + +int main() +{ + ShortRangeSensor srs(PTC11, PTC10); + Serial pc(USBTX, USBRX); + + pc.printf("Part to Part Offset = %X\r\n\n", srs.getPPOffset()); + srs.setPPOffset(32); + pc.printf("Part to Part Offset = %X\r\n\n", srs.getPPOffset()); + + while(true) + { + pc.printf("%i mm %X\n\r", srs.getRange(), srs.getStatus()); + wait(3); + } + + return 0; +} \ No newline at end of file