led_get_actual — Get actual LED intensity and duty length


fix32 led_get_actual(<LED_IDENTIFIER>, uint32 *dutylength);

Retrieve the original intensity and duty length values of the LED identified by <LED_IDENTIFIER>.

led_get_actual() will always return the original values, even if led_set() is used to set an new intensity and duty length.


  • <LED_IDENTIFIER>: An valid LED identifier LED_1, LED_2, LED_3 or LED_4. Note: the LED identifier is passed as direct parameter of the led_get_actual() opcode, therefore stack values can't be used.
  • dutylength: Address of an uint32 variable to receive the duty length value. This parameter can be NULL.

Return Value

The LED intensity in percentage, from 0.00 to 100.00 (%).


Example #1 led_get_actual() example

init {
    uint32 dutylength;
    if(led_get_actual(LED_1, &dutylength) < 85.0 || dutylength != 0) {
        led_set(LED_1, 90.0, 0);

See Also

t2/led_get_actual.txt · Last modified: 2016/11/29 06:56 by J2Kbr