Skip to content

Search the documentation

Kit
Firmware

RGBLed

Mini

The robot’s colour light; colours are red, green and blue from 0 to 255, brightness in percent.

The RGBLed class is reached through this attribute of robot.

Can be None.

All the attributes of robot are in its table. Read Attributes that can be None to see when a part is None.

The colour last set, as (red, green, blue), each 0 to 255, before brightness.

color: Tuple[int, int, int]

Read only.

Used in examples: Rainbow

The brightness last set, 0 to 100 percent.

brightness: int

Read only.

Used in examples: Rainbow

Lights the LED in a colour made of red, green and blue, each from 0 to 255.

set_color(r, g, b, index: int)

You can leave out index.

Used in examples: Drive the Mini, Rainbow, Jukebox, Mini eyes

Lights the LED in a colour written as one number 0xRRGGBB, for example 0xFF8000 for orange.

set_hex(hex_color, index: int)

You can leave out index.

Used in examples: Rainbow

Sets how bright the colour shows, from 0 to 100 percent, without changing the colour.

set_brightness(brightness)

Used in examples: Rainbow

Lights one of the app’s preset colours, by its number (0 is off, 1 red, 2 green, 3 blue, …).

set_preset(preset_id)

Used in examples: Rainbow

Turns the light off and stops blink() or rainbow().

off()

Used in examples: Drive the Mini, Rainbow, Jukebox, Mini eyes

Flashes a colour (red, green and blue, each 0 to 255) for duration_ms milliseconds, then puts back the colour the light had; the program waits meanwhile.

flash(r, g, b, duration_ms: int)

You can leave out duration_ms.

Used in examples: Rainbow

Starts blinking a colour (0-255 each), on and off every 200 ms; call tick() in your loop to move it on.

blink(r, g, b)

Used in examples: Rainbow

Starts cycling through eight colours, one every 300 ms; call tick() in your loop to move it on.

rainbow()

Used in examples: Rainbow

Moves blink() or rainbow() on; call it every 20-50 ms from your loop.

tick()

Used in examples: Rainbow