# addHslMoveToBlinkSeq(sequence, color, duration) We wrote it in Python, but it works as well with any other language. When these basics are laid out, we can build our animation. Note that the Low corresponding to black is not defined as 0x000000 (black as well) but as 0xHHSS00, to ensure the transitions to be correctly computed. L,the Luminosity, we took 127, the maximum that we could allow ourselves to use without changing the hue.S, the animation Saturation, we selected the maximum, that is 255.The led color alternates between two HSL colors defined as follows: To avoid artifacts linked issues with rounding in the module, it's best if halfPeriod is a multiple of LedCount. Note that a led is on for halfPeriod/LedCount. halfPeriod, the time in milliseconds for a one-way journey.LedCount, the number of leds we must manage, so 8 in our case.We are naturally going to take advantage of this feature to make single pixels go back and forth.īut before anything else, let's define a few constants: Its effect is to inverse the speed and therefore play the animation backward. One can use a mirror effect in an animation. The difficulty in the case of the "Larson scanner" is the back and forth movement. Thus, they can work even if the module is powered by a USB charger or battery.Ī Yocto-Color-V2 connected to an Adafruit NEOPIXEL 8 led stick You can even make it so that these animations start automatically when the module is powered on. It's simple and it provides many possibilities. Each of these animations is defined as a series of color variations which can be played by any led with a predefined temporal offset, you will find more details in the Yocto-Color-V2 user manual. In contrast, configuring a Yocto-Color-V2 so that it reproduces the effect autonomously is sufficiently challenging for us to think that it's worth a post on the topic.Īs a reminder, a Yocto-Color-V2 can play autonomous animations. But this implies having a computer communicating continuously with the module. Obviously, reproducing this light effect with pure programming with a Yocto-Color-V2 requires a few lines of code only. We wondered if we could do the same effect with the autonomous animations of the Yocto-Color-V2.Įmblematic "protagonists" of the Knight Rider and Battlestar Galactica series, note the red chase effect Larson, and this small chase effect in the Cylons visor and at the front of KITT, hence the " Larson scanner" expression. Do you know the commonality between the TV series Battlestar Galactica (1978) and Knight Rider (1982)? Actually, there are at least two: their creator Glen A.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |