battlecore::lights

The lightsmodule switches the device's simple single-colour lights on and off. Include its declarations with include "./battlecore/lights.bst";.

Light 0 is the muzzle flash, and it is the only light the firmware drives today. Any other index is accepted and does nothing. The coloured LEDs are a separate module, battlecore::rgb.

on / off

Turns a light on or off.

native void battlecore::lights.on (int lightIndex = 0);
native void battlecore::lights.off (int lightIndex = 0);

flash

Lights a light once for onDurationMs milliseconds. The firmware caps the length.

native void battlecore::lights.flash (int lightIndex = 0, int times = 1, int onDurationMs = 100, int offDurationMs = 0);

times and offDurationMs are accepted but not implemented yet: the muzzle flash is a single timed pulse. They match the shape of battlecore::rgb.flash, so calls will gain repeats when the firmware supports them.