mirror of
https://github.com/arendst/Tasmota.git
synced 2025-11-27 03:38:12 +00:00
53 lines
1.2 KiB
Plaintext
53 lines
1.2 KiB
Plaintext
# Generated Berry code from Animation DSL
|
|
# Source: simple_palette.anim
|
|
#
|
|
# This file was automatically generated by compile_all_examples.sh
|
|
# Do not edit manually - changes will be overwritten
|
|
|
|
import animation
|
|
|
|
# Simple Palette Example
|
|
# Demonstrates basic palette usage in the DSL
|
|
#strip length 20
|
|
# Define a simple rainbow palette
|
|
# Auto-generated strip initialization (using Tasmota configuration)
|
|
var engine = animation.init_strip()
|
|
|
|
var rainbow_ = bytes("00FF0000" "40FFA500" "80FFFF00" "C0008000" "FF0000FF")
|
|
# Create an animation using the palette
|
|
var rainbow_cycle_ = animation.rich_palette_animation(engine)
|
|
rainbow_cycle_.palette = rainbow_
|
|
rainbow_cycle_.cycle_period = 3000
|
|
# Simple sequence
|
|
var demo_ = animation.SequenceManager(engine)
|
|
.push_play_step(rainbow_cycle_, 15000)
|
|
engine.add(demo_)
|
|
engine.run()
|
|
|
|
|
|
#- Original DSL source:
|
|
# Simple Palette Example
|
|
# Demonstrates basic palette usage in the DSL
|
|
|
|
#strip length 20
|
|
|
|
# Define a simple rainbow palette
|
|
palette rainbow = [
|
|
(0, red),
|
|
(64, orange),
|
|
(128, yellow),
|
|
(192, green),
|
|
(255, blue)
|
|
]
|
|
|
|
# Create an animation using the palette
|
|
animation rainbow_cycle = rich_palette_animation(palette=rainbow, cycle_period=3s)
|
|
|
|
# Simple sequence
|
|
sequence demo {
|
|
play rainbow_cycle for 15s
|
|
}
|
|
|
|
run demo
|
|
-#
|