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: 2018-07-10
Package Version: 1.0.0.0
mikroSDK Library: 1.0.0.0
Category: Temperature & humidity
Downloaded: 4751 times
Not followed.
License: MIT license
Moisture click is a Click board that can be used to easily detect a moisture level of the skin, by simply touching the sensitive surface of the PCB.
Do you want to subscribe in order to receive notifications regarding "Moisture click" changes.
Do you want to unsubscribe in order to stop receiving notifications regarding "Moisture click" changes.
Do you want to report abuse regarding "Moisture click".
Library Description
The library initializes and defines the I2C bus driver and drivers that offer a choice for writing data in the register. The library includes a function for calibration chip for measurement, a function for reading moisture data. The user also has the function for initializes chip, set offset, gain and clock divider and software reset.
Key functions :
uint8_t moisture_init(uint16_t gain, uint16_t offset, uint16_t clk_div)
- Functions for initialize the chip
uint8_t moisture_getData()
- Functions for measurement data in percent.
void moisture_calibration()
- Functions for calibration chip for measurement
Example description
The application is composed of three sections :
void applicationTask()
{
mikrobus_logWrite(" Moisture data : ", _LOG_TEXT);
moistureData = moisture_getData();
IntToStr(moistureData, demoText);
mikrobus_logWrite(demoText, _LOG_LINE);
Delay_ms( 500 );
}
Other mikroE Libraries used in the example:
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.