Tasmota/tasmota/berry/animate_demo/animate_demo_pulse.be

21 lines
542 B
Plaintext
Raw Normal View History

#
# Example for M5Stack Led Matrix
# 5 x 5 WS2812
#
import animate
var duration = 10000
var strip = Leds(5 * 5, gpio.pin(gpio.WS2812, 0))
2023-12-14 22:09:40 +00:00
var anim = animate.core(strip)
anim.set_back_color(0x2222AA)
2023-12-22 17:10:34 +00:00
anim.set_bri(60) # set brightness to 40%
var pulse = animate.pulse(0xFF4444, 2, 1)
var osc1 = animate.oscillator(-3, 26, 5000, animate.COSINE)
osc1.set_cb(pulse, pulse.set_pos)
# animate color of pulse
2023-12-22 17:10:34 +00:00
var palette = animate.palette(animate.PALETTE_STANDARD_VAL, 30000)
palette.set_cb(pulse, pulse.set_color)
anim.start()