VCNL4010
v1.1.0
Arduino Library for VCNL4010
|
Class definition header for the VCNL4010 chip from Vishay Semiconductors. This is a Fully Integrated Proximity and Ambient Light Sensor with Infrared Emitter, I2C Interface and Interrupt Function. The data sheet for the VCNL4010 can be found at http://www.vishay.com/docs/83462/vcnl4010.pdf and there is a breakout board from Adafruit with additional information located at https://www.adafruit.com/product/466.
The library is documented at https://github.com/Zanduino/VCNL4010/wiki
When the class is instantiated the default mode is to have triggered readings for the ambient light sensor as well as for the proximity sensor. In order to speed up processing the class will trigger the two types of measurements preemptively, meaning that as soon that either of the results have been read the next measurement is started automatically. If the continuous mode is activated for either of the ambient or proximity sensors then no specific measurements are triggered since the device takes care of that internally.
This library is built with the standard "Doxyfile", which is located at https://github.com/Zanduino/Common/blob/main/Doxygen. As described on that page, there are only 5 environment variables used, and these are set in the project's actions file, located at https://github.com/Zanduino/VCNL4010/blob/master/.github/workflows/ci-doxygen.yml Edit this file and set the 5 variables: PRETTYNAME, PROJECT_NAME, PROJECT_NUMBER, PROJECT_BRIEF and PROJECT_LOGO so that these values are used in the doxygen documentation. The local copy of the doxyfile should be in the project's root directory in order to do local doxygen testing, but the file is ignored on upload to GitHub.
Part of the GitHub actions for CI is running every source file through "clang-format" to ensure that coding formatting is done the same for all files. The configuration file ".clang-format" is located at https://github.com/Zanduino/Common/tree/main/clang-format and this is used for CI tests when pushing to GitHub. The local file, if present in the root directory, is ignored when committing and uploading.
This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program. If not, see http://www.gnu.org/licenses/.
Written by Arnd Arnd@ at Zand uino. Comhttps://www.github.com/SV-Zanshin
Version | Date | Developer | Comments |
---|---|---|---|
1.1.0 | 2020-12-25 | SV-Zanshin | Issue #14 - Corrected I2C reads, cleaned up examples |
1.0.8 | 2019-01-24 | SV-Zanshin | Issue #9 - Doxygen Documentation and Travis-CI changes |
1.0.8 | 2018-07-22 | SV-Zanshin | Corrected I2C Datatypes |
1.0.8 | 2018-07-02 | SV-Zanshin | Added guard code against multiple I2C constant definitions |
1.0.8 | 2018-06-29 | SV-Zanshin | Issue #8 I2C speed slct |
1.0.5 | 2017-09-02 | SV-Zanshin | Added option to begin() to allow for different I2C Address |
1.0.5c | 2017-09-01 | SV-Zanshin | Re-introduced 170?s delay in I2C read statements after hangs |
1.0.5b | 2017-08-31 | SV-Zanshin | Removed 170?s delay in I2C read statements |
1.0.5a | 2017-08-31 | Koepel | Issue #4 |
1.0.4 | 2017-08-29 | SV-Zanshin | Changed method on I2C reads to avoid hang w/out extra call |
1.0.3a | 2017-08-29 | Danny24 | Corrected potential I2C hang condition when no device present |
1.0.2 | 2017-07-31 | SV-Zanshin | Removed default definitions from function definitions, kept them in the prototype definitions as this caused compiler errors on non-Windows based machines |
1.0.1 | 2017-01-02 | SV-Zanshin | Moved readByte function back into private area |
1.0.0 | 2017-01-01 | SV-Zanshin | Fixed error on continuous mode with proximity |
1.0.b2 | 2016-12-31 | SV-Zanshin | Continued coding |
1.0.b1 | 2016-12-30 | SV-Zanshin | Created class |