TOP Contributors

  1. MIKROE (2639 codes)
  2. Alcides Ramos (347 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 (136094 times)
  2. FAT32 Library (69395 times)
  3. Network Ethernet Library (55671 times)
  4. USB Device Library (45938 times)
  5. Network WiFi Library (41608 times)
  6. FT800 Library (40700 times)
  7. GSM click (28760 times)
  8. PID Library (26312 times)
  9. mikroSDK (25992 times)
  10. microSD click (25089 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: 3006 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

ADC 4 click

5

ADC 4 click is an advanced analog to digital multi-channel converter, which can sample inputs from 16 single-ended channels or 8 differential input channel pairs.

[Learn More]

Barcode 2 click

0

Barcode 2 Click is an adapter add-on board that contains a computerized image recognition system that is compliant with a wide range of different 1D and 2D barcode protocols.

[Learn More]

6DOF IMU 2 click

3

6DOF IMU 2 click is a mikroBUS add-on board with Bosch's BMI160 low power inertial measurement unit (IMU). The BMI160 is capable of precise acceleration and angular rate (gyroscopic) measurement. 6DOF IMU 2 click communicates with the target MCU through the I2C or SPI bus (user-selectable).

[Learn More]