UltrasonicRanger_Example V1.0
Dependencies: mbed RangeFinder
Revision 8:25e1f2a7d3bc, committed 2019-06-25
- Comitter:
- pmic
- Date:
- Tue Jun 25 15:25:34 2019 +0000
- Parent:
- 7:07fce0dcfeab
- Commit message:
- Minor changes
Changed in this revision
| RangeFinder.lib | Show annotated file Show diff for this revision Revisions of this file |
| main.cpp | Show annotated file Show diff for this revision Revisions of this file |
--- a/RangeFinder.lib Tue Jun 25 08:58:02 2019 +0000 +++ b/RangeFinder.lib Tue Jun 25 15:25:34 2019 +0000 @@ -1,1 +1,1 @@ -https://os.mbed.com/teams/altb_pmic/code/RangeFinder/#89d7dd44ecfd +https://os.mbed.com/teams/altb_pmic/code/RangeFinder/#cbb20cd7905d
--- 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) {
/*