Shop OBEX P1 Docs P2 Docs Learn Events
display — Parallax Forums

display

MacGeek117MacGeek117 Posts: 747
edited 2005-01-05 23:44 in Learn with BlocklyProp
Instead of using 7 1-kilo-ohm resistors connected to all the segments like in the WAM
book, chapter 6, page 172, why don't you use 1 resistor connecting common to
ground? -bugg

Comments

  • Martin HebelMartin Hebel Posts: 1,239
    edited 2005-01-03 19:13
    One good reason is because LED's drop a certain amount of voltage across them, and LED's have varying·tolerances, connecting all the LED's in parallel·with a common current limiter gives varying levels of brightness affecting the quality of the display.

    Feel free to experiment with a common resistor though!




    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Martin Hebel

    Electronic Systems Technologies
    Southern Illinois University Carbondale
    Personal Links - ·Lot of BASIC Stamp info
    and
    SelmaWare Solutions
    StampPlot Pro Version 3 Release 4
    Graphical Data Acquisition for your Micro and Imagination!
    Now allows additional controls to be added, or developed.
    ·
  • allanlane5allanlane5 Posts: 3,815
    edited 2005-01-03 19:24
    Also, if you turned on ONE LED, it would draw a certain current (5 Volts - 1.4 volts) / 1000 == 3.6 mA

    Now, if you turned on a second LED, the 3.6 mA would be divided in half -- each would get half (depending on the manufacturing tolerances of the LED's). Thus, they would be half as bright -- if they lit at all. With the third LED, it gets even less.

    Now, if each one has its own resistor, then each one gets its own 3.6 mA.

    Now, if you had a faster processor, concievably you could 'strobe' each LED segment so only one at a time was on.· If you cycled through all LED's fast enough (20 times a second or more), your eye would 'average' out the pulses so they would all seem to be on.· I'm not sure the BS2 is fast enough for this -- but even if it was, you wouldn't want to spend all of its time refreshing an LED display.
  • MacGeek117MacGeek117 Posts: 747
    edited 2005-01-04 16:52
    Thanks guys! is there any way of strobing the display with a BS2?
    -bugg
  • Chris SavageChris Savage Parallax Engineering Posts: 14,406
    edited 2005-01-04 17:59
    I don't know what made me think of it, but years ago when I was first building with a lot of LEDs on a board, I remember reading an article for a Constant Current Regulator...Seems like it used a standard LM78xx/LM340 regulator, configured in a strange manner...Ah, okay, here it is, right in the datasheet!

    http://www.national.com/ds/LM/LM340.pdf

    If memory serves, we used this in a Digital Dashboard project some years ago to maintain brightness on the dash display.



    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Chris Savage

    Knight Designs
    324 West Main Street
    P.O. Box 97
    Montour Falls, NY 14865
    (607) 535-6777

    Business Page:·· http://www.knightdesigns.com
    Personal Page:··· http://www.lightlink.com/dream/chris
    Designs Page:··· http://www.lightlink.com/dream/designs
    ·
  • MacGeek117MacGeek117 Posts: 747
    edited 2005-01-05 14:27
    Thanks guys. Thanks Chris. I'll try to figure that out. -bugg
  • MacGeek117MacGeek117 Posts: 747
    edited 2005-01-05 14:41
    Oh, by the way, is there any way to program a BS2, e, sx, p, pe, to have a 12-bit
    variable? -bugg
  • MacGeek117MacGeek117 Posts: 747
    edited 2005-01-05 15:00
    Also, guys, check the program and please tell me if it would work. -bugg
  • edited 2005-01-05 19:29
    That's pretty cool, and it looks like it should work so long as the result is less than 65536.

    It's also possible to plot the rectangle in the Debug Terminal. If you're interested, check out Activities 1 and 2 in this post:

    How to - Accelerometer (2) Tilt, Display Graphics, and Video Games

    ... actually, it turned out to be a little bit of a head-scratcher, so here is a code snippet you can add to your program between the last DEBUG command and the LOOP:

    [color=blue][color=#000000][color=green][color=green]  ' Plot perimeter with length and width.[/color]
    [color=green]  ' Add to PERIMITER_FINDER.bs2 - insert between the [/color]
    [color=green]  ' last DEBUG and the LOOP command.[/color]
         [color=blue]DEBUG[/color] [color=purple]CRSRXY[/color][color=black], 0, 7[/color]
      [color=blue]FOR[/color][color=black] perimeter = 0 [/color][color=blue]TO[/color][color=black] ((width * 2) - 1) [/color][color=blue]STEP[/color][color=black] 2[/color]
        [color=blue]DEBUG[/color] [color=purple]CRSRX[/color][color=black], perimeter, [/color][color=red]"* "[/color]
      [color=blue]NEXT[/color]
      [color=blue]FOR[/color][color=black] perimeter = 1 [/color][color=blue]TO[/color][color=black] (length - 1)[/color]
        [color=blue]DEBUG[/color] [color=purple]CR[/color][color=black], [/color][color=red]"*"[/color][color=black], [/color][color=navy]REP[/color] [color=red]" "[/color][color=black] \((width * 2) - 3), [/color][color=red]"*"[/color]
      [color=blue]NEXT[/color]
      [color=blue]FOR[/color][color=black] perimeter = 0 [/color][color=blue]TO[/color][color=black] ((width * 2) - 1) [/color][color=blue]STEP[/color][color=black] 2[/color]
        [color=blue]DEBUG[/color] [color=purple]CRSRX[/color][color=black], perimeter, [/color][color=red]"* "[/color]
      [color=blue]NEXT[/color]
     
      [color=blue]DEBUG[/color] [color=purple]CR[/color][color=black], [/color][color=purple]CR[/color][color=black], [/color][color=red]"Press any key: "[/color]
      [color=blue]DEBUGIN[/color][color=black] perimeter[/color]
      [color=blue]DEBUG[/color] [color=purple]CLS[/color]
     
    [/color][/color][/color]
    

    Post Edited (Andy Lindsay) : 1/5/2005 10:11:26 PM GMT
  • MacGeek117MacGeek117 Posts: 747
    edited 2005-01-05 23:22
    Here is another program for someone to check. -bugg
  • MacGeek117MacGeek117 Posts: 747
    edited 2005-01-05 23:34
    Oh, by the way, if you didn't uderstand the program, look at page 172 of the WAM book
    -bugg
  • edited 2005-01-05 23:36
    Hmmm, yes, I was hoping somebody would do that. It's a nice combination of a couple of different elements from What's a Microcontroller, right?

    You can probably replace all the PAUSE 1000 commands in the CASE statements with just one after the ENDSELECT.

    Although the program will work without the PAUSE, it probably helps prompt the user to have a delay before the next digit request.
  • MacGeek117MacGeek117 Posts: 747
    edited 2005-01-05 23:44
    thanks again Andy. I didn't think of that . Also I've made an area finding program. -bugg
Sign In or Register to comment.