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: 2020-03-17
Package Version: 1.0.0.1
mikroSDK Library: 1.0.0.0
Category: Optical
Downloaded: 5352 times
Not followed.
License: MIT license
Smoke click carries the MAX30105 high-sensitivity optical sensor for smoke detection. The click is designed to run on either 3.3V or 5V power supply. It communicates with the target MCU over I2C interface with additional functionality provided by the INT pin on the mikroBUS line.
Do you want to subscribe in order to receive notifications regarding "Smoke click" changes.
Do you want to unsubscribe in order to stop receiving notifications regarding "Smoke click" changes.
Do you want to report abuse regarding "Smoke click".
Library Description
The library covers all the necessary functions that enables the usage of the Smoke Click board. It initializes and defines the I2C bus driver and drivers that offer a choice for writing and reading and setting a new value. Also, user can set, clear or check many different interrupts, as well as read and write into and from FIFO register.
Key functions:
void smoke_enableDataRdy()
- Function is used to enable FIFO data ready interrupt.uint32_t smoke_getGreenVal()
- Function is used to read the oldest Green value.void smoke_readFifoData( uint32_t *redRes, uint32_t *irRes, uint32_t *grnRes )
- Function is used to burst read the FIFO register.Examples description
The application is composed of the three sections :
void applicationTask( ) { if( smoke_getInt1() & 0x40 ) grnVal = smoke_getGreenVal(); LongWordToStr( grnVal, logTxt ); Ltrim( logTxt ); mikrobus_logWrite( "GREEN LED Pulse Amplitude : ", _LOG_TEXT ); mikrobus_logWrite( logTxt, _LOG_LINE ); mikrobus_logWrite( "------------------------------", _LOG_LINE ); temperature = smoke_readTempC(); FloatToStr( temperature, logTxt ); Ltrim( logTxt ); mikrobus_logWrite( "Read Temperature : ", _LOG_TEXT ); mikrobus_logWrite( logTxt, _LOG_TEXT ); mikrobus_logWrite( degCel, _LOG_LINE ); mikrobus_logWrite( "------------------------------", _LOG_LINE ); mikrobus_logWrite( "______________________________", _LOG_LINE ); }
Other mikroE Libraries used in the example:
I2C
UART
Conversions
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.