dmadison / ServoInput

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

Generic Development 3 #9

Closed dmadison closed 4 years ago

dmadison commented 4 years ago

Reworks the begin/end idiom so that the pin setup and interrupt is created during the constructor rather than by the user during setup. This is simpler, cleaner, and requires less effort by the user. Accordingly these two functions have been renamed attachInterrupt and detachInterrupt following the Arduino conventions, and removed from the linked list manager.

This pull request also changes the default range variables to use the full range instead of half range (+/-), which is more intuitive. The max "valid" range has accordingly been reduced to 2000 us, double that of the default.

Lastly, this fixes a nullptr bug with the linked list, adds a getNumSignals function, and makes the pin value accessible from the base class.