Code originally by Chris Styles (I think), published for the components section

Dependencies:   SRF08 mbed

main.cpp

Committer:
melse
Date:
2017-10-31
Revision:
1:1c6b0662e757
Parent:
0:b757a3e4f64e

File content as of revision 1:1c6b0662e757:

#include "mbed.h"
#include "SRF08.h"
 
SRF08 srf08(p9, p10, 0xE0);      // Define SDA, SCL pin and I2C address
 
int main() {
 
    while (1) {
       printf("Measured range : %.2f cm\n",srf08.read());
       wait(0.1);
    }
 
}