开发者

Can I use Arduino 16-bit PWM on only one pin?

开发者 https://www.devze.com 2023-02-28 08:32 出处:网络
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).

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
0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号