Simple Hello World for the SRF05 library

Dependencies:   mbed SRF05

Embed: (wiki syntax)

« Back to documentation index

Show/hide line numbers main.cpp Source File

main.cpp

00001 // Simple program to read the distance from an SRF05 using the SRF05 library
00002 
00003 #include "mbed.h"
00004 #include "SRF05.h"
00005 
00006 SRF05 srf(p13, p14);
00007  
00008 int main() { 
00009      while(1) { 
00010          printf("Distance = %.1f\n", srf.read());              
00011          wait(0.2); 
00012      } 
00013  }