Making a flying star effect with LEDs


Closed Thread
Results 1 to 23 of 23

Hybrid View

  1. #1
    Join Date
    May 2009
    Location
    Montreal, QC, Canada
    Posts
    118

    Default Making a flying star effect with LEDs

    The theory in my head was quite simple, I connected 16 LEDs in a matrix like so:
    Name:  matrix.PNG
Views: 1403
Size:  34.7 KB
    but physically they are positioned in a single row from LED1 to LED16
    I am testing with 16 LEDs but ideally I would do this with 64.

    I can turn them on one at a time using this:
    Code:
    portb = %00011110:pause 25
    portb = %00101110:pause 25
    portb = %01001110:pause 25
    portb = %10001110:pause 25
    portb = %00011101:pause 25
    portb = %00101101:pause 25
    portb = %01001101:pause 25
    portb = %10001101:pause 25
    portb = %00011011:pause 25
    portb = %00101011:pause 25
    portb = %01001011:pause 25
    portb = %10001011:pause 25
    portb = %00010111:pause 25
    portb = %00100111:pause 25
    portb = %01000111:pause 25
    portb = %10000111:pause 25
    But I actually want to turn them on much like a flying star where LED1 stays on until LED9 goes on.
    I was able to get one row lit but I can't figure out how to turn on the LEDs on the second row while keeping the LEDs on in the first row.

    Is there a simple trick for this?

    Mike

  2. #2
    Join Date
    Oct 2005
    Location
    Sweden
    Posts
    3,604


    Did you find this post helpful? Yes | No

    Default Re: Making a flying star effect with LEDs

    Hi Mike,
    You need to scan the matrix continously. Ie. do what you did in your example but over and over again at fast rate. The LEDs will blink but if the scan rate is high the human eye won't see it.

    EDIT: Just remember not to sink too much current into the B0-B3 pins!

    /Henrik.

  3. #3
    Join Date
    May 2009
    Location
    Montreal, QC, Canada
    Posts
    118


    Did you find this post helpful? Yes | No

    Default Re: Making a flying star effect with LEDs

    Hi Henrik,

    It does not show on my drawing but I have a resistor on each led's anode.

    For the scanning part I think I see what you mean and I will play with my code. I presume I should make two subroutines for each led (ON / OFF) and have a the main program call the subroutines based on what's on and what's off.
    Now the theory in my head is becoming a little more complex...

    Mike

  4. #4
    Join Date
    Jan 2006
    Location
    Istanbul
    Posts
    1,185


    Did you find this post helpful? Yes | No

    Default Re: Making a flying star effect with LEDs

    You may use this to create flying star effect.

    http://www.picbasic.co.uk/forum/showthread.php?t=10564
    "If the Earth were a single state, Istanbul would be its capital." Napoleon Bonaparte

  5. #5
    Join Date
    May 2009
    Location
    Montreal, QC, Canada
    Posts
    118


    Did you find this post helpful? Yes | No

    Default Re: Making a flying star effect with LEDs

    This is going to be handy, I've been pulling my hair out all day trying to figure this out.

    Thanks for the link.

    Mike

  6. #6
    Join Date
    Sep 2005
    Location
    Campbell, CA
    Posts
    1,107


    Did you find this post helpful? Yes | No

    Default Re: Making a flying star effect with LEDs

    PLEASE put resistors in series with the LEDs. LEDS ARE NOT INCANDESCENT LAMPS!!
    Charles Linquist

Members who have read this thread : 0

You do not have permission to view the list of names.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts