NeoPixelPSI – Coding

I had a bunch of my lovely new PSIs, and had tested them with a example sketch to make sure they all worked. Next step was to write the code to run them.

Initially, it was some quick and dirty writing to get an idea of how to do it. I used a map array to break it up into columns as the main effect will be a side to side swipe of colours. Thankfully, a lot of the code I could copy from my previous PSIMatrix project.

Once I’d figured out the basics, I wanted to make this portable. I’m a big fan of the ReelTwo library by Mimir, which lets you run the entire dome lighting (and more) from a single Arduino Mega. Vastly simplifies the wiring and power requirements. I also wanted to have it usable standalone, and also with the FlthyMcNasty HP system.

This all meant that I had to write it as an OOP class, something I don’t tend to do a lot. Thankfully there are lots of tutorials, etc. so after much bug finding, reading of documentation, and experimentation, I managed to get the whole thing down to where it is basically a library.

Currently supported options:

  • Standalone – You can run a single PSI from its own dedicated arduino. Tested with a nano, but should work on just about anything.
  • An option in ReelTwo – Just add a couple of lines to tell the software what pins you are using, and it will just work.
  • Extension to the FlthyHP system – The Flthy system has plenty of spare pins and is mostly off the shelf components, so I’m a big fan. A custom version of the sketch is available to tack on PSI support.

So far, I’ve had a couple of boards running for 48 hours as a burn in test and they all seem to be working great!

These will be getting tested in my droid soon, and I’ve a spare set for another builder to try. I also plan on adding a whole bunch of extra things, especially to the ReelTwo verison, such as different animations (pulsing heart, malfunction, other random things, triggered via i2c), ability to change the swipe speed/delay, and also change the colours from default.

It should also be possible to extend the RSeries logics by JoyMonkey to use these PSIs.

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.