91 lines
2.8 KiB
Plaintext
91 lines
2.8 KiB
Plaintext
# Generated Berry code from Animation DSL
|
|
# Source: scanner_larson.anim
|
|
# Generated automatically
|
|
#
|
|
# This file was automatically generated by compile_all_examples.sh
|
|
# Do not edit manually - changes will be overwritten
|
|
|
|
# Original DSL source:
|
|
# # Scanner (Larson) - Knight Rider style scanner
|
|
# # Red dot bouncing back and forth
|
|
#
|
|
# #strip length 60
|
|
#
|
|
# # Dark background
|
|
# color scanner_bg = 0x110000
|
|
# animation background = solid(color=scanner_bg)
|
|
#
|
|
# # Main scanner pulse that bounces
|
|
# animation scanner = beacon_animation(
|
|
# color=0xFF0000 # Bright red
|
|
# pos=2 # initial position
|
|
# beacon_size=3 # pulse width
|
|
# slew_size=2 # fade region
|
|
# )
|
|
# scanner.priority = 10
|
|
#
|
|
# # Bouncing position from left to right and back
|
|
# scanner.pos = triangle(min_value=2, max_value=57, duration=2s)
|
|
#
|
|
# # Add trailing glow effect
|
|
# animation scanner_trail = beacon_animation(
|
|
# color=0x660000 # Dim red trail
|
|
# pos=2 # initial position
|
|
# beacon_size=6 # wider trail
|
|
# slew_size=4 # more fade
|
|
# )
|
|
# scanner_trail.priority = 5
|
|
# set pos_test = triangle(min_value=2, max_value=57, duration=2s)
|
|
# scanner_trail.pos = pos_test
|
|
# scanner_trail.opacity = 128 # Half brightness
|
|
#
|
|
# # Start all animations
|
|
# run background
|
|
# run scanner_trail
|
|
# run scanner
|
|
|
|
import animation
|
|
|
|
# Scanner (Larson) - Knight Rider style scanner
|
|
# Red dot bouncing back and forth
|
|
#strip length 60
|
|
# Dark background
|
|
# Auto-generated strip initialization (using Tasmota configuration)
|
|
var engine = animation.init_strip()
|
|
|
|
var scanner_bg_ = 0xFF110000
|
|
var background_ = animation.solid(engine)
|
|
background_.color = scanner_bg_
|
|
# Main scanner pulse that bounces
|
|
var scanner_ = animation.beacon_animation(engine)
|
|
scanner_.color = 0xFFFF0000 # Bright red
|
|
scanner_.pos = 2 # initial position
|
|
scanner_.beacon_size = 3 # pulse width
|
|
scanner_.slew_size = 2 # fade region
|
|
scanner_.priority = 10
|
|
# Bouncing position from left to right and back
|
|
var temp_triangle_70 = animation.triangle(engine)
|
|
temp_triangle_70.min_value = 2
|
|
temp_triangle_70.max_value = 57
|
|
temp_triangle_70.duration = 2000
|
|
scanner_.pos = temp_triangle_70
|
|
# Add trailing glow effect
|
|
var scanner_trail_ = animation.beacon_animation(engine)
|
|
scanner_trail_.color = 0xFF660000 # Dim red trail
|
|
scanner_trail_.pos = 2 # initial position
|
|
scanner_trail_.beacon_size = 6 # wider trail
|
|
scanner_trail_.slew_size = 4 # more fade
|
|
scanner_trail_.priority = 5
|
|
var temp_triangle_125 = animation.triangle(engine)
|
|
temp_triangle_125.min_value = 2
|
|
temp_triangle_125.max_value = 57
|
|
temp_triangle_125.duration = 2000
|
|
var pos_test_ = temp_triangle_125
|
|
scanner_trail_.pos = pos_test_
|
|
scanner_trail_.opacity = 128 # Half brightness
|
|
# Start all animations
|
|
engine.add_animation(background_)
|
|
engine.add_animation(scanner_trail_)
|
|
engine.add_animation(scanner_)
|
|
engine.start()
|