Can I use Arduino 16-bit PWM on only one pin?
I have an Arduino Duemilanove on which I would like to use the internal 16-bit timer to do PWM on pin 9 and not pin 10 (I have a Wifi shield in my project which requires the use of pin 10).
Is it possible to configure the timer to send a signal on pin 9 but to not touch pin 10?开发者_开发百科
The answer is yes, you can. I used the TimerOne library: http://www.arduino.cc/playground/Code/Timer1
in setup()
Timer1.initialize(5000)
Timer1.disablePwm(10); //WiServer needs pin 10!
Timer1.pwm(9, 0); //set up pin 9
精彩评论