Page 1 of 1

Write directly to PWM pin?

Posted: Sun Jul 27, 2014 8:13 am
by cosmith71
How can I write directly to the PWM ports? I'm working on a lightning routine and changing it via normal means is not responsive enough.

Something like analogWrite(some pin number, some byte).

--Colin

Re: Write directly to PWM pin?

Posted: Sun Jul 27, 2014 2:06 pm
by cosmith71
Roberto?

Re: Write directly to PWM pin?

Posted: Sun Jul 27, 2014 2:14 pm
by rimai
Yes.
Use analogWrite...

Code: Select all

analogWrite(daylightPWMPin,255);
analogWrite(actinicPWMPin,255);

Re: Write directly to PWM pin?

Posted: Sun Jul 27, 2014 3:01 pm
by cosmith71
Thanks! That's much better. Now I just need to figure out a good lightning algorithm.