1.2" 4 Digit 7 Segment LED Display
Moderators: adafruit_support_bill, adafruit
Please be positive and constructive with your questions and comments.
- Old_Man_Still_Learning
- Posts: 2
- Joined: Fri Nov 18, 2022 1:16 pm
1.2" 4 Digit 7 Segment LED Display
I am using the adafruit 1.2" 4 Digit 7 Segment Display with Backpack connected to a Arduino UNO R3. Programming using Arduino IDE 2.0.2. I can get the display to show numbers and flash the colon between digits 2 and 3. I am trying to turn on the colon dots in front of the first digit, referred to as left colon lower dot and left colon upper dot. their addresses are given as 0x04 and 0x08. I can't find the correct way to turn them on or off. They are supposed to work using writeDigitNum or writeDigitRaw but I am unable to work out the correct way to address them. how is the address 0x04 used in conjunction with writeDigitNum and how do specify weather the colon is to be on or off. would it be something like matrix.writeDigitNum(0x04, true). I'm new to this and have managed to get this far but now I am stuck.
- adafruit_support_bill
- Posts: 88154
- Joined: Sat Feb 07, 2009 10:11 am
Re: 1.2" 4 Digit 7 Segment LED Display
The first parameter to writeDigitRaw is the location. The location for the colons is #2:
To turn them all off, you simply write zero:
The second parameter is a bitmap, specifying which bits to turn on. To turn on both dots of the left colon, you need to do a bitwise OR of the bits for the upper and lower dot: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 (upper right)
Code: Select all
matrix.writeDigitRaw(2, 0x04 | 0x08);
Code: Select all
matrix.writeDigitRaw(2, 0);
- Old_Man_Still_Learning
- Posts: 2
- Joined: Fri Nov 18, 2022 1:16 pm
Re: 1.2" 4 Digit 7 Segment LED Display
Thank you, that is exactly what I needed. It turns out that the upper left dot is 0x04 and the lower dot is 0x08, the opposite of what is listed. I can now continue with my project.
Please be positive and constructive with your questions and comments.