TOP Contributors

  1. MIKROE (2762 codes)
  2. Alcides Ramos (374 codes)
  3. Shawon Shahryiar (307 codes)
  4. jm_palomino (118 codes)
  5. Bugz Bensce (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 (139251 times)
  2. FAT32 Library (71749 times)
  3. Network Ethernet Library (57120 times)
  4. USB Device Library (47430 times)
  5. Network WiFi Library (43082 times)
  6. FT800 Library (42403 times)
  7. GSM click (29835 times)
  8. mikroSDK (28077 times)
  9. PID Library (26885 times)
  10. microSD click (26198 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

LED Driver 19 Click

Rating:

0

Author: MIKROE

Last Updated: 2024-10-31

Package Version: 2.1.0.7

mikroSDK Library: 2.0.0.0

Category: LED Drivers

Downloaded: 115 times

Not followed.

License: MIT license  

LED Driver 19 Click is a compact add-on board that simplifies the control of multiple LEDs. This board features the LED1202, a 12-channel low quiescent current LED driver from STMicroelectronics. It can output 5V, and each channel can provide up to 20mA with a headroom voltage of typically 350mW.

No Abuse Reported

Do you want to subscribe in order to receive notifications regarding "LED Driver 19 Click" changes.

Do you want to unsubscribe in order to stop receiving notifications regarding "LED Driver 19 Click" changes.

Do you want to report abuse regarding "LED Driver 19 Click".

  • Information
  • Comments (0)

mikroSDK Library Blog


LED Driver 19 Click

LED Driver 19 Click is a compact add-on board that simplifies the control of multiple LEDs. This board features the LED1202, a 12-channel low quiescent current LED driver from STMicroelectronics. It can output 5V, and each channel can provide up to 20mA with a headroom voltage of typically 350mW.

leddriver19_click.png

Click Product page


Click library

  • Author : Stefan Ilic
  • Date : Apr 2023.
  • Type : I2C type

Software Support

We provide a library for the LED Driver 19 Click as well as a demo application (example), developed using MikroElektronika compilers. The demo can run on all the main MikroElektronika development boards.

Package can be downloaded/installed directly from NECTO Studio Package Manager(recommended way), downloaded from our LibStock™ or found on Mikroe github account.

Library Description

This library contains API for LED Driver 19 Click driver.

Standard key functions :

  • leddriver19_cfg_setup Config Object Initialization function.

    void leddriver19_cfg_setup ( leddriver19_cfg_t *cfg );
  • leddriver19_init Initialization function.

    err_t leddriver19_init ( leddriver19_t *ctx, leddriver19_cfg_t *cfg );
  • leddriver19_default_cfg Click Default Configuration function.

    err_t leddriver19_default_cfg ( leddriver19_t *ctx );

Example key functions :

  • leddriver19_sw_reset LED Driver 19 software reset function.

    err_t leddriver19_sw_reset ( leddriver19_t *ctx );
  • leddriver19_enable_channels LED Driver 19 enables channels function.

    err_t leddriver19_enable_channels ( leddriver19_t *ctx, uint16_t channels_en );
  • leddriver19_set_pattern_pwm LED Driver 19 set pattern PWM value function.

    err_t leddriver19_set_pattern_pwm ( leddriver19_t *ctx, uint8_t pattern_sel, uint8_t channel_sel, float pwm_value );

Example Description

This library contains API for LED Driver 19 Click driver. The library initializes and defines the I2C bus drivers to write the default configuration for a PWM output value of the out pins.

The demo application is composed of two sections :

Application Init

Initializes the driver and performs default configuration, sets the device in output enabled mode and checks communication by reading device ID.


void application_init ( void ) 
{
    log_cfg_t log_cfg;  /**< Logger config object. */
    leddriver19_cfg_t leddriver19_cfg;  /**< Click config object. */

    /** 
     * Logger initialization.
     * Default baud rate: 115200
     * Default log level: LOG_LEVEL_DEBUG
     * @note If USB_UART_RX and USB_UART_TX 
     * are defined as HAL_PIN_NC, you will 
     * need to define them manually for log to work. 
     * See @b LOG_MAP_USB_UART macro definition for detailed explanation.
     */
    LOG_MAP_USB_UART( log_cfg );
    log_init( &logger, &log_cfg );
    log_info( &logger, " Application Init " );

    // Click initialization.
    leddriver19_cfg_setup( &leddriver19_cfg );
    LEDDRIVER19_MAP_MIKROBUS( leddriver19_cfg, MIKROBUS_1 );
    if ( I2C_MASTER_ERROR == leddriver19_init( &leddriver19, &leddriver19_cfg ) ) 
    {
        log_error( &logger, " Communication init." );
        for ( ; ; );
    }

    uint8_t device_id;

    leddriver19_read_reg( &leddriver19, LEDDRIVER19_REG_DEVICE_ID, &device_id );
    if ( LEDDRIVER19_DEVICE_ID != device_id )
    {
        log_error( &logger, " Communication error." );
        for ( ; ; );
    }

    if ( LEDDRIVER19_ERROR == leddriver19_default_cfg ( &leddriver19 ) )
    {
        log_error( &logger, " Default configuration." );
        for ( ; ; );
    }

    log_info( &logger, " Application Task " );
}

Application Task

This example demonstrates the use of the LED Driver 19 Click board by changing PWM values of all channels from maximum to minimum turning LEDs on and off in the process.

void application_task ( void ) 
{
    for ( uint8_t n_cnt = LEDDRIVER19_CH_SEL_0; n_cnt <= LEDDRIVER19_CH_SEL_11; n_cnt++ )
    {
        leddriver19_set_pattern_pwm( &leddriver19, LEDDRIVER19_PATSEL_0, n_cnt, 100  );
        Delay_ms ( 100 );
    }
    Delay_ms ( 1000 );

    for ( uint8_t n_cnt = LEDDRIVER19_CH_SEL_0; n_cnt <= LEDDRIVER19_CH_SEL_11; n_cnt++ )
    {
        leddriver19_set_pattern_pwm( &leddriver19, LEDDRIVER19_PATSEL_0, n_cnt, 0  );
        Delay_ms ( 100 );
    }
    Delay_ms ( 1000 );
}

The full application code, and ready to use projects can be installed directly from NECTO Studio Package Manager(recommended way), downloaded from our LibStock™ or found on Mikroe github account.

Other Mikroe Libraries used in the example:

  • MikroSDK.Board
  • MikroSDK.Log
  • Click.LEDDriver19

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. UART terminal is available in all MikroElektronika compilers.


ALSO FROM THIS AUTHOR

DC Motor 16 click

5

DC Motor 16 Click is a compact add-on board that contains a high-performance single phase reversible DC motor drive with speed control. This board features the ZXBM5210, a fully-featured DC motor drive solution with an average current capability of up to 700mA from Diodes Incorporated.

[Learn More]

DAC 9 Click

0

DAC 9 Click is a compact add-on board that contains a fully-featured, highly accurate digital-to-analog converter. This board features the DAC80501, a 16-bit voltage-output digital-to-analog converter with precision internal reference from Texas Instruments. It supports both I2C and SPI serial interface and offers a linearity of < 1 LSB. It also includes a 2.5V internal reference, giving full-scale output voltage ranges of 1.25V, 2.5V, or 5V, incorporate a Power-On Reset function, consume a low current of 1mA, and include a Power-Down feature that reduces current consumption to typically 15μA at 5V.

[Learn More]

Button R Click

0

Button R Click is the simplest solution for adding a single pushbutton to your design. The button itself is transparent, 6.8mm in diameter and has a red LED backlight. When pressed, it sends an interrupt signal to the target board microcontroller. The backlight LED is controlled separately through the mikroBUS PWM pin, so you can program all kinds of patterns (varying level of light intensity or rate of blinking on subsequent button presses). The board can use either a 3.3V or a 5V power supply.

[Learn More]