Trying to use a servo with the RFM9x Lora transceivers. However I am getting the following error: "multiple definition of `__vector_17'". When I comment out the servo library, there is no error. So I know my issue is coming from including these two libraries: #include <RH_RF95.h> #include <Servo.h>
How can I get these two libraries to be allowed together?
multiple definitions of vectors does indicate, as you suspected, a conflict between libraries. Specifically, it indicates that both libraries are trying to use the same interrupt, usually in relation to an on-chip peripheral - in this case, one of the timer1 interrupts (they both try to "take over" that timer to use it for a specific purpose)
timer1 is, of course, the "good" timer (on most classic AVRs - the tx5 and tx61 instead have a "high speed" 10 or 12 bit timer as timer1 instead, which can do some cool things, but which hardly any libraries are smart enough to use and which have a real learning curve to figure out) - the one 16-bit timer on the '328p (the 328pb, and many newer or fancier avr's, have more than one 16-bit timer - though libraries are generally not smart enough to take advantage of them to prevent such conflicts, for example, between Tone() and Servo, or between Servo and libraries that default to Timer1 without fiddling with the library and/or core). Non-avr parts have different selection of timers with different features).
A solution, of course, is to use a library that makes use of a different timer, as suggested above - usually this is viable, though in some cases, the part won't have another suitable timer, so you would need to use a different part, or find less graceful solution). In the case of Servo, for example, there is a library that uses Timer2 to do the same thing, which is good enough for this purpose - IIRC the library has some drawback, maybe less granularity in positions the servo can hold)