Simple library for reading distance from SRF02 Ultrasonic Sensor in I2C mode. With the use of imperial readings too
Fork of SRF02 by
Diff: SRF02.h
- Revision:
- 1:8e6587d88773
- Parent:
- 0:b729d2ce03bd
- Child:
- 2:ad1613b4145c
--- a/SRF02.h Sun Mar 08 14:15:29 2015 +0000 +++ b/SRF02.h Sun Mar 08 14:21:40 2015 +0000 @@ -58,10 +58,24 @@ { public: + /** Create a SRF02 object connected to the specified I2C pins + * + * @param sdaPin - mbed SDA pin + * @param sclPin - mbed SCL pin + * + */ SRF02(PinName sdaPin, PinName sclPin); + /** Read distance in centimetres + * + * @returns distance in centimetres (int) + * + */ int getDistanceCm(); private: + /** Hangs in infinite loop flashing 'blue lights of death' + * + */ void error();