I received a request for clarify some of the code I use in the LED-matrix top, so I've decided to start sharing my code in a more modern way. But before we get to that, if you are thinking of following my adventures in making this top there are a couple of things I want to add.
- Please please please use metal snaps instead of metal rings!
- Use lithium-ion batteries, more power, much better.
- As soon as you have the circuit working as you want, cover each conductive trace with fray-stop glue to prevent oxidation of the conductive coating over time.
- Test that you can turn on each LED individually by using a (at least 3V) coin-cell battery and touching the positive side to the trace that connects to the positive side of the LED, and the negative to the negative. If it doesn't light up get a multimeter and check every single trace/LED for short-circuits.
Okay, so the top is physically made up and working fine? Great! Here's the first version of the code, with the LEDs working, and the push-button switch for cycling through patterns, and that's it. It's available through github at https://github.com/chebe/chebe-led-matrix-top
. I'll let you know as I clean up and release newer versions.