![](/media/cache/profiles/0738069b244a1c43c83112b735140a16.50x50_q85.jpg)
SEEED STUDIO SEN136B5B test (Using PING library in local)
main.cpp@0:02a23e3031ee, 2012-09-24 (annotated)
- Committer:
- mio
- Date:
- Mon Sep 24 15:52:56 2012 +0000
- Revision:
- 0:02a23e3031ee
Import PING code to local.
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
mio | 0:02a23e3031ee | 1 | #include "mbed.h" |
mio | 0:02a23e3031ee | 2 | #include "PING.h" |
mio | 0:02a23e3031ee | 3 | |
mio | 0:02a23e3031ee | 4 | PING ping(p9); |
mio | 0:02a23e3031ee | 5 | Serial pc(USBTX,USBRX) ; |
mio | 0:02a23e3031ee | 6 | int main() |
mio | 0:02a23e3031ee | 7 | { |
mio | 0:02a23e3031ee | 8 | pc.baud(115200) ; |
mio | 0:02a23e3031ee | 9 | pc.printf("start!\r\n") ; |
mio | 0:02a23e3031ee | 10 | while(1) { |
mio | 0:02a23e3031ee | 11 | pc.printf("Measured : %.1f\r\n", ping.read()); |
mio | 0:02a23e3031ee | 12 | wait(0.2); |
mio | 0:02a23e3031ee | 13 | } |
mio | 0:02a23e3031ee | 14 | } |