UltrasonicRanger_Example V1.0

Dependencies:   mbed RangeFinder

Revision:
8:25e1f2a7d3bc
Parent:
6:86943d1ed254
--- a/main.cpp	Tue Jun 25 08:58:02 2019 +0000
+++ b/main.cpp	Tue Jun 25 15:25:34 2019 +0000
@@ -53,8 +53,8 @@
 * @param timeout Time to wait for a pulse from the range finder before giving up.
 *        y = x/scale + offset
 */
-// RangeFinder rf(PB_3, 10, 5782.0, 0.02, 7000); // 50 Hz parametrization
-RangeFinder rf(PB_3, 10, 5782.0, 0.02, 17500); // 20 Hz parametrization
+// RangeFinder rangefinder(PB_3, 10, 5782.0, 0.02, 7000); // 50 Hz parametrization
+RangeFinder rangefinder(PB_3, 10, 5782.0, 0.02, 17500); // 20 Hz parametrization
 float d = 0.0f;
 
 Serial pc(SERIAL_TX, SERIAL_RX);  // serial connection via USB - programmer
@@ -112,8 +112,8 @@
 // the updateLoop starts as soon as you pressed the blue botton
 void updateLoop(void)
 {
-    // d = usGain*rf.read_m() + usOffset;
-    d = rf.read_m();
+    // d = usGain*rangefinder() + usOffset;
+    d = rangefinder();
     df = pt1(d);
     if(doRun) {
         /*