ordered.io


Flash storage && performance engineering


LED matrix characters

I’ve tinkered with electronics since I was young (I used to have quite the collection of electric and electronic parts, mostly junk, porbably), but for some reason I lost interest until Arduino came on the scene (of course working for a hardware company helped too). I bought an Uno and built a couple projects on it, and then Raspberry Pi caught my eye. Here was a whole computer, complete with Linux, in about the same size footprint. So when I got my Pi, I built a few projects with it as well, but then it settled into kind of permanent role of capturing temperatures in my brewing apparatus, and graphing them from a self-contained Graphite database.

But recently I discovered the Adafruit Trinkets and I’ve been getting back into the electronics side again. Trinkets are Arduino-compatible, with 3.3V and 5V logic levels, and they’re not much bigger than a postage stamp. Anyway, I’ve been playing with the trinkets a lot lately, and just set up one of the 8x8 LED displays. Of course I wanted to display “Hello World!” on it, so I looked around for a pre-built alphabet.

I found this little web-based tool which is quite cool, but I didn’t like the characters it produced. If I’ve got 64 bits to play with, I’d like my letters to be a little bit bolder than simple lines. So I set about creating my own letters by simply drawing an 8x8 grid and filling in the appropriate pixels to create bigger letters. I created about half a dozen, enough to display some text, but they weren’t great and it was a time-consuming task.

Then by chance, as I was reading a section of “Code” about output to video adapters (Code so far has just been a fascinating look at the evolution of the modern day (as of 1999) computer). 8x8 happened to be the number of pixels they used per character for a standard text display, and he had a grid of character grids as an image in the book. So with that information, all I had to do was convert it to the proper binary for Arduino, and I had much better characters to work with.

It was still time-consuming and tedious, but vim macros help a lot.

B00110000,B01111000,B11001100,B11001100,B11111100,B11001100,B11001100,B00000000,25, // A
B11111100,B01100110,B01100110,B01111100,B01100110,B01100110,B11111100,B00000000,25, // B
B00111100,B01100110,B11000000,B11000000,B11000000,B01100110,B00111100,B00000000,25, // C
B11111000,B01101100,B01100110,B01100110,B01100110,B01101100,B11111000,B00000000,25, // D

B00000000,B00000000,B01111000,B00001100,B01111100,B11001100,B01110110,B00000000,25, // a
B11100000,B01100000,B01100000,B01111100,B01100110,B01100110,B11011100,B00000000,25, // b
B00000000,B00000000,B01111000,B11001100,B11000000,B11001100,B01111000,B00000000,25, // c
B00011100,B00001100,B00001100,B01111100,B11001100,B11001100,B01110110,B00000000,25, // d

Anyway, I hope it’ll be useful to someone else. The Gist is here.

Characters