Larson Scanner
The Larson Scanner is a light pattern special effect named after Glen A. Larson. Larson used this pattern to give his Battlestar Galactica Cylon and KITT robot eyes a sense of sentience. See Knight Rider for the backstory.
Description
A set of usually red pixels moves back and forth over the LED strip. The pixels are brighter in the center and are dimmer at the edges of the set. You can see an example of this in the Larson Scanner Pumpkin Kit
Color RGB values
We will need a set of predefined colors for various brightness of red:
1 2 3 4 |
|
Note that the color levels are not linear. You can adjust these and add more intermediate levels for wider patterns.
Full Source Code
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 |
|
Exercises
- Turn the code into a function with delay as a patter
- Add a color parameter
- Add a parameter for the width of the pattern