Tasmota/lib/libesp32/berry_animation/anim_examples/compiled/candy_cane.be

183 lines
6.5 KiB
Plaintext

# Generated Berry code from Animation DSL
# Source: candy_cane.anim
# Generated automatically
#
# This file was automatically generated by compile_all_examples.sh
# Do not edit manually - changes will be overwritten
# Original DSL source:
# # 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
import animation
# Candy Cane - Red and white stripes
# Classic Christmas candy cane animation
#strip length 60
# Define stripe colors
# Auto-generated strip initialization (using Tasmota configuration)
var engine = animation.init_strip()
var candy_red_ = 0xFFFF0000
var candy_white_ = 0xFFFFFFFF
# Create alternating red and white animation
# Using multiple pulse positions to create stripes
var stripe1_ = animation.beacon_animation(engine)
stripe1_.color = candy_red_
stripe1_.pos = 3
stripe1_.beacon_size = 4
stripe1_.slew_size = 1
var stripe2_ = animation.beacon_animation(engine)
stripe2_.color = candy_white_
stripe2_.pos = 9
stripe2_.beacon_size = 4
stripe2_.slew_size = 1
var stripe3_ = animation.beacon_animation(engine)
stripe3_.color = candy_red_
stripe3_.pos = 15
stripe3_.beacon_size = 4
stripe3_.slew_size = 1
var stripe4_ = animation.beacon_animation(engine)
stripe4_.color = candy_white_
stripe4_.pos = 21
stripe4_.beacon_size = 4
stripe4_.slew_size = 1
var stripe5_ = animation.beacon_animation(engine)
stripe5_.color = candy_red_
stripe5_.pos = 27
stripe5_.beacon_size = 4
stripe5_.slew_size = 1
var stripe6_ = animation.beacon_animation(engine)
stripe6_.color = candy_white_
stripe6_.pos = 33
stripe6_.beacon_size = 4
stripe6_.slew_size = 1
var stripe7_ = animation.beacon_animation(engine)
stripe7_.color = candy_red_
stripe7_.pos = 39
stripe7_.beacon_size = 4
stripe7_.slew_size = 1
var stripe8_ = animation.beacon_animation(engine)
stripe8_.color = candy_white_
stripe8_.pos = 45
stripe8_.beacon_size = 4
stripe8_.slew_size = 1
var stripe9_ = animation.beacon_animation(engine)
stripe9_.color = candy_red_
stripe9_.pos = 51
stripe9_.beacon_size = 4
stripe9_.slew_size = 1
var stripe10_ = animation.beacon_animation(engine)
stripe10_.color = candy_white_
stripe10_.pos = 57
stripe10_.beacon_size = 4
stripe10_.slew_size = 1
# Add gentle movement to make it more dynamic
var move_speed_ = 8000
var temp_sawtooth_258 = animation.sawtooth(engine)
temp_sawtooth_258.min_value = 3
temp_sawtooth_258.max_value = 63
temp_sawtooth_258.duration = move_speed_
stripe1_.pos = temp_sawtooth_258
var temp_sawtooth_277 = animation.sawtooth(engine)
temp_sawtooth_277.min_value = 9
temp_sawtooth_277.max_value = 69
temp_sawtooth_277.duration = move_speed_
stripe2_.pos = temp_sawtooth_277
var temp_sawtooth_296 = animation.sawtooth(engine)
temp_sawtooth_296.min_value = 15
temp_sawtooth_296.max_value = 75
temp_sawtooth_296.duration = move_speed_
stripe3_.pos = temp_sawtooth_296
var temp_sawtooth_315 = animation.sawtooth(engine)
temp_sawtooth_315.min_value = 21
temp_sawtooth_315.max_value = 81
temp_sawtooth_315.duration = move_speed_
stripe4_.pos = temp_sawtooth_315
var temp_sawtooth_334 = animation.sawtooth(engine)
temp_sawtooth_334.min_value = 27
temp_sawtooth_334.max_value = 87
temp_sawtooth_334.duration = move_speed_
stripe5_.pos = temp_sawtooth_334
var temp_sawtooth_353 = animation.sawtooth(engine)
temp_sawtooth_353.min_value = 33
temp_sawtooth_353.max_value = 93
temp_sawtooth_353.duration = move_speed_
stripe6_.pos = temp_sawtooth_353
var temp_sawtooth_372 = animation.sawtooth(engine)
temp_sawtooth_372.min_value = 39
temp_sawtooth_372.max_value = 99
temp_sawtooth_372.duration = move_speed_
stripe7_.pos = temp_sawtooth_372
var temp_sawtooth_391 = animation.sawtooth(engine)
temp_sawtooth_391.min_value = 45
temp_sawtooth_391.max_value = 105
temp_sawtooth_391.duration = move_speed_
stripe8_.pos = temp_sawtooth_391
var temp_sawtooth_410 = animation.sawtooth(engine)
temp_sawtooth_410.min_value = 51
temp_sawtooth_410.max_value = 111
temp_sawtooth_410.duration = move_speed_
stripe9_.pos = temp_sawtooth_410
var temp_sawtooth_429 = animation.sawtooth(engine)
temp_sawtooth_429.min_value = 57
temp_sawtooth_429.max_value = 117
temp_sawtooth_429.duration = move_speed_
stripe10_.pos = temp_sawtooth_429
# Start all stripes
engine.add_animation(stripe1_)
engine.add_animation(stripe2_)
engine.add_animation(stripe3_)
engine.add_animation(stripe4_)
engine.add_animation(stripe5_)
engine.add_animation(stripe6_)
engine.add_animation(stripe7_)
engine.add_animation(stripe8_)
engine.add_animation(stripe9_)
engine.add_animation(stripe10_)
engine.start()