adafruit / Adafruit_LED_Backpack

Adafruit LED Backpack Library for our various LED backpacks.
MIT License
299 stars 192 forks source link

HT16K33 Breakout Pin/Code Confusion #15

Closed delianides closed 9 years ago

delianides commented 9 years ago

I'm not sure if this is the right place to ask this but I'm confused about the behavior of this library in relation to seven segment displays. I'm using the HT16K33 Breakout to prototype my project and I've got each digit wired up in order to each of the cathode pins (4).

When I run the seven segment example in the library it seems like all the examples skip the C2 pin on the break. For example trying to print 1234 actually displays like 12_3. I initially thought I had made a mistake in the wiring but I've checked it twice, used a different display, and even used a different breakout board, no change. The code looks like this, pretty simple:

// Enable one of these two #includes and comment out the other.
// Conditional #include doesn't work due to Arduino IDE shenanigans.
#include <Wire.h> // Enable this line if using Arduino Uno, Mega, etc.

#include "Adafruit_LEDBackpack.h"
#include "Adafruit_GFX.h"

Adafruit_7segment matrix = Adafruit_7segment();

void setup() {
#ifndef __AVR_ATtiny85__
  Serial.begin(9600);
  Serial.println("7 Segment Backpack Test");
#endif
  matrix.begin(0x73);
}

void loop() {
    matrix.clear();
    matrix.println(1234); //Displays 12 3
    matrix.writeDisplay();
    delay(10000);
}

The odd thing is this; If I shift the last two digits down a pin, the output is correct 1234. But if I add:

matrix.writeDigitNum(2, 8, false);

with the original wiring, It will display an 8 on the correct display.

How can I use the println function but gain back the function of the C2 pin? I need to wire 8 seven segment displays and without that pin it leaves me one short.

ladyada commented 9 years ago

Please post tech support questions in the adafruit support forum :)