Dist-Nx
1.2
An Arduino library to use DIST-Nx Mindsensors sensor
|
Dist-Nx is a Arduino library to use Dist-Nx sensors.
Distance registers provide Distance information in millimeters. Voltage registers provide the raw voltage in milli-volts.
You need Arduino I2C master library to use the library because the Wire library issued with the Arduino IDE does not support the whole I2C protocol, for instance repeat start.
Open a terminal and run :
Or if you prefer, download the zip (of the last release) and directly unzip it in the Arduino/libraries
folder.
Now after (re)starting the Arduino IDE you should see Dist-Nx in Arduino libraries menu. Two exemples are provided with the library.
Get more details on Arduino libraries installation guide.
Here is an exemple of the minimal code to use the sensor. The programme display every second the measured long distance.
Read the documentation on the repository wiki here or you can generate it with Doxygen as follow.
After printing some ouput, you should get a html
folder. Then open index.html
in your favorite web browser. Of course, source code is commented.
This sensor supports Auto Detecting Parallel Architecture (ADPA) for sensors. This means that DIST-Nx can coexist with LEGO or third party digital sensors on a single I2C bus. This enables user to employ several sensors on the same bus without the need of external sensor multiplexer, reducing the overall size and cost. By default, the ADPA mode is disabled.