Track My Order
Frequently Asked Questions
International Shipping Info
Mon-Fri, 9am to 12pm and
1pm to 5pm U.S. Mountain Time:
Chat With Us
August 5, 2011
about 6 years ago
Here’s another little code snippet to share.
It is a frame-based PWM that uses a buffer in PROGMEM for input. Designed to run at 10FPS (with clock drift, of course) it treats a byte as on/off state for each line and then does pulse width modulation to turn on more than 2 at a time at the sub-frame level so you don’t have to worry about it.
It also includes a little utility program to convert any file into the data string to put into the code. 8-bit BMPs of fractals or music saved in WAV format will give you some pretty decent random patterns.
I have another program mostly done that uses Flash actionscript so that you can use elements in the timeline as inputs to generate the file but I ran out of time (leaving for BurningMan in a few hours) and slapped this together as plan C.
I’d written a much nicer library ( http://circle.twu.net/progs/Elvis.tgz ) that also does frame-based animation and pulse width modulation but it also eats up all of the RAM and you can’t generate patterns more than 20 frames long. One could however probably pull code from this project and use it to generate the PROGMEM data for the other program if one desired.
This is all shamefully bad code cobbled together in about 2 days in last minute prep for burn, having never tackled arduino coding before so I apologize profusely for any shortcomings. I’ll write something better next month.
No public wish lists :(
Forgot your password?
No account? Register one!