User Tools

Site Tools


t2:led_get

led_get


led_get — Get LED intensity and duty length

Description


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

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

If the intensity and duty length were programmatically set by led_set(), led_get() will return the values programmatically set.

Parameters


  • <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() 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 (%).

Examples


Example #1 led_get() example

main {
    if(led_get(LED_1, NULL) < 50.0) {
        led_set(LED_1, 50.0, 0);
    }
}

See Also

t2/led_get.txt · Last modified: 2016/11/29 06:47 by J2Kbr