Skip to content

Commit

Permalink
Add calibration "animation"
Browse files Browse the repository at this point in the history
  • Loading branch information
waveform80 committed Dec 15, 2024
1 parent 62f8c35 commit 4ae63f7
Showing 1 changed file with 22 additions and 0 deletions.
22 changes: 22 additions & 0 deletions blinkenxmas/animations.py
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,28 @@ def one_color(led_count, color):
return [[color for led in range(led_count)]]


@animation('Calibration',
led_count=ParamLEDCount(),
positions=ParamLEDPositions(),
found_color=Param('Found', 'color', default='#00ff00'),
missing_color=Param('Missing', 'color', default='#ff0000'))
def calibration(led_count, positions, found_color, missing_color):
"""
This "animation" shows which LEDs were found during calibration and which
were not by assigning them different colors. This is primarily useful for
debugging your setup. Your are advised to use two non-black colors so that
you can check for unlit LEDs, which may be a result of bad connections,
broken LEDs, or bad configuration of the strand lengths.
Please note this animation requires that you have run the calibration step
or all LEDs (exception bad ones) will simply appear in the "missing" color.
"""
return [[
found_color if led in positions else missing_color
for led in range(led_count)
]]


@animation('Gradient (by index)',
led_count=ParamLEDCount(),
color1=Param('From', 'color', default='#000000'),
Expand Down

0 comments on commit 4ae63f7

Please sign in to comment.