1.2" 7-segment Backpack

These backpacks drive the massive 1.2" 7-segment modules. With 2 leds per segment these make a gorgeous and impressive display. The 7-segment displays normally require 16 pins to drive. This backpack uses an I2C constant-current matrix controller on the back of the PCB, so you only need 2 pins to drive it!

The controller chip takes care of multiplexing all the LEDs in the background. All you have to do is write data to it using the 2-pin I2C interface. There are three address select pins so you can select one of 8 addresses to control up to 8 of these on a single 2-pin I2C bus (as well as whatever other I2C chips or sensors you like). The driver chip can 'dim' the entire display from 1/16 brightness up to full brightness in 1/16th steps. It cannot dim individual LEDs, only the entire display at once.
When you buy a pack from Adafruit, it comes with the fully tested and assembled backpack as well as a 7-segment display in one of the colors we provide (say, red, yellow, blue or green). You'll need to solder the matrix onto the backpack but its an easy task.
Remove the parts from packaging and place the LED matrix OVER the silkscreen side. DO NOT PUT THE DISPLAY ON UPSIDE DOWN OR IT WONT WORK!! Check the image below to make sure the 'decimal point' dots are in the same location as the ones on the silkscreen.
Turn the backpack over so its sitting flat on the matrix and ready to solder.
Then solder each pin. There are 8 on each end for a total of 16.
That completes the basic assembly. For use on a breadboard, you will want to also install a 5-pin header on the edge of the board.
Clip the long pins close to the board.
Cut the header strip to length if necessary and insert LONG pins down into the breadboard.
Then solder all 5 pins.
Now you are ready to wire it to your microcontroller. The required connections are:
  • "D" - I2C Data Pin (SDA)
  • "C" - I2C Clock Pin (SCL)
  • "+" - 5v. (Will not run on 3.3v!)
  • "-" - GND
  • "IO" - I2C bus voltage.
Due to the size of this display, there are 2 LEDs in series for each segment. Because of this, the display requires 5v to run. It will not run on 3.3v.

For use with 3.3v processors, connect the IO pin to 3.3v. This will keep the I2C bus signals at a safe level for your processor.

With 5v processors like the Arduino UNO, this pin can be connected to either 5v or 3.3v. (use 3.3v if there will be other 3.3v devices on the bus)

Arduino Wiring - R3 and later

Connect:
  • D -> SDA
  • C -> SCL
  • + -> 5v
  • - -> GND
  • IO -> jumper to + for 5v.

Arduino Due and Other 3.3v Processors

Connect:
  • D -> SDA
  • C -> SCL
  • + -> 5v
  • - -> GND
  • IO -> 3.3v

Arduino "Classic" Wiring

Connect:
  • D -> Analog-4 or Digital 20 for the Mega
  • C -> Analog-5 or Digital 21 for the Mega
  • + -> 5v
  • - -> GND
  • IO -> jumper to + for 5v.
OK, now on to the firmware!

Seven-Segment Backpack Firmware

Our 7-segment backpack library makes it easy to program these displays. The library is written for the Arduino and will work with any Arduino as it just uses the I2C pins. The code is very portable and can be easily adapted to any I2C-capable micro.

You can download the Adafruit LED Backpack library from github . To download click the DOWNLOADS button in the top right corner, rename the uncompressed folder Adafruit_LEDBackpack. Check that the Adafruit_LEDBackpack folder contains Adafruit_LEDBackpack.cpp and Adafruit_LEDBackpack.h.

If you need help with installing you libraries, we have a detailed guide here:



You'll also need to download the Adafruit GFX library - rename it Adafruit_GFX and install it as the LED backpack library. Close all open IDE windows and restart the IDE.

Once you've restarted you should be able to select the File?Examples?Adafruit_LEDBackpack?sevenseg example sketch. Upload it to your Arduino as usual. You should see a "sevenseg" example sketch that will demonstrate various capabilities of the library and the display.

Once you're happy that the matrix works, you can write your own sketches.

There's a few ways you can draw to the display. The easiest is to just call print - just like you do with Serial

  • print(variable,HEX) - this will print a hexidecimal number, from 0000 up to FFFF
  • print(variable,DEC) or print(variable) - this will print a decimal integer, from 0000 up to 9999

If you need more control, you can call writeDigitNum(location, number) - this will write the number (0-9) to a single location. Location #0 is all the way to the left, location #2 is the colon dots so you probably want to skip it, location #4 is all the way to the right.

To control the colon and decimal points, use the writeDigitRaw(location, bitmap) function.  (Note that both dots of the center colon are wired together internal to the display, so it is not possible to address them separately.)  Specify 2 for the location and the bits are mapped as follows:

  • 0x02 - center colon (both dots)
  • 0x04 - left colon - lower dot
  • 0x08 - left colon - upper dot
  • 0x10 - decimal point

If you want a decimal point, call writeDigitNum(location, number, true) which will paint the decimal point. To draw the colon, use drawColon(true or false)

If you want full control of the segments in all digits, you can call writeDigitRaw(location,bitmask) to draw a raw 8-bit mask (as stored in a uint8_t) to anylocation.

All the drawing routines only change the display memory kept by the Arduino. Don't forget to call writeDisplay() after drawing to 'save' the memory out to the matrix via I2C.

There are also a few small routines that are special to the backpack:

  • setBrightness(brighness)- will let you change the overall brightness of the entire display. 0 is least bright, 15 is brightest and is what is initialized by the display when you start
  • blinkRate(rate) - You can blink the entire display. 0 is no blinking. 1, 2 or 3 is for display blinking.
Last updated on 2016-12-30 at 10.51.24 AM Published on 2012-07-29 at 11.58.38 AM