Go Down

Topic: SoftPWM Library (Read 16 times) previous topic - next topic

bhagman

Mar 17, 2010, 07:06 am Last Edit: Mar 17, 2010, 07:13 am by bhagman Reason: 1
I created a new software PWM output library.  It was made for controlling LEDs.

A few features of this library:
  • Arbitrary output pins.
  • Up to 16 different channels can be created.
  • True zero level, i.e. off = off
  • Separate fade rates for on and off.


http://code.google.com/p/rogue-code/wiki/SoftPWMLibraryDocumentation

Quick demos here:

[media]http://www.youtube.com/watch?v=2slHEADOJ8g&feature=player_embedded[/media]

[media]http://www.youtube.com/watch?v=jE7Zw1zNL6c&feature=player_embedded[/media]

b

Marvin Martian

That's neat - I was just writing some code to manage the fade up & down when switching the LEDs too - but using the built in PMW so was limited to the 6 lines. Yours is much better!

Valygar

#2
Jul 09, 2010, 07:50 pm Last Edit: Jul 09, 2010, 07:52 pm by Valygar Reason: 1
One question about the library. I tried to use it with a project that used already the 6 PWM ports, and it didn't work (there was no activity at the sofpwm port, or the hardware pwm ports)

I tried to disable the analogPWM hardware signals, pin outputs and then the leds controlled by softpwm worked.

So, if I use this library I have to control all pins with this library?

In any case, many thanks for this library!

bhagman

The SoftPWM Library only uses Timer2.  So, unless there is something I'm missing, you just won't be able to use the two hardware PWM output pins for that timer (pins 3 and 11).  The others should work (hardware PWM on pins 5, 6, 9 and 10).

b

zonkie

So, do i understand it right, that this Library makes me able to use the digital out pins on my duenmilanove (Or also the mini) as PWM Pins?

Go Up