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-01-15
Package Version: 1.0.0.1
mikroSDK Library: 1.0.0.0
Category: Temperature & humidity
Downloaded: 4140 times
Not followed.
License: MIT license
Thermostat click carries the MAX7502 IC digital temperature sensor, that also provides an overtemperature alarm/interrupt/shutdown output, and an SN74LVC1G126 single bus buffer from Texas Instruments. MAX7502 IC can measure temperatures from -25°C to +100°C, within the accuracy of ±1.5°C.
Do you want to subscribe in order to receive notifications regarding "Thermostat click" changes.
Do you want to unsubscribe in order to stop receiving notifications regarding "Thermostat click" changes.
Do you want to report abuse regarding "Thermostat click".
Library Description
The library covers all the necessary functions to control Thermostat Click board. Library performs the communication with the device via I2C driver by writting to registers and by reading from registers. Library have generic write and read function, function for set configuration, temperature hysterezis and referent temperature, function for get temperature value, etc. Function who gets temperature also converts temperature data to degree Celsius [ °C ] and Fahrenheit [ °F ].
Key functions:
float thermostat_getTemperature()
- Get temperature in degrees Celsius function.void thermostat_setConfiguration( uint16_t configValue )
- Set configuration function.void thermostat_setTempHyst( int8_t tempHyst )
- Set temperature hysterezis function.Examples description
The application is composed of the three sections :
void applicationTask() { temperature = thermostat_getTemperature(); FloatToStr( temperature, logText ); mikrobus_logWrite( " Temperature : ", _LOG_TEXT ); mikrobus_logWrite( logText, _LOG_TEXT ); mikrobus_logWrite( " °C", _LOG_LINE ); if ( ( temperature < limitMax ) && ( temperature > limitMin ) ) { thermostat_switchOn(); } else { thermostat_switchOff(); } mikrobus_logWrite( "----------------------", _LOG_LINE ); Delay_ms( 2000 ); }
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.