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-08-02
Package Version: 1.0.0.0
mikroSDK Library: 1.0.0.0
Category: Optical
Downloaded: 3651 times
Not followed.
License: MIT license
Ambient 3 Click is calibrated XYZ chromatic smart lighting director, providing the measurement data in digital format over the I2C interface. It utilizes the AS7225, a miniature light sensor with UART and I2C interfaces.
Do you want to subscribe in order to receive notifications regarding "Ambient 3 click" changes.
Do you want to unsubscribe in order to stop receiving notifications regarding "Ambient 3 click" changes.
Do you want to report abuse regarding "Ambient 3 click".
Library Description
Library initializes and defines I2C bus driver and driver functions which offer a choice to write data in registers and to read data from registers. Library also offers a choice to reads device temperature and ambient light in LUX. The user also has the function for reset chip and function for read interrupt state.
Key functions:
uint8_t ambient3_readByte(uint8_t virtualReg)
- Function for reads one byte.uint8_t ambient3_getDeviceTemperature()
- Function for reading device temperature.float ambient3_getDataInLUX()
- Function for reads Light data in LUX.Examples description
The application is composed of three sections :
void applicationTask()
{
mikrobus_logWrite(" - Device temperature : ", _LOG_TEXT);
Temperature = ambient3_getDeviceTemperature();
IntToStr(Temperature, demoText_Temp);
mikrobus_logWrite(demoText_Temp, _LOG_LINE);
mikrobus_logWrite(" - Light in LUX : ", _LOG_TEXT);
dataLUX = ambient3_getDataInLUX();
FloatToStr(dataLUX, demoText_dataLUX);
mikrobus_logWrite(demoText_dataLUX, _LOG_LINE);
Delay_ms(1000);
}
Other mikroE Libraries used in the example:
Additional notes and informations
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.