We strongly encourage users to use Package manager for sharing their code on Libstock website, because it boosts your efficiency and leaves the end user with no room for error. [more info]
Rating:
Author: MIKROE
Last Updated: 2019-01-10
Package Version: 1.0.0.1
mikroSDK Library: 1.0.0.0
Category: Optical
Downloaded: 4561 times
Not followed.
License: MIT license
UV 2 click is a mikroBUS add-on board with a VEML6075 UVA and UVB light sensor.
With UV 2 click, Solar ultraviolet light intensity is converted to 16-bit digital values.
The board communicates with the target MCU through the mikroBUS I2C interface. Designed to use a 3.3 power supply only.
Do you want to subscribe in order to receive notifications regarding "UV 2 click" changes.
Do you want to unsubscribe in order to stop receiving notifications regarding "UV 2 click" changes.
Do you want to report abuse regarding "UV 2 click".
Library Description
The library covers all the necessary functions to control UV 2 Click board.
UV 2 click communicates with the target board via I2C protocol.
This library contains drivers for write data to and read data from VEML6075 sensor registers,
enable/disable sensor, set configuration, get measurement UV index, etc.
Key functions:
uint16_t uv2_getUVA()
- Get UVA data function.uint16_t uv2_getUVB()
- Get UVB data function.float uv2_getUVindex()
- Get UV index function.Examples description
The application is composed of the three sections :
void applicationTask() { valUVA = uv2_getUVA(); IntToStr( valUVA, logText ); ltrim( logText ); mikrobus_logWrite( " UVA data = ", _LOG_TEXT ); mikrobus_logWrite( logText, _LOG_LINE ); valUVB = uv2_getUVB(); IntToStr( valUVB, logText ); ltrim( logText ); mikrobus_logWrite( " UVB data = ", _LOG_TEXT ); mikrobus_logWrite( logText, _LOG_LINE ); uvIndex = uv2_getUVindex(); FloatToStr( uvIndex, logText ); ltrim( logText ); mikrobus_logWrite( " UV Index = ", _LOG_TEXT ); mikrobus_logWrite( logText, _LOG_LINE ); mikrobus_logWrite( "------------------------", _LOG_LINE ); Delay_ms( 2000 ); }
Other mikroE Libraries used in the example:
I2C
UART
Additional notes and information
Depending on the development board you are using, you may need USB UART click, USB UART 2 click or RS232 click to connect to your PC, for development systems with no UART to USB interface available on the board. The terminal available in all MikroElektronika compilers, or any other terminal application of your choice, can be used to read the message.