Tasmota/lib/libesp32/berry_animation/anim_examples/candy_cane.anim
2025-08-01 19:34:23 +02:00

46 lines
1.5 KiB
Plaintext

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