Pi Larson ScanningI may have got a little carried away.

The Blinkt hat has a perfectly* good python library which does everything you might reasonably want to do with a set of 8 APA102 lights. My problem there is the word ‘reasonably’. So, I re-wrote it in C++, because my soul has never seen the light of day.

(* nearly perfectly. Some might say that flushing the visible buffer by writing white pixels off the end of it is a little much if you decide to define the number of LEDs as 6 for testing and OW MY EYES.)

It’ll take arbitrary pixel length, just like the python library, but unlike the python library it’s built with the assumption you’ll want to make and use multiple patterns, and manipulate those patterns with regard to each other. I can cross over patterns based on whatever input I like, as long as I painstakingly craft that input and sanitise it myself.

The reason I wanted to dig deeper than the python framework was that the Raspberry Pi is my lightweight development machine. I have a laptop that fits into a box. More on that in the next post.

I’m reliably informed that it’s against the law to have a blinkt and not use it to output something something pop culture Davis Hasselhoff – so here is the Larson Scanner in use: Video 19-04-2017, 14 00 28

The C++ library is available at You’ll need the bcm28somethingorother library, but the README.txt has that information. If you want to use cheerlights or APIs you’ll also need libcurl.

Leave a Reply

Your email address will not be published. Required fields are marked *