Saturday, July 4, 2015

LED POV Fan Update

I first posted on how to reprogram a "Programmable Message Fan: Model 45 Series" POV fan a few years ago, and the code I posted no longer works with the current versions of the Octave and Arduino software.  The original post still describes how the fan works and how I went about figuring it out, and this is just an update to the software to reprogram it.


I'm taking the same general approach, where a script run on a computer writes an Arduino sketch that can be compiled and uploaded via the Arduino IDE.  The Arduino sketch isn't elegant, but it works.  The only real change that broke the generated Arduino code is that they changed the "send" method to "write" in the newer versions of the I2C "Wire" library.  I am using Arduino software version 1.6.5 with a clone of the Arduino UNO board.

On the scripting side, though, things have changed a bit more.  I used Octave back in 2011 because I was using Matlab a lot at work for data processing and analysis, and Octave was pretty similar.  Since then, I've moved on to Python and haven't looked back, so my update here is written in Python rather than trying to update to whatever the current version of Octave is.  I have a pretty simple module called "pov.py", and a demo file called "demo_pov.py" that shows how to use it.  It does some simple checking on the inputs and will filter out invalid screens, then create the .ino file for programming the Arduino.  I tested the Python script with both Python 2.7.5 and 3.4.3.  I'm not using anything beyond the standard library here, but if you're interested in Python, I highly recommend the Anaconda distribution.

I've also switched where I'm hosting my source code files.  In the past, I would just upload a .zip file of source code to SourceForge.  Since then, I've learned a lot about version control and come to really appreciate the benefits of using a version control system.  My personal favorite is Git, and I'm using GitHub to host my projects right now.  Here's the link to the new files.