Simple Hello World for the SRF05 library

Dependencies:   mbed SRF05

Committer:
ferdinandl007
Date:
Fri Feb 14 14:40:12 2020 +0000
Revision:
1:bbd86529ab7d
Parent:
0:d87132986e8f
kkl

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
ferdinandl007 1:bbd86529ab7d 6 SRF05 srf(PA_13, PA_14);
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 }