adafruit / Adafruit_LED_Backpack

Adafruit LED Backpack Library for our various LED backpacks.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Segments incorrectly lit when displaying '3' and '5'

scottalmond opened this issue · comments

I am using an HT16K33 breakout
https://www.adafruit.com/product/1427
wired to KW4-12041CLA quad 7-segment display
https://www.adafruit.com/product/1264
per the schematic here:
https://cdn-learn.adafruit.com/assets/assets/000/036/298/original/led_matrix_schem.png?1476209216

When I run the following script:
https://github.com/adafruit/Adafruit_LED_Backpack/tree/master/examples/quadalphanum
The display blinks all LEDs ON and OFF as expected when it first boots. After the 7-segment display scrolls through a test animation, a prompt appears on the 9600 baud terminal "Start typing to display!" as expected.

If I send a command '3333', I receive backward 'C's on the display. That is, only 4 of the 5 segments are illuminated: the 'G' segment is OFF, but I expect it to be ON. Similarly if I command '5555', I note the 'C' segment is OFF when I expect it to be ON.

Looking through the source code, I have made the following changes and this has resolved the issue (displaying '3' or '5' illuminates the corresponding 5 segments in each case)
https://github.com/adafruit/Adafruit_LED_Backpack/blob/master/Adafruit_LEDBackpack.cpp

IS
0b0000000001001111, // 3
WAS
0b0000000010001111, // 3

IS
0b0010000001101101, // 5
WAS
0b0010000001101001, // 5

I believe there are similar segment mapping issues on other entries in that list like with the letter 'a'

The quadalphanum example uses the Adafruit_AlphaNum4 class which is meant for a different LED display product. Use the Adafruit_7segment class for that LED. Also, there is a backpack available:
https://www.adafruit.com/product/1270