TOP Contributors

  1. MIKROE (2656 codes)
  2. Alcides Ramos (353 codes)
  3. Shawon Shahryiar (307 codes)
  4. jm_palomino (112 codes)
  5. Chisanga Mumba (90 codes)
  6. S P (73 codes)
  7. dany (71 codes)
  8. MikroBUS.NET Team (35 codes)
  9. NART SCHINACKOW (34 codes)
  10. Armstrong Subero (27 codes)

Most Downloaded

  1. Timer Calculator (136838 times)
  2. FAT32 Library (69993 times)
  3. Network Ethernet Library (55976 times)
  4. USB Device Library (46291 times)
  5. Network WiFi Library (41895 times)
  6. FT800 Library (41204 times)
  7. GSM click (29011 times)
  8. PID Library (26422 times)
  9. mikroSDK (26391 times)
  10. microSD click (25384 times)
Libstock prefers package manager

Package Manager

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]

< Back
mikroSDK Library

Light Temp click

Rating:

5

Author: MIKROE

Last Updated: 2019-03-21

Package Version: 1.0.0.0

mikroSDK Library: 1.0.0.0

Category: Buck

Downloaded: 3119 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.

No Abuse Reported

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".

  • mikroSDK Library 2.0.0.0
  • Comments (0)
DOWNLOAD LINK RELATED COMPILER CONTAINS
mikroBasic PRO for ARM
  • lib
  • src
  • exa
  • hlp
  • hex
  • sch
  • pcb
  • doc
mikroBasic PRO for AVR
  • lib
  • src
  • exa
  • hlp
  • hex
  • sch
  • pcb
  • doc
mikroBasic PRO for dsPIC30/33 & PIC24
  • lib
  • src
  • exa
  • hlp
  • hex
  • sch
  • pcb
  • doc
mikroBasic PRO for FT90x
  • lib
  • src
  • exa
  • hlp
  • hex
  • sch
  • pcb
  • doc
mikroBasic PRO for PIC
  • lib
  • src
  • exa
  • hlp
  • hex
  • sch
  • pcb
  • doc
mikroBasic PRO for PIC32
  • lib
  • src
  • exa
  • hlp
  • hex
  • sch
  • pcb
  • doc
mikroC PRO for ARM
  • lib
  • src
  • exa
  • hlp
  • hex
  • sch
  • pcb
  • doc
mikroC PRO for AVR
  • lib
  • src
  • exa
  • hlp
  • hex
  • sch
  • pcb
  • doc
mikroC PRO for dsPIC30/33 & PIC24
  • lib
  • src
  • exa
  • hlp
  • hex
  • sch
  • pcb
  • doc
mikroC PRO for FT90x
  • lib
  • src
  • exa
  • hlp
  • hex
  • sch
  • pcb
  • doc
mikroC PRO for PIC
  • lib
  • src
  • exa
  • hlp
  • hex
  • sch
  • pcb
  • doc
mikroC PRO for PIC32
  • lib
  • src
  • exa
  • hlp
  • hex
  • sch
  • pcb
  • doc
mikroPascal PRO for ARM
  • lib
  • src
  • exa
  • hlp
  • hex
  • sch
  • pcb
  • doc
mikroPascal PRO for AVR
  • lib
  • src
  • exa
  • hlp
  • hex
  • sch
  • pcb
  • doc
mikroPascal PRO for dsPIC30/33 & PIC24
  • lib
  • src
  • exa
  • hlp
  • hex
  • sch
  • pcb
  • doc
mikroPascal PRO for FT90x
  • lib
  • src
  • exa
  • hlp
  • hex
  • sch
  • pcb
  • doc
mikroPascal PRO for PIC
  • lib
  • src
  • exa
  • hlp
  • hex
  • sch
  • pcb
  • doc
mikroPascal PRO for PIC32
  • lib
  • src
  • exa
  • hlp
  • hex
  • sch
  • pcb
  • doc

mikroSDK Library Blog

 Light Temp Click

Light Temp Click

Native view of the Light Temp Click board.

View full image
Light Temp Click

Light Temp Click

Front and back view of the Light Temp Click board.

View full image

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 :

  • System Initialization - Initialization I2C module, sets INT pin as INPUT, PWM pin and CS pin as OUTPUT
  • Application Initialization - Initialization driver init and pwm init for all LED's
  • Application Task - Waits for valid user input and executes functions based on set of valid commands

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 light
  • void _decrease( ) - Decrease LED's light
  • void _currentPGVoltage( ) - Reads and logs PG voltage

Other 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 clickUSB 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.

ALSO FROM THIS AUTHOR

PS/2 click

5

Simple demonstration of using PS/2 communication protocol. Example detects keyboard press and writes the corresponding key on UART.

[Learn More]

USB SPI click - Example

0

This is a sample program which demonstrates the use of USB SPI click This device accepts commands from SPI Terminal and sends appropriate bytes via SPI interface. It is very desirable tool for designing SPI slave devices such as sensors...

[Learn More]

mikroSDK

5

mikroSDK is the new software development kit used to bridge the gap between different development systems. Once developed, the code will work on any hardware platform which has mikroBUS and is supported by the mikroSDK. Easy to start, fast to learn, time saving, and open source - we designed mikroSDK with developers in mind.

[Learn More]