# CAMERA_SetLED*

## Syntax

  `#include <twl/camera.h>`
  `CAMERAResult CAMERA_SetLED(BOOL isBlink);`
  `CAMERAResult CAMERA_SetLEDAsync(BOOL isBlink, CAMERACallback callback, void *arg);`

## Arguments

isBlink | Specify `TRUE` for blinking light and `FALSE` for steady light.
callback | Function that is called when asynchronous processing has completed.
arg | Arguments when the callback function is invoked.

## Return Values

Returns `CAMERA_RESULT_SUCCESS` if configuration was successful.

## Description

Toggles the outer camera indicator LED between a blinking light and a steady light.
The camera indicator LED lights up with a steady light when the outer camera is activated. Once it has lit up, you can call this function to switch the LED between steady light and blinking light.
Note that this function therefore fails if the outer camera is not active.
The blinking light cycle starts from the unlit state, and the LED can transition from blinking light to steady light only from the lit state. As a result, even if the camera indicator LED is toggled to blinking light and then immediately toggled back to steady light, the LED invariably blinks once anyway.
When the LED blinks, the light is off and then on for a duration of approximately 0.8 seconds each. This varies by about 5% due to differences in individual cameras.
If the LED is toggled to blink, and then, in less than 6 ms, toggled to steady light, there is no guarantee that the LED will blink once. Therefore, if you try to toggle the LED to blink and then back to steady light in less than 6 ms, the library ensures that at least 6 ms transpire. The elapsed time is measured from the call to `CAMERA_SetLED(TRUE)` to the return from the call to `CAMERA_SetLED(FALSE)`.
For example, if you call `CAMERA_SetLED(FALSE)` 3 ms after `CAMERA_SetLED(TRUE)` is called, it will take an additional (6-3 = 3) ms to return from `CAMERA_SetLED(FALSE)`.

## See Also

`CAMERA_I2CActivate*`

## Revision History

2009/06/08 Explained the time it takes to blink, and the function's timing.
2009/04/15 Explained that execution is blocked inside the function when FALSE has been specified.
2008/05/23 Initial version

CONFIDENTIAL