Simple Hello World for the SRF05 library

Dependencies:   mbed SRF05

Committer:
simon
Date:
Fri Nov 19 22:36:20 2010 +0000
Revision:
0:d87132986e8f

        

Who changed what in which revision?

UserRevisionLine numberNew contents of line
simon 0:d87132986e8f 1 // Simple program to read the distance from an SRF05 using the SRF05 library
simon 0:d87132986e8f 2
simon 0:d87132986e8f 3 #include "mbed.h"
simon 0:d87132986e8f 4 #include "SRF05.h"
simon 0:d87132986e8f 5
simon 0:d87132986e8f 6 SRF05 srf(p13, p14);
simon 0:d87132986e8f 7
simon 0:d87132986e8f 8 int main() {
simon 0:d87132986e8f 9 while(1) {
simon 0:d87132986e8f 10 printf("Distance = %.1f\n", srf.read());
simon 0:d87132986e8f 11 wait(0.2);
simon 0:d87132986e8f 12 }
simon 0:d87132986e8f 13 }