For the complete documentation index, see llms.txt. This page is also available as Markdown.

Controller LEDs

Read state

read-led-state.gpc
int led_state;

main {
    led_state = get_led(LED_1);
    set_val(TRACE_1, led_state);
}

States are 0..3: off, on, fast blink, slow blink.


Set state

init {
    set_led(LED_1, 1);
}

finite-blink-count.gpc
main {
    if(event_press(PS5_CROSS)) {
        set_ledx(LED_1, 3);
    }

    set_val(TRACE_1, get_ledx());
}

get_ledx() reports whether a finite sequence is active. A blink count of zero leaves the LED on.


Return control to the console

Last updated