Skip to main content
deleted 37 characters in body
Source Link
caligari
  • 221
  • 1
  • 9

Yes, Arduino Servo library uses Timer1 (and other ones, depending on Arduino boards) to manage FastPWM via software interrupts. Timer2 is used by tone() function,: be careful of you don't need it if your intention is to manage this another timeryou are using that function.

A good example using Timer2 to generate PWM is the Infrared remote library for Arduino. If IR_USE_TIMER2 is defined it useswill use Timer2. The key code is at IRremote.cpp where the ISR is managed.

Yes, Arduino Servo library uses Timer1 (and other ones depending on Arduino boards) to manage FastPWM via software interrupts. Timer2 is used by tone() function, be careful of you don't need it if your intention is to manage this another timer.

A good example using Timer2 to generate PWM is the Infrared remote library for Arduino. If IR_USE_TIMER2 is defined it uses Timer2. The key code is at IRremote.cpp where ISR is managed.

Yes, Arduino Servo library uses Timer1 (and other ones, depending on Arduino boards) to manage FastPWM via software interrupts. Timer2 is used by tone() function: be careful if you are using that function.

A good example using Timer2 to generate PWM is the Infrared remote library for Arduino. If IR_USE_TIMER2 is defined it will use Timer2. The key code is at IRremote.cpp where the ISR is managed.

Source Link
caligari
  • 221
  • 1
  • 9

Yes, Arduino Servo library uses Timer1 (and other ones depending on Arduino boards) to manage FastPWM via software interrupts. Timer2 is used by tone() function, be careful of you don't need it if your intention is to manage this another timer.

A good example using Timer2 to generate PWM is the Infrared remote library for Arduino. If IR_USE_TIMER2 is defined it uses Timer2. The key code is at IRremote.cpp where ISR is managed.