t2:led_vmset

led_vmset


led_vmset — Blink LED

Description


void led_vmset(<LED_IDENTIFIER>, uint16 on, uint16 off, int16 count);

Blink the LED identified by <LED_IDENTIFIER> according the on, off and count parameters.

led_vmset() controls the LED on/off state internally and does not depend on the controller capabilities to blink the player LEDs.
ATTENTION: The led_vmset() should NOT be called on every interaction of main.
Depending on the “Device Lightbar” option in device settings, the led_vmset() also have effect on the Titan Two lightbar.

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_vmset() opcode, therefore stack values can't be used.
  • on: How long, in milli-seconds, the LED should be kept in the state “on” during the duty cycle period.
  • off: How long, in milli-seconds, the LED should be kept in the state “off” during the duty cycle period.
  • count: How many duty cycle periods should be executed. Pass an negative value to repeat the duty period indefinitely.

Return Value


No value is returned.

Examples


Example #1 led_vmset() example

init {
    // Blink LED_1 indefinitely
    led_vmset(LED_1, 250, 250, -1);
}

See Also

t2/led_vmset.txt · Last modified: 2016/11/29 07:53 by J2Kbr