dmadison / ServoInput

Interrupt-driven servo decoder library for Arduino
GNU Lesser General Public License v3.0
22 stars 10 forks source link

Pin-Change Interrupts #4

Closed dmadison closed 4 years ago

dmadison commented 4 years ago

Modifies the library to allow pin-change interrupts. Also adds a "PinChange" example, using pin 9 (D9) of the Arduino Uno (328P boards).

The unfortunate downside of this is that it doesn't strictly enforce the use of external interrupt pins using static_assert, which makes it possible for users to set a pin that doesn't support an external interrupt without the library reporting any issues. As far as I know it's not possible to get the template to throw a compile-time warning, only a compile-time error. So we'll have to rely on the "USE AN INTERRUPT-CAPABLE PIN" comments at the top of every example.