Tasmota/lib/libesp32/berry_animation/anim_examples/candy_cane.anim

46 lines
2.1 KiB
Plaintext

# Candy Cane - Red and white stripes
# Classic Christmas candy cane animation
#strip length 60
# Define stripe colors
color candy_red = 0xFF0000
color candy_white = 0xFFFFFF
# Create alternating red and white animation
# Using multiple pulse positions to create stripes
animation stripe1 = beacon_animation(color=candy_red, pos=3, beacon_size=4, slew_size=1)
animation stripe2 = beacon_animation(color=candy_white, pos=9, beacon_size=4, slew_size=1)
animation stripe3 = beacon_animation(color=candy_red, pos=15, beacon_size=4, slew_size=1)
animation stripe4 = beacon_animation(color=candy_white, pos=21, beacon_size=4, slew_size=1)
animation stripe5 = beacon_animation(color=candy_red, pos=27, beacon_size=4, slew_size=1)
animation stripe6 = beacon_animation(color=candy_white, pos=33, beacon_size=4, slew_size=1)
animation stripe7 = beacon_animation(color=candy_red, pos=39, beacon_size=4, slew_size=1)
animation stripe8 = beacon_animation(color=candy_white, pos=45, beacon_size=4, slew_size=1)
animation stripe9 = beacon_animation(color=candy_red, pos=51, beacon_size=4, slew_size=1)
animation stripe10 = beacon_animation(color=candy_white, pos=57, beacon_size=4, slew_size=1)
# Add gentle movement to make it more dynamic
set move_speed = 8s
stripe1.pos = sawtooth(min_value=3, max_value=63, duration=move_speed)
stripe2.pos = sawtooth(min_value=9, max_value=69, duration=move_speed)
stripe3.pos = sawtooth(min_value=15, max_value=75, duration=move_speed)
stripe4.pos = sawtooth(min_value=21, max_value=81, duration=move_speed)
stripe5.pos = sawtooth(min_value=27, max_value=87, duration=move_speed)
stripe6.pos = sawtooth(min_value=33, max_value=93, duration=move_speed)
stripe7.pos = sawtooth(min_value=39, max_value=99, duration=move_speed)
stripe8.pos = sawtooth(min_value=45, max_value=105, duration=move_speed)
stripe9.pos = sawtooth(min_value=51, max_value=111, duration=move_speed)
stripe10.pos = sawtooth(min_value=57, max_value=117, duration=move_speed)
# Start all stripes
run stripe1
run stripe2
run stripe3
run stripe4
run stripe5
run stripe6
run stripe7
run stripe8
run stripe9
run stripe10