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-21
Package Version: 1.0.0.0
mikroSDK Library: 1.0.0.0
Category: Buck
Downloaded: 3718 times
Not followed.
License: MIT license
Light Temp Click is a dual-channel LED driver, designed to be used in tunable Smart Connected Lighting (SCL) applications. It is based on the AL1782, a dual-channel PWM dimmable linear LED driver.
Do you want to subscribe in order to receive notifications regarding "Light Temp click" changes.
Do you want to unsubscribe in order to stop receiving notifications regarding "Light Temp click" changes.
Do you want to report abuse regarding "Light Temp click".
Library Description
Library provides full control of the illumination for 2 LEDs. PWM functions are used to control the brightness temperature of the LEDs. The library also offers reading the current PG voltage score that serves to regulate lights and alerts.
Key functions:
uint16_t lighttemp_getPGVoltage()
- Reads PG output voltage.uint32_t lighttemp_pwmInit(uint8_t ledNum, uint16_t freq)
- PWM init functions.void lighttemp_pwmSetDuty(uint8_t ledNum, uint16_t duty)
- PWM set duty cycle.Examples description
The application is composed of the three sections :
Commands : '+' - Increase LED's light '-' - Decrease LED's light '1' - Set LED 1 on the active '2' - Set LED 2 on the active 'v' - Display current PG voltage
void applicationTask()
{
uint8_t dataReady_;
char receivedData_;
dataReady_ = UART_Rdy_Ptr( );
if (dataReady_ != 0)
{
receivedData_ = UART_Rd_Ptr( );
switch (receivedData_)
{
case '+' :
{
_increase();
break;
}
case '-' :
{
_decrease();
break;
}
case '1' :
{
_ledActive = 1;
mikrobus_logWrite( ">>> Active LED 1 ", _LOG_LINE );
break;
}
case '2' :
{
_ledActive = 2;
mikrobus_logWrite( ">>> Active LED 2 ", _LOG_LINE );
break;
}
case 'v' :
{
_currentPGVoltage();
break;
}
}
}
}
Additional Functions :
void _increase( )
- Increase LED's lightvoid _decrease( )
- Decrease LED's lightvoid _currentPGVoltage( )
- Reads and logs PG voltageOther mikroE Libraries used in the example:
I2C
PWM
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.