khoih-prog / TimerInterrupt

This library enables you to use Interrupt from Hardware Timers on an Arduino, such as Nano, UNO, Mega, etc. It now supports 16 ISR-based timers, while consuming only 1 hardware Timer. Timers' interval is very long (ulong millisecs). The most important feature is they're ISR-based timers. Therefore, their executions are not blocked by bad-behaving functions or tasks. This important feature is absolutely necessary for mission-critical tasks.
MIT License
98 stars 11 forks source link

Conflict register with Servo library when using Timer Interrupt 1 #20

Closed Huyyuh2000 closed 3 years ago

Huyyuh2000 commented 3 years ago

Describe the bug

When I was using Timer 1 to read value form current sensor using Timer1 for servo control project. It occurred an error like image below. I haven't check it clearly but I think it is conflict with servo library form Arduino Ide

Screenshots

image

Information


Arduino IDE version: 1.8.13
Arduino Nano
Servo.h
khoih-prog commented 3 years ago

Without the MRE, no one will spend time to understand what's wrong with your code.

On the other hand, using TimerInterrupt and ISR requires more sophisticated knowledge about hardware, coding in order to prevent conflicts. So you have to check, research and understand why there is conflict and use different Timer to avoid the issue.

I'm closing the issue now, and only reopen when you post MRE and prove this is a bug of the TimerInterrupt library.

Also you have to post the code correctly, by using code tag ( <> or tripple ticks), not just a useless picture.