TOP Contributors

  1. MIKROE (2752 codes)
  2. Alcides Ramos (372 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 (139071 times)
  2. FAT32 Library (71594 times)
  3. Network Ethernet Library (56989 times)
  4. USB Device Library (47330 times)
  5. Network WiFi Library (43006 times)
  6. FT800 Library (42297 times)
  7. GSM click (29777 times)
  8. mikroSDK (27874 times)
  9. PID Library (26859 times)
  10. microSD click (26129 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 Flash 2 click

Rating:

5

Author: MIKROE

Last Updated: 2018-02-14

Package Version: 1.0.0.0

mikroSDK Library: 1.0.0.0

Category: LED segment

Downloaded: 5919 times

Not followed.

License: MIT license  

LED Flash 2 click is a powerful flash or torch click, featuring the MIC2870, a high-efficiency flash LED driver, optimized for driving one or two high-brightness camera flash LEDs. The MIC2870 IC can drive one high brightness LED up to 1.5A or two high brightness LEDs, up to 750mA each.

No Abuse Reported

Do you want to subscribe in order to receive notifications regarding "LED Flash 2 click" changes.

Do you want to unsubscribe in order to stop receiving notifications regarding "LED Flash 2 click" changes.

Do you want to report abuse regarding "LED Flash 2 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

LED Flash 2 click

LED Flash 2 click

Native view of the LED Flash click board.

View full image
LED Flash 2 click

LED Flash 2 click

Front and back view of the LED Flash click board.

View full image

Library Description

Library for LED Flash 2 click contains generic read / write functions. The library also contains control function (setMode), that can set click into any of the possible modes of operation, as well as a function that can toggle Flash inhibit pin on/off. 

Besides the mode parameter used to set the working mode of the click, the LED current is also forwarded to the functions as the parameter by means of constants, that are named according to the percentage of the current they are used to set - e.g. _LEDFLASH2_CUR_100 will not scale down the current and it will be 100% of what is set by the current limiting resistors on the click board. When using the FLASH mode (_LEDFLASH2_MODE_FLASH), another function parameter (_LEDFLASH2_FTMR_312) is used and it represents the safety timer, after which the LEDs will get turned off, to prevent damage. Otherwise it can be set to 0.

Key functions

uint8_t ledflash2_readRegister(uint8_t regAddress) - Generic read register function

void ledflash2_writeRegister(uint8_t regAddress, uint8_t regData) - Generic write register function

ledflash2_setMode(_LEDFLASH2_MODE_FLASH, _LEDFLASH2_CUR_100, _LEDFLASH2_FTMR_312);- Sets the operation mode

void ledflash2_toggleFlashInhibit(uint8_t pinState) - Toggles the Flash inhibit pin on/off

Examples description

The application is composed of three sections:

  • System Initialization - Initializes pins, I2C peripheral, and logger.

  • Application Initialization - Initializes driver, and sets the click into "OFF"

  • Application Task - (Code snippet) This function will demonstrate how to use the flash mode, and the torch mode, with different power settings. It will then turn the click off

IMPORTANT NOTE: LED lights can be very bright, even with the lowest power settings. Avoid looking directly into the light, when working with the click.

    Delay_ms(1000);
    mikrobus_logWrite("Do not look directly into the led lights.", _LOG_LINE);
    mikrobus_logWrite("Triggering flash in 5...", _LOG_LINE);
    Delay_ms(1000);
    mikrobus_logWrite("4...", _LOG_LINE);
    Delay_ms(1000);
    mikrobus_logWrite("3...", _LOG_LINE);
    Delay_ms(1000);
    mikrobus_logWrite("2...", _LOG_LINE);
    Delay_ms(1000);
    mikrobus_logWrite("1...", _LOG_LINE);
    Delay_ms(1000);
    mikrobus_logWrite("Cheese!", _LOG_LINE);
    
    ledflash2_setMode(_LEDFLASH2_MODE_FLASH, _LEDFLASH2_CUR_100, _LEDFLASH2_FTMR_312);
    
    Delay_ms(350);
    ledflash2_setMode(_LEDFLASH2_MODE_OFF, 0, 0);
    Delay_ms(2000);
    mikrobus_logWrite("Switching to the torch mode in a moment...", _LOG_LINE);
    Delay_ms(2000);
    ledflash2_setMode(_LEDFLASH2_MODE_TORCH, _LEDFLASH2_CUR_100, 0);
    Delay_ms(5000);
    mikrobus_logWrite("Dimming the torch light...", _LOG_LINE);
    ledflash2_setMode(_LEDFLASH2_MODE_TORCH, _LEDFLASH2_CUR_18, 0);
    Delay_ms(5000);
    mikrobus_logWrite("Switching off...", _LOG_LINE);
    ledflash2_setMode(_LEDFLASH2_MODE_OFF, 0, 0);

Additional notes and information

Depending on the development board you are using, you may need USB UART clickUSB 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.

ALSO FROM THIS AUTHOR

SPI Isolator 8 Click

0

SPI Isolator 8 Click is a compact add-on board representing a digital isolator optimized for a serial peripheral interface. This board features the ISOW7743, a quad-channel digital isolator from Texas Instruments. This device has a maximum data rate of 100Mbps and transfers digital signals between circuits with different power domains featuring reinforced isolation for a withstand voltage rating of 5kVRMS for 60 seconds.

[Learn More]

MiWi 2 click

0

MiWi 2 click is a sub-gigahertz radio transceiver click board, which offers a reliable FSK or OOK communication solution, with the maximum data rates of 200kbps and 40kbps, respectively.

[Learn More]

Accel 27 Click

0

Accel 27 Click is a compact add-on board that contains an acceleration sensor. This board features the ADXL373, a three-axis MEMS ±400g accelerometer from Analog Devices. In addition to its ultra-low power consumption, the ADXL373 enables impact detection while providing system-level power reduction. It offers 12-bit output data at 200mg/LSB scale factor with a configurable host interface that supports SPI and I2C serial communication.

[Learn More]