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-03-13
Package Version: 1.0.0.1
mikroSDK Library: 1.0.0.0
Category: Temperature & humidity
Downloaded: 5459 times
Not followed.
License: MIT license
THERMO 4 click carries the LM75A digital temperature sensor and thermal watchdog. The sensor has the range from −55 °C to +125 °C. The click is designed to run on either 3.3V or 5V power supply. It communicates with the target microcontroller over I2C interface
Do you want to subscribe in order to receive notifications regarding "Thermo 4 click" changes.
Do you want to unsubscribe in order to stop receiving notifications regarding "Thermo 4 click" changes.
Do you want to report abuse regarding "Thermo 4 click".
Library Description
The library initializes and defines the I2C bus driver and drivers that offer a choice for writing and reading
data in and from registers. The library includes a functions for reading temperature in Fahrenheit, Celsius
and Kelvin scales, user can also read or set configuration and read or set overtemperature shutdown threshold and hysteresis temperature. Library also has generic read/write functions for additional read and write operations.
Key functions:
float thermo4_readTemperatureF();
- Function reads sensor and returns result value representing current temperature in degrees fahrenheit.Examples description
The application is composed of three sections:
void applicationTask() { value1 = thermo4_readTemperatureC(); Delay_10ms(); value2 = thermo4_readTemperatureF(); Delay_10ms(); value3 = thermo4_readTemperatureK(); Delay_10ms(); mikrobus_logWrite( " Temperature celsius : ", _LOG_TEXT ); logDisplay( value1 ); mikrobus_logWrite( degCel, _LOG_LINE ); mikrobus_logWrite( " Temperature fahrenheit : ", _LOG_TEXT ); logDisplay( value2 ); mikrobus_logWrite( degFar, _LOG_LINE ); mikrobus_logWrite( " Temperature kelvin : ", _LOG_TEXT ); logDisplay( value3 ); mikrobus_logWrite( "K", _LOG_LINE ); mikrobus_logWrite( "---------------------------------", _LOG_LINE ); Delay_1sec(); }
Other mikroE Libraries used in the example:
I2C
UART
Conversion
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