47 lines
1.6 KiB
Plaintext
47 lines
1.6 KiB
Plaintext
# Generated Berry code from Animation DSL
|
|
# Source: rainbow_cycle.anim
|
|
# Generated automatically
|
|
#
|
|
# This file was automatically generated by compile_all_examples.sh
|
|
# Do not edit manually - changes will be overwritten
|
|
|
|
# Original DSL source:
|
|
# # Rainbow Cycle - Classic WLED effect
|
|
# # Smooth rainbow colors cycling across the strip
|
|
#
|
|
# #strip length 60
|
|
#
|
|
# # Create smooth rainbow cycle animation
|
|
# color rainbow_cycle = color_cycle(
|
|
# palette=[0xFF0000, 0xFF8000, 0xFFFF00, 0x00FF00, 0x0000FF, 0x8000FF, 0xFF00FF], # rainbow colors
|
|
# cycle_period=5s # cycle period
|
|
# )
|
|
# animation rainbow_animation = solid(color=rainbow_cycle)
|
|
#
|
|
# # Start the animation
|
|
# run rainbow_animation
|
|
|
|
import animation
|
|
|
|
# Rainbow Cycle - Classic WLED effect
|
|
# Smooth rainbow colors cycling across the strip
|
|
#strip length 60
|
|
# Create smooth rainbow cycle animation
|
|
# Auto-generated strip initialization (using Tasmota configuration)
|
|
var engine = animation.init_strip()
|
|
|
|
var rainbow_cycle_ = animation.color_cycle(engine)
|
|
rainbow_cycle_.palette = [0xFFFF0000, 0xFFFF8000, 0xFFFFFF00, 0xFF00FF00, 0xFF0000FF, 0xFF8000FF, 0xFFFF00FF]
|
|
rainbow_cycle_.cycle_period = 5000 # cycle period
|
|
var rainbow_animation_ = animation.solid(engine)
|
|
rainbow_animation_.color = animation.global('rainbow_cycle_', 'rainbow_cycle')
|
|
# Start the animation
|
|
# Start all animations/sequences
|
|
if global.contains('sequence_rainbow_animation')
|
|
var seq_manager = global.sequence_rainbow_animation()
|
|
engine.add_sequence_manager(seq_manager)
|
|
else
|
|
engine.add_animation(animation.global('rainbow_animation_'))
|
|
end
|
|
engine.start()
|