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-02-07
Package Version: 1.0.0.0
mikroSDK Library: 1.0.0.0
Category: Relay
Downloaded: 4462 times
Not followed.
License: MIT license
Relay click 3 is a dual relay Click board, featuring two single-pole double-throw relays which can be operated by output pins of the host microcontroller (MCU).
Do you want to subscribe in order to receive notifications regarding "Relay 3 click" changes.
Do you want to unsubscribe in order to stop receiving notifications regarding "Relay 3 click" changes.
Do you want to report abuse regarding "Relay 3 click".
Library Description
The library contains functions for turning on/off relays 1 and 2. Library contains functions for turning on/off relays 1 and 2 after a defined period of time.
Key functions:
void relay3_relayOn( uint8_t relay_ )
- Turns selected relay on.void relay3_relayOff( uint8_t relay_ )
- Turns selected relay off.void relay3_onDelay( uint8_t relay_, uint8_t units_, uint16_t time_ )
- Turns selected relay on after a defined period of time in selected units of time.void relay3_offDelay( uint8_t relay_, uint8_t units_, uint16_t time_ )
- Turns selected relay off after a defined period of time in selected units of time.Examples description
The application is composed of three sections :
void applicationTask( )
{
dataReady = UART_Rdy_Ptr( );
if (dataReady != 0)
{
receivedData = UART_Rd_Ptr( );
switch (receivedData)
{
case '1' :
{
relay3_case1( );
break;
}
case '2' :
{
relay3_case2( );
break;
}
case '3' :
{
relay3_case3( );
break;
}
default :
{
mikrobus_logWrite( "wrong command", _LOG_LINE );
break;
}
}
}
}
Additional Functions
void relay3_case1()
- Turns relay 1 on/offvoid relay3_case2()
- Turns relay 2 on/offvoid relay3_case3()
- Turns relay 3 on/offOther 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 clickor 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.