On Wed, 6 Mar 2002, Les Otter wrote: > I'm working on an auto-ranging sequential shift > lights array for racecars / bikes. The array of > LEDS will sequentially light up as the engine > nears it's optimum "change-up" rpm. Cool... commercial or hobby? I'd like one for my car... 8) > I want the LEDs to get doubly bright when all > lights are on. > PWM seems the usual way to adjust brightness on > LEDS, but can I just double up on the number of > pins driving each LED (I have enough), so 1 pin is > normal, then switch to 2 pins at the panic point? > Can they both drive the same LED - each pin > through it's own (say 68R) resistor? WIll I need > series diodes on each pin? Sounds like that would work, but waste a lot of pins. > I don't fancy bit banging the RPM in whilst PWM > encoding an output for 8 leds...could get a bit > frantic - plate spinning comes to mind! Naaah. You can drive all your LEDs from the anode end thru a small resistor, tie all the cathodes together and slap a 2N2222 or something between them and ground, drive it with PWM. PWM is pretty much "set and forget" if you're using a PIC with CCP. The RPM can be measured with another CCP or just a loop checking the pulse input and calculating the pulse interval from a timer. When using a PIC wth no CCP module to do PWM, I just set up a TIMER0 interrupt routine to handle it. Each time it's called it checks a bit variable to see if the output is ON or OFF. If it's OFF, turn it ON and set TIMER0 to 255-. If it's ON, turn it OFF and set TIMER0 to . Quick and easy, I just did another project that way last night to control the speed of a small DC motor. Doesn't sound like that tough a job... give it a try, you might be surprised! Dale -- http://www.piclist.com#nomail Going offline? Don't AutoReply us! email listserv@mitvma.mit.edu with SET PICList DIGEST in the body