822227eb48
* Add brick button topics * Add the rest of the brick api
901 B
901 B
set Light
Set the light on the brick to a solid or flashing color.
brick.setLight(BrickLight.Red);
Parameters
- pattern: the color or color pattern for the brick light to show. The brick light can have these color patterns:
off
: brick light is offgreen
: solid greenred
: solid redorange
: solid orangegreen flash
: flashing greenred flash
: flashing redorange flash
: flashing orangegreen pulse
: pulsing greenred pulse
: pulsing redorange pulse
: pulsing orange
Example
Repeatedly show a different color pattern for the brick light.
loops.forever(function () {
brick.setLight(BrickLight.Orange)
loops.pause(1000)
brick.setLight(BrickLight.GreenFlash)
loops.pause(2000)
brick.setLight(BrickLight.RedPulse)
loops.pause(2000)
brick.setLight(BrickLight.Off)
loops.pause(500)
})