37 lines
1.1 KiB
Plaintext
37 lines
1.1 KiB
Plaintext
# Police Lights - Red and blue alternating flashes
|
|
# Emergency vehicle style lighting
|
|
|
|
#strip length 60
|
|
|
|
# Define zones for left and right halves
|
|
set half_length = 30
|
|
|
|
# Left side red flashing
|
|
animation left_red = beacon(
|
|
color=0xFF0000 # Bright red
|
|
pos=15 # center of left half
|
|
beacon_size=15 # half the strip
|
|
slew_size=2 # sharp edges
|
|
)
|
|
left_red.priority = 10
|
|
left_red.opacity = square(min_value=0, max_value=255, duration=400ms, duty_cycle=50) # 50% duty cycle
|
|
|
|
# Right side blue flashing (opposite phase)
|
|
animation right_blue = beacon(
|
|
color=0x0000FF # Bright blue
|
|
pos=45 # center of right half
|
|
beacon_size=15 # half the strip
|
|
slew_size=2 # sharp edges
|
|
)
|
|
right_blue.priority = 10
|
|
right_blue.opacity = square(min_value=255, max_value=0, duration=400ms, duty_cycle=50) # Opposite phase
|
|
|
|
# Add white strobe overlay occasionally
|
|
animation white_strobe = solid(color=0xFFFFFF)
|
|
white_strobe.opacity = square(min_value=0, max_value=255, duration=100ms, duty_cycle=5) # Quick bright flashes
|
|
white_strobe.priority = 20
|
|
|
|
# Start all animations
|
|
run left_red
|
|
run right_blue
|
|
run white_strobe |