Understanding seven segment displays

Arduino Technology
Understanding seven segment displays

sevenseg01.gif

I’ve been playing around with the 7-Segment Shield for Arduino from the Maker Shed, and realize that I need a better understanding of how seven segment displays work.

When addressing the display from the sample Arduino sketch, I was pulling pre-formed characters from an array of hex values.This means that when I wanted a number 3, for example, I’d ask for NumberLookup[3], which had been assigned hex value 0x4F. I asked my friend Tod Kurt, “What’s this mapping, is there a standard table of characters to hex they’re pulling from?”. He responded, “That’s hex for “01001111” in binary, five ones in there equate to five lit segments. You should look at the datasheet for the SAA1064 LED-driver for the segment mapping. Or better yet, reverse-engineer the binary-to-segment relationship.”

sevenSegNotebookScan01.jpg

So that’s what I did, and I have a better understanding of how it works as a result. Starting with the decimal point and moving through each character segment, I numbered which segment lit up when I asked for them to display via binary. The first place, or B10000000, lit the dot. Next, B01000000, lit the middle horizontal segment. Once I’d mapped out all the relationships, I wrote an Arduino sketch to cycle through each segment on the first digit, while displaying its binary place in the third digit (that’s the fancy GIF animation up there). Next up, I’ll discuss forming characters from an array of hex values.

In the Maker Shed
MKGR2-3.jpg

The Arduino 7-Segment Shield has four 7-segment displays (and driver), a temperature sensor, a PWM RGB LED, and plugs into an Arduino.

What will the next generation of Make: look like? We’re inviting you to shape the future by investing in Make:. By becoming an investor, you help decide what’s next. The future of Make: is in your hands. Learn More.

John Edgar Park likes to make things and tell people about it. He builds project for Adafruit Industries. You can find him at jpixl.net and twitter/IG @johnedgarpark

View more articles by John Edgar Park
Discuss this article with the rest of the community on our Discord server!

ADVERTISEMENT

Escape to an island of imagination + innovation as Maker Faire Bay Area returns for its 16th iteration!

Prices Increase in....

Days
Hours
Minutes
Seconds
FEEDBACK