UNPKG

jvsveml6070

Version:

Node.js package for the Vishay VEML6070 UVA Light Sensor, written in TypeScript.

26 lines (17 loc) 2.41 kB
# JVSVEML6070 Node.js package for the Vishay VEML6070 UVA Light Sensor, written in TypeScript. ## Requirements * [Node.js](https://nodejs.org/) 16.16.0 or later * [Vishay VEML6070 UVA Light Sensor with I<sup>2</sup>C Interface](https://www.vishay.com/optical-sensors/digital-uva-sensor/) connected to for example a [Raspberry Pi](https://www.raspberrypi.org) ## Dependencies This package only depends on the [`i2c-bus`](https://www.npmjs.com/package/i2c-bus) package. Please refer to the `package.json` file for a list of development dependencies. ## Documentation [TSDoc](https://tsdoc.org) is used throughout the code. The `docs` directory contains documentation automatically generated by [TypeDoc](https://typedoc.org). Thanks to [GitHub Pages](https://pages.github.com), you can quickly browse the documentation [here](https://jorisvervuurt.github.io/jvsveml6070) as well. ## Usage The API is mostly asynchronous; most functions return a `Promise` that resolves when the function has finished successfully. This means that you'll need to use `.then` / `.catch` or `async` / `await`. The `examples` directory contains examples that demonstrate both approaches. Please refer to the [Vishay VEML6070 datasheet](https://www.vishay.com/docs/84277/veml6070.pdf), [Vishay VEML6070 Application Note](https://www.vishay.com/docs/84310/designingveml6070.pdf) and this package's documentation for more information about configuration options and other usage notes. **Important note**: depending on the use case, you may need to provide a custom <sup>R</sup>SET resistor value (in kΩ, defaults to 270kΩ) and/or I<sup>2</sup>C bus number (defaults to 1). ## License Copyright (c) 2021-2022 Joris Vervuurt Software Permission to use, copy, modify, and/or distribute this software for any purpose with or without fee is hereby granted, provided that the above copyright notice and this permission notice appear in all copies. THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.