Shop OBEX P1 Docs P2 Docs Learn Events
7 Segment LED digital display woes — Parallax Forums

7 Segment LED digital display woes

RobofiendRobofiend Posts: 3
edited 2008-07-18 23:42 in Propeller 1
Hi, im a very new programmer, and I need some help trying to make the 7 segment LED digital display that I bout at radioshack (http://www.radioshack.com/product/index.jsp?productId=2062557&cp=&sr=1&origkw=7+segment+LED+digital+display&kw=7+segment+led+digital+display&parentPage=search)·work.· I have a propeller protoboard, and I really have very little idea where to start.· I don't really know how to work with the object I found (http://obex.parallax.com/objects/142/), and I dont know if its right.· If anyone could help, or if a post on this subject has already been made, please respond.· Thank you!

Comments

  • KamPuttyKamPutty Posts: 48
    edited 2008-07-11 21:13
    Hi Robofiend,

    Do this.

    Get the 7-segment, and just turn on one of the segments. All a 7 segment is a grouping of 7 LEDs. Make sure to use the correct resister else you will
    burn the LED out...I think the forward voltage is what, 20ma?

    Once you can turn on a LED using a batter+resister, you're nearly there!

    Now just add the prop...you can connect the + to the res+led and toggle the pin to make the led work.

    Now, you have 7 LED's to work with! Normally(?), you would multiplex all 7 segments, just turning on one at a time to make the effect of all of them "no"

    ya?

    make sense?

    If you blow anything up, I never wrote this... shocked.gif

    Take care,

    ~Kam (^8*
  • KamPuttyKamPutty Posts: 48
    edited 2008-07-11 21:14
    oh, I forgot, the 7 segments all share a common ground or + (I did not look at the spec)...you'll see it labeled as "CC" or "CA" (commom cathode, common anode)
  • LeonLeon Posts: 7,620
    edited 2008-07-11 21:29
    Segments aren't usually multiplexed, the displays are. Since the OP only has one display he won't need any multiplexing, he can just turn the segments on together.

    Leon

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Amateur radio callsign: G1HSM
    Suzuki SV1000S motorcycle
  • StefanL38StefanL38 Posts: 2,292
    edited 2008-07-11 21:45
    Hello Robofriend,

    by googling i found this website explaining 7segment-displays

    ee.hawaii.edu/~sasaki/EE361/Fall06/Lab/7disp.html


    Each of the 7 LEDs take about 20 mA at 1,7V.
    There are two things to take care of:
    1.) you need a current-limiting resistor value: (3,3V - 1,7V) / 0,020A = 80 Ohms.
    2.) If you want to connect it directly to the propeller 7 segments take 7x20mA = 140 mA

    The propeller in summary can stand a current of 300 mA so with 2 7segements with at 280mA you are near to the limit

    If you want to connect more than two 7segDisplay use transistors to switch on/off the LEDs of the 7segment-displays.

    best regards

    Stefan
  • Timothy D. SwieterTimothy D. Swieter Posts: 1,613
    edited 2008-07-12 05:35
    Robofiend,

    Welcome to the forum! This is a great place to look for help and answers. Did the posts above help you? StefanL38 shows the calculation for determining the correct resistor size to use. 80 Ohms works, but in reality I would place a 120 Ohm or 240 Ohm resistor. I bet the LEDs will be bright enough with the lower current to each LED and this will keep you out of the danger zone on over current.

    You said you have a protoboard, right? Have you read and tried any of the tutorials in the PE Kit (freely downloaded PDFs) to learn more about SPIN? Is this your first project with the Prop?

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Timothy D. Swieter, E.I.

    www.brilldea.com·- Prop Blade, LED Painter, RGB LEDs, uOLED-IOC
    www.sxmicro.com - a blog·exploring the SX micro
    www.tdswieter.com
  • RobofiendRobofiend Posts: 3
    edited 2008-07-14 16:47
    The above previous responses were great. I appreciate such a quick response- I didn't even think to check the first few days. I have read through much of the manual, and understood much of it, if that is what you are talking about. This is my second Prop project- the first of which was to use the servo-4 object to control an arm. I think I understand the power issues pretty well, but what I was wondering was whether or not there was a quick and easy way to plug a variable # into an object, and have that # appear on the display, without the need to enter the specific output pins which would need to be displayed every time. My hope was that the previously mentioned object file could do that. I want to thank you again for such rapid responses.
  • LeonLeon Posts: 7,620
    edited 2008-07-14 16:58
    http://obex.parallax.com/objects/142/ should do what you want. What is wrong with it?

    Leon

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Amateur radio callsign: G1HSM
    Suzuki SV1000S motorcycle
  • RobofiendRobofiend Posts: 3
    edited 2008-07-18 23:42
    I'm sure that it will do exactly what I wnat, but sadly enough I don't know how to work it...
    Frankly, I dont know where to plug in the #s I want displayed and the pins- If there is an easy way which I am just missing, it would be great if you could tell me

    Here is the provided demo code...
    {Demo program for SevenSegment object.}

    CON
    _clkmode = xtal1 + pll16x
    _xinfreq = 5_000_000

    lowDigit = 3 'Low digit cathode
    digits = 5 'Number of digits to display
    Segment0 = 9 'Segment start pin

    VAR
    long counter

    OBJ
    sevenseg : "SevenSegment"

    PUB Start
    sevenseg.start(lowDigit, digits, Segment0, true)

    counter := 0
    repeat
    sevenseg.SetValue(counter++)
    if (counter / 10 // 10) == 0
    sevenseg.disable 'disable the display when the second digit is 0
    else
    sevenseg.enable
    waitcnt(clkfreq/10 + cnt)
    sevenseg.SetValue(99)


    Thanks for all your help!
Sign In or Register to comment.