pwm led driver - pulsing "soft" leds

Have you got the greatest 48 bit multiplier ever conceived? Prove it - post your code here.

Moderator: phalanx

Post Reply
150c_vapour
Posts: 1
Joined: Thu Dec 13, 2012 5:56 pm

pwm led driver - pulsing "soft" leds

Post by 150c_vapour » Thu Dec 13, 2012 6:15 pm

Uses the output compares and timer2 to make a khz led dimmer. Totally smooth when interpolating at 30hz.

OC interrupts are used to get a smooth transition when setting new PWM values (got random extended pwm pulses otherwise).

The led sequences are meant to work with a single strip of leds where they all work to display one "state".

A timed sequence/state can be added on top of the running led state that runs for a period before reverting to the previous led pattern.

Not a complete module, #defs and tick counts needed, but should be easy to add to any pic24 project.

If your leds are on OC lines pwm will make them purdy.

http://pastebin.com/viDjh1Ji

Post Reply