# Display digits on 7 segment 3 digit LED display with Launchpad

I connected LED display according to this answer and here is my version of the sketch

But I am not sure how to control LED display correctly what data I need to send in order to display particular number or activate specific LED.

Please can someone explain me what is wrong or point me in correct direction?

UPDATE #1: LED doesn't blink and it is static while sketch is running.

• The code looks like it cycles thru 00 to FF (I'm no expert). You need to understand what the code does more thoroughly than me in order to pick-out the parts than can output the correct bit pattern to suit the data you need represented. – Andy aka Apr 16 '14 at 20:36
• actually this is what I want to figure out, I don't clearly understand what that code does and I am looking for a simple example how to trigger specific led, I read datasheet but I still don't understand, I am a newbie to this – endryha Apr 16 '14 at 20:44
• Does the LED look frozen as per the picture you've posted or is it clearly scrolling thru 00 to FF. Maybe all the segments appear to be but aren't because the scrolling is too fast? – Andy aka Apr 16 '14 at 21:00
• Where do you get 00-ff?? @andyaka – Passerby Apr 16 '14 at 21:36
• I've probably got it wrong @passerby but in the example code there are 7-seg definitions for 0 thru to F and in my limited capacity as a sometimes-programmer I assumed the code scrolled thru 00 to FF - I didn't see an "entry point" for a "number" to be displayed and put 2 and 2 together and quite possibly got 4.5835! – Andy aka Apr 16 '14 at 21:40

This is an energia/arduino sketch. Setup sets up the output pins, loop does the work via loadLed. loadLed() expects 3 bytes, one for each number. numbers[] holds 16 bytes, numbers 0-9,A-F.

As such, loadLed(numbers[8], numbers[8], numbers[8]); means load the led diplays with 8, 8, 8.

Considering the decimal point is on in your picture, the data isn't matching up between your led display, the sketch code, and the datasheet.

No decoupling cap. That can be an issue.

Update: I think the issue is in that you are sending 36 bits, not 35. Change for (int i=0; i <= 10; i++) to for (int i=0; i <= 9; i++). As well as the decoupling cap.

• yes this is exactly what I assume, but it doesn't seem to work, what can I do about it, what can I try to figure out how to trigger correct LEDs – endryha Apr 16 '14 at 21:59
• It's a serial drive to the LEDs so maybe clock is inverted or swapped with data. Should it scroll 00 to FF or does it do something else dude? Curiosity! – Andy aka Apr 16 '14 at 22:09
• @endryha try increasing the delays to 10 or 20 instead of just 5. Might be clocking too fast? – Passerby Apr 16 '14 at 22:17
• @endryha also add a decoupling capacitor to the led display's vcc/vdd and ground. – Passerby Apr 16 '14 at 22:20
• @endryha updated – Passerby Apr 16 '14 at 22:38