A library for the RFD77402 ToF distance-sensor. It's a port form the sparkfun-arduino-library.

RFD77402 ToF-sensor

I just ported the sourcecode provided by sparkfun (available on https://github.com/sparkfun/SparkFun_RFD77402_Arduino_Library) to the mbed-environment. So if you like it, please support them by e.g. buying a sparkfun-board, because in fact they did all the work :)

If you found any errors, please report them, I'm no professinal coder, so maybe there are some things I dindn't consider while porting the library.

The datasheet of the sensor is available at https://media.digikey.com/pdf/Data%20Sheets/RF%20Digital%20PDFs/RFD77402.pdf

The easiest way to use the sensor is e.g.:

RFD77402 MyDistance;                            //create an object-instance
MyDistance.begin(i2c);                          //initialize the sensor

MyDistance.takeMeasurement();                   //tell sensor to take a measurement

uint16_t distance = MyDistance.getDistance();   //get the last measurement result
Committer:
glx
Date:
Tue Nov 21 21:29:58 2017 +0000
Revision:
0:661414c07859
Initial commit

Who changed what in which revision?

UserRevisionLine numberNew contents of line
glx 0:661414c07859 1 I just ported the sourcecode provided by sparkfun
glx 0:661414c07859 2 (available on https://github.com/sparkfun/SparkFun_RFD77402_Arduino_Library) to
glx 0:661414c07859 3 the mbed-environment. So if you like it, please support them by e.g. buying a
glx 0:661414c07859 4 sparkfun-board, becauce in fact they did all the work :)
glx 0:661414c07859 5
glx 0:661414c07859 6 If you found any errors, please report them, I'm no professinal coder, so maybe
glx 0:661414c07859 7 there are some things I dindn't consider while porting the library.
glx 0:661414c07859 8
glx 0:661414c07859 9 The datasheet of the sensor is available at
glx 0:661414c07859 10 https://cdn.sparkfun.com/assets/parts/1/2/3/1/9/RFD77402_Brochure.pdf
glx 0:661414c07859 11
glx 0:661414c07859 12 The easiest way to use the sensor is e.g.:
glx 0:661414c07859 13
glx 0:661414c07859 14
glx 0:661414c07859 15 RFD77402 MyDistance; //create an object-instance
glx 0:661414c07859 16 MyDistance.begin(i2c); //initialize the sensor
glx 0:661414c07859 17
glx 0:661414c07859 18 MyDistance.takeMeasurement(); //tell sensor to take a measurement
glx 0:661414c07859 19
glx 0:661414c07859 20 uint16_t distance = MyDistance.getDistance(); //get the last measurement result