0

7-Segment LED Backpack - Can't Address Left Colon or Decimal
Moderators: adafruit_support_bill, adafruit

Please be positive and constructive with your questions and comments.

7-Segment LED Backpack - Can't Address Left Colon or Decimal

by bigrick on Wed Sep 11, 2019 9:50 pm

I'm using the 1.2" 7-Segment LED Backpack to build myself an alarm clock. I want to individually address the two dots of the left colon to use them as indicators. The top dot will be an AM/PM indicator, while the bottom dot will illuminate only when the alarm is armed. The online documentation makes it seem like this should be fairly easy, but I can't figure it out for the life of me.

I am using an Arduino Uno Wifi Rev 2 and my libraries are up to date. Below is my code, which I modified from the seven segment example sketch included in the Adafruit_LEDBackpack library. I've cut out the parts that aren't relevant to the problem I'm having.

Code: Select all | TOGGLE FULL SIZE
#include <Wire.h>
#include <Adafruit_GFX.h>
#include "Adafruit_LEDBackpack.h"

Adafruit_7segment matrix = Adafruit_7segment();

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

void loop() {
  matrix.writeDigitNum(2, 0x02);
  matrix.writeDisplay();
}


The documentation says that when I run this code, only the middle colon should light up. While I do get the middle colon, the bottom dot of the left colon and the upper right "decimal point" also light up.

When I change "0x02" to "0x04", the lower dot of the left colon should light up, but instead I get the middle colon and the upper dot of the left colon. When I use 0x08, I get all the dots lighting up instead of just the upper dot of the left colon. 0x10 causes the entire display to go blank. For what it's worth, the drawColon(true/false) function works as it's supposed to.

I own three of these LED backpacks for testing and I'm getting the same result with all of them. I tried swapping the WiFi Rev 2 out with a standard Arduino Uno and got the same result. It doesn't seem to be a hardware issue. Does anyone have any idea where I can start tackling this problem? I'm pretty baffled. Picture of my setup and result below for your reference. Thanks.
Attachments
Screen Shot 2019-09-11 at 9.41.17 PM.png
Screen Shot 2019-09-11 at 9.41.17 PM.png (692.57 KiB) Viewed 57 times

bigrick
 
Posts: 2
Joined: Wed Sep 11, 2019 8:47 pm

Re: 7-Segment LED Backpack - Can't Address Left Colon or Dec

by kcl1s on Thu Sep 12, 2019 6:27 am

From the backpack guide

To control the colon and decimal points, use the writeDigitRaw(location, bitmap) function.

You are using writeDigitNum

Fellow hobbyist
Keith

kcl1s
 
Posts: 1251
Joined: Tue Aug 30, 2016 12:06 pm

Re: 7-Segment LED Backpack - Can't Address Left Colon or Dec

by bigrick on Thu Sep 12, 2019 7:30 pm

Wow, duh. Can't believe that was it. Thank you so much!!

bigrick
 
Posts: 2
Joined: Wed Sep 11, 2019 8:47 pm

Please be positive and constructive with your questions and comments.