7 Segment Pixel library for Arduino

Photo Credit Jeff Jassky. World Maker Faire 2016

 

Are you dissatisfied with the small size of the largest 7 segment digital displays that are commercially available?  Me too!  The good news is that if you have access to a laser cutter, it’s pretty easy and extremely fun to build your own obnoxiously large, 7 segment displays from scratch, using smart LEDs, such as the WS2812 variety, AKA NeoPixels from adafruit.com  The laser cutter helps you cut a backer board to precisely mount your LED lamps and most importantly, it is used to cut a baffling layer. This layer has each segment of every digit cut out and it is samwiched between the lamps layer and the face of the panel.  It baffles the light from each segment, keeping it contained, preventing that light from leaking to adjacent segments.

But I digress!  Way back when I made my first 7 seven segment display, I was surprised that I couldn’t find an Arduino library to help make it easier to show digits on a custom built display such as mine.  There were plenty of 7 segment libraries to drive off the shelf parts, but nothing to help drive a pixel based custom made display.  If you’ve had the same concerns, YOUR SEARCH IS OVER! 😀 I’m pleased to announce the release of my Seven Segment Pixel library for Arduino which can be found on github:

https://github.com/h-c-c/Seven_Segment_Pixel

The library uses the awesome Adafruit_NeoPixel library as a dependency.  You can instantiate a display object like so:

Seven_Segment_Pixel display1 = Seven_Segment_Pixel( DIGITS, PIXPERSEG, NUMPIXELS, PIN, NEO_GRB + NEO_KHZ800 );

Then use the updateDigit function to manipulate a specific digit and it’s color:

 display1.updateDigit( 0, 1, 255, 0 , 0 );
 display1.showDisplay();

This would display a red, numeral 1 in the zeroth digit position.  The showDisplay function is just a wrapper for the Adafruit_NeoPixel show(); function.

Please take it for a spin and let me know what you think!

 

 

Leave a Reply