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
Diff: ReadMe.md
- Revision:
- 0:661414c07859
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/ReadMe.md Tue Nov 21 21:29:58 2017 +0000 @@ -0,0 +1,20 @@ +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, becauce 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://cdn.sparkfun.com/assets/parts/1/2/3/1/9/RFD77402_Brochure.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 \ No newline at end of file