Switching LEDs fast

Thread Starter

DancinNancy

Joined Oct 1, 2008
24
I have read several times that if you switch LEDs on and off quick enough nobody will be able to tell it is turning off. I want to be able to switch between at least 2, preferably 4, LEDs so that they all look like they are staying on. Does anyone have any example code of something like this that I can go by
 

mik3

Joined Feb 4, 2008
4,843
If you just want to switch 4 leds on/off use a 555 timer to do it. It really works! If you want see my spectrum analyzer on the first link below, all the display works on this effect which is called the effect of persistence of vision.
 

SgtWookie

Joined Jul 17, 2007
22,230
I have read several times that if you switch LEDs on and off quick enough nobody will be able to tell it is turning off.
That's true, once you get over perhaps 30Hz, persistence of vision makes it difficult to tell that the LED is not on constantly.
I want to be able to switch between at least 2, preferably 4, LEDs so that they all look like they are staying on. Does anyone have any example code of something like this that I can go by
The code is going to be rather hardware-specific. Something written for an Atmel won't run on a Microchip uC.

Microchip's PICKIT 1 flash starter kit comes with a PIC12F675 programmed to flash 8 LEDs, one at a time (demo.c). I changed it to flash 12 LEDs in selectable patterns. However, the program and header files are copyrighted, so I won't upload it.

You may be able to download it from the Microchip website.

There are plenty of examples of code to flash LEDs on sites like Instructibles.com - look for Charlieplexing examples and the like.
 

KL7AJ

Joined Nov 4, 2008
2,229
That's true, once you get over perhaps 30Hz, persistence of vision makes it difficult to tell that the LED is not on constantly.


The code is going to be rather hardware-specific. Something written for an Atmel won't run on a Microchip uC.

Microchip's PICKIT 1 flash starter kit comes with a PIC12F675 programmed to flash 8 LEDs, one at a time (demo.c). I changed it to flash 12 LEDs in selectable patterns. However, the program and header files are copyrighted, so I won't upload it.

You may be able to download it from the Microchip website.

There are plenty of examples of code to flash LEDs on sites like Instructibles.com - look for Charlieplexing examples and the like.
We used to use LEDs for calibrating photomultipliers....we could get down to around 10 nS switching times with off the shelf devices.

eric
 
Top