led_vmget — Get current count value
int16 led_vmget(<LED_IDENTIFIER>);
Check how many duty cycle periods remains to be executed for the LED identified by <LED_IDENTIFIER>.
LED_1
, LED_2
, LED_3
or LED_4
. Note: the LED identifier is passed as direct parameter of the led_vmget()
opcode, therefore stack values can't be used.
Returns the current count value. The count value is initially set by led_vmset()
and decremented by one for each executed duty cycle period.
A negative returning value indicates the duty period is configured to repeat indefinitely. |
int state = 0; main { switch(state) { case 0: { if(led_vmget(LED_2) == 0) { led_vmset(LED_3, 200, 500, 3); state = 1; } } break; case 1: { if(led_vmget(LED_3) == 0) { led_vmset(LED_2, 500, 200, 2); state = 0; } } break; } }