Go Down

Topic: twinkle led's (Read 1 time) previous topic - next topic

markthespark

Sep 16, 2012, 10:03 pm Last Edit: Sep 16, 2012, 10:18 pm by markthespark Reason: 1
hi all
i know the mega wich i have has got Digital I/O Pins   54 (of which 15 provide PWM output)
can i get all the 54 pins to twinkle an individual led like stars in the sky at night in a random pattern ??
or what would be the better alternative?

johnwasser

Yes, you can have each pin twinkle one LED.  Using a higher voltage power source and a transistor for switching you can have each pin twinkle a set of multiple LEDs.  If you spread the members of the set over a wide area it should not be obvious that several are blinking synchronously.

Using multiplexing you can have N pins control (N/2)^2 LEDs (50 pins = 625 LEDs).  You will need N/2 drive transistors.

Using Charlieplexing you can have N pins control N^2-N LEDs (50 pins = 2450 LEDs). You will only be able to light one at a time.
Send Bitcoin tips to: 1L3CTDoTgrXNA5WyF77uWqt4gUdye9mezN
Send Litecoin tips to : LVtpaq6JgJAZwvnVq3ftVeHafWkcpmuR1e

markthespark

would this sketch be ok once i mod it ?
http://joesgizmos.wordpress.com/2012/07/06/twinkle-leds/


i'm getting in to multiplexing soon

johnwasser


would this sketch be ok once i mod it ?
http://joesgizmos.wordpress.com/2012/07/06/twinkle-leds/


i'm getting in to multiplexing soon


If you use an array like:
Code: [Select]
const int LED_Pins[] = {2,3,4,5,6,7,8,9,10};

instead of :
Code: [Select]

#define LED1 2
#define LED2 3
#define LED3 4
#define LED4 5
#define LED5 6
#define LED6 7
#define LED7 8
#define LED8 9
#define LED9 10


it will be much easier to expand and easier to manipulate LEDs by index.
Send Bitcoin tips to: 1L3CTDoTgrXNA5WyF77uWqt4gUdye9mezN
Send Litecoin tips to : LVtpaq6JgJAZwvnVq3ftVeHafWkcpmuR1e

Go Up
 


Please enter a valid email to subscribe

Confirm your email address

We need to confirm your email address.
To complete the subscription, please click the link in the email we just sent you.

Thank you for subscribing!

Arduino
via Egeo 16
Torino, 10131
Italy