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-06-06
Package Version: 1.0.0.1
mikroSDK Library: 1.0.0.0
Category: Temperature & humidity
Downloaded: 14875 times
Followed by: 2 users
License: MIT license
This code demonstrates how to use SHT1x click board in mikroBUS form factor. SHT11 sensor uses I2C communication and measures temperature and relative humidity.
Front and back view of SHT1x click board designed in mikroBUS form factor. mikroBUS is specially designed pinout standard with SPI, I2C, Analog, UART, Interrupt, PWM, Reset and Power supply pins.
View full imageLibrary Description
The library covers all the necessary functions to control SHT1x click board. SHT1x click board
communicates with the target board through the SDA and SCL lines. This library offers functions
for seting and clearing and checking the state of SDA and SCL lines. It also has functions that
perform calculations of temperature and humidity based on counted ticks.
Key functions:
float sht1x_calcTemp( uint16_t t )
- Function is used to calculate temperature.float sht1x_calcHumi( uint16_t h, uint16_t t )
- Function is used to calculate humidity. Examples description
The application is composed of the three sections :
void applicationTask() { sht1x_readResults( &temperature, &humidity ); mikrobus_logWrite( " Temperature: ", _LOG_TEXT ); FloatToStr( temperature, logText ); ltrim( logText ); mikrobus_logWrite( logText, _LOG_TEXT ); mikrobus_logWrite( degCel, _LOG_LINE ); mikrobus_logWrite( " Humidity: ", _LOG_TEXT ); FloatToStr( humidity, logText ); ltrim( logText ); mikrobus_logWrite( logText, _LOG_TEXT ); mikrobus_logWrite( "%", _LOG_LINE ); mikrobus_logWrite( "----------------------", _LOG_LINE ); Delay_ms( 1000 ); }
Additional Functions :
Other mikroE Libraries used in the example:
UART
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.
Board is set to use 3.3V power supply by default. Solder PWR SEL SMD jumper to 5V position if used with 5V systems.
View full imageOpto Encoder click is a linear incremental optical sensor/encoder click, which can be used for the movement or rotation encoding. Encoders of this type are widely used for many applications, which involve precise detection of the position, speed, or rotational angle of an object.
[Learn More]LR 10 Click is a compact add-on board designed for the Internet of Things (IoT) applications requiring low power consumption and long-range connectivity. This board features the Wio-E5, a LoRa wireless module from Seeed Technology. The Wio-E5 integrates the STM32WLE5JC system-level chip and the SX126X LoRa® chip alongside an Arm® Cortex® M4 MCU, ensuring ultra-low power usage and high performance. It supports multi-mode operations, including (G)FSK and LoRa®, and can operate across a frequency range of 868 to 928MHz with robust signal strength and sensitivity. These characteristics make the LR 10 Click ideal for various IoT scenarios, such as wireless sensor networks, remote meter readings, and other applications with crucial low-power, wide-area network connectivity.
[Learn More]The Knob G click is a Click Board which features a combination of high-quality quadrature rotary encoder, and a LED ring composed of 24 individual green LEDs.
[Learn More]You have unsaved changes. If you choose to leave all changes will be discarded.
Do you want to subscribe in order to receive notifications regarding "SHT1x click" changes.
Do you want to unsubscribe in order to stop receiving notifications regarding "SHT1x click" changes.
Do you want to report abuse regarding "SHT1x click".