Files
pybricks-api/pybricks
Laurens Valk 102039385a api/_common/ColorLight: add pattern
This adds the method equivalent to the recent addition of a single
color light. The only difference is that now a color is returned instead
of a single brightness. The provided color or HSV tuple will be stored
as RGB samples internally, as is already done for pbio light patterns.

In the simplest blinking form this could be:

hub.light.pattern(lambda t: Color.RED if t >= 1000 else None, 2000)

Or a fading, one-color sine:

def fade(time):
    v = sin(time/2000/pi)*50+50
    h = 360
    s = 100
    return (h, s, v)

hub.light.pattern(fade, 1000)
2020-07-07 09:44:16 +02:00
..
2020-07-07 09:44:16 +02:00
2020-06-05 15:56:04 +02:00
2020-03-05 10:33:48 +01:00
2020-04-24 10:50:34 +02:00
2020-07-01 13:33:36 +02:00