Write directly to PWM pin?

Do you have a question on how to do something.
Ask in here.
Post Reply
User avatar
cosmith71
Posts: 1437
Joined: Fri Mar 29, 2013 3:51 pm
Location: Oklahoma City

Write directly to PWM pin?

Post 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
User avatar
cosmith71
Posts: 1437
Joined: Fri Mar 29, 2013 3:51 pm
Location: Oklahoma City

Re: Write directly to PWM pin?

Post by cosmith71 »

Roberto?
rimai
Posts: 12881
Joined: Fri Mar 18, 2011 6:47 pm

Re: Write directly to PWM pin?

Post by rimai »

Yes.
Use analogWrite...

Code: Select all

analogWrite(daylightPWMPin,255);
analogWrite(actinicPWMPin,255);
Roberto.
User avatar
cosmith71
Posts: 1437
Joined: Fri Mar 29, 2013 3:51 pm
Location: Oklahoma City

Re: Write directly to PWM pin?

Post by cosmith71 »

Thanks! That's much better. Now I just need to figure out a good lightning algorithm.
Post Reply