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-08-03
Package Version: 1.0.0.0
mikroSDK Library: 1.0.0.0
Category: Temperature & humidity
Downloaded: 1815 times
Not followed.
License: MIT license
Thermostat 4 Click is complete solution that senses the temperature of a physical system and can performs actions so that the system's temperature is maintained near a desired setpoint.
Do you want to subscribe in order to receive notifications regarding "Thermostat 4 click" changes.
Do you want to unsubscribe in order to stop receiving notifications regarding "Thermostat 4 click" changes.
Do you want to report abuse regarding "Thermostat 4 click".
Library Description
The library contains basic functions for working with Thermostat 4 click.
Key functions:
void thermostat4_relay_ctrl( uint8_t state )
- Relay Controluint8_t thermostat4_hot_alert_state( void )
- Hot temperature ALERTuint8_t thermostat4_warm_alert_state( void )
- Warm temperature ALERTExamples description
The application is composed of three sections :
void application_task ( )
{
if ( thermostat4_hot_alert_state( ) == THERMOSTAT4_HOT_ALERT )
{
mikrobus_logWrite( ">> H-O-T A-L-E-R-T <<", _LOG_LINE );
thermostat4_relay_ctrl( THERMOSTAT4_RELAY_ON );
}
if ( thermostat4_warm_alert_state( ) == THERMOSTAT4_WARM_ALERT )
{
mikrobus_logWrite( ">> W-A-R-M A-L-E-R-T <<", _LOG_LINE );
thermostat4_relay_ctrl( THERMOSTAT4_RELAY_ON );
}
mikrobus_logWrite( ">> T-E-M-P-E-R-A-T-U-R-E O-K <<", _LOG_LINE );
thermostat4_relay_ctrl( THERMOSTAT4_RELAY_OFF );
Delay_ms( 200 );
}
Other mikroE Libraries used in the example:
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.