Skip to content

Commit 1e62eea

Browse files
authored
Merge pull request #15 from DrGFreeman/array_example
Improved array example
2 parents e54aa14 + 342fffd commit 1e62eea

3 files changed

Lines changed: 8 additions & 3 deletions

File tree

README.md

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
# SharpDistSensor
22
A library for the Arduino IDE that helps interface with Sharp analog distance sensors.
33

4-
Version 1.4.1
4+
Version 1.4.2
55
[![Build Status](https://travis-ci.org/DrGFreeman/SharpDistSensor.svg?branch=master)](https://travis-ci.org/DrGFreeman/SharpDistSensor)
66
By Julien de la Bruère-Terreault (drgfreeman@tuta.io)
77

@@ -11,7 +11,7 @@ polynomial fit function up to fifth order or a power fit function.
1111

1212
By default, this library is set to use polynomial coefficients calibrated for the Sharp GP2Y0A60SZLF Analog Distance Sensor 10-150cm 5V, over a range of 50-1500 mm (analog values 30-875). The returned distance is in millimeters (mm) units.
1313

14-
For different accuracy, range, sensor model or units, different coefficients may be required.
14+
The library also allows the use of pre-defined calibrations for different sensor models as well as custom defined polynomial or power fit functions. Examples are provided showing how to use pre-defined calibrations or how to define custom fit functions.
1515

1616
The distance output is filtered using real-time median filtering (sliding window of ajustable size). The MedianFilter class from the following library is used: https://github.com/daPhoosa/MedianFilter.
1717

@@ -84,6 +84,7 @@ Model | valMin | valMax
8484
This library has been designed so that it is easy to add sensor models. Contributions are therefore welcome. Adding models to the library can be done by either submitting a pull request or providing me the proposed fit function and associated calibration data by email so I can add it myself. Thank you for contributing!
8585

8686
## Version history
87+
* 1.4.2 (2018-09-23): Improved comments in SharpDistSensorArray example.
8788
* 1.4.1 (2018-08-07): Updated MedianFilter to latest version from [daPhoosa/MedianFilter](https://github.com/daPhoosa/MedianFilter).
8889
* 1.4.0 (2018-05-21): Added GP2Y0A51SK0F_5V_DS model.
8990
* 1.3.0 (2018-05-20): Added SharpDistSensorArray example.

examples/SharpDistSensorArray/SharpDistSensorArray.ino

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -68,4 +68,8 @@ void loop() {
6868
for (byte i = 0; i < nbSensors; i++) {
6969
distArray[i] = sensorArray[i].getDist();
7070
}
71+
72+
// The measured distances can now be accessed through the different indices of the
73+
// distArray array, i.e. distArray[0] for the first sensor, distArray[1] for the
74+
// sencond sensor ...
7175
}

library.properties

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
name=SharpDistSensor
2-
version=1.4.1
2+
version=1.4.2
33
author=Julien de la Bruere-Terreault, drgfreeman@tuta.io
44
maintainer=Julien de la Bruere-Terreault, drgfreeman@tuta.io
55
sentence=Sharp analog distance sensor library

0 commit comments

Comments
 (0)