I’m working on a hobby project to make a simple doorbell that plays a chime on a file on an sd card through a speaker on a button press but am stumbling on the first step.
I’m having issues with finding a simple audio library. I tried using Audio.h, TMRpcm.h, and AudioZero.h.
In the repository they all show as compatible with the Arduino Uno WiFi Rev 2 however whenever I try and verify in the IDE I get the following error:
“WARNING: library TMRpcm claims to run on avr architecture(s) and may be incompatible with your current board which runs on megaavr architecture(s).”
What am I doing wrong/what library should I be using?
Unfortunately there is a bug in the Arduino Library Reference, which causes it to provide incorrect information about compatibility.
The library author has specified that the library is compatible with the avr architecture of the Arduino boards like the UNO R3:
It is important to understand the difference between warnings and errors. The purpose of a warning is to notify you there is something that could possibly cause a problem. Conversely, an error is a fatal problem. In this case you have encountered a warning, not an error. In order to avoid confusion, we should be careful to use the appropriate terminology when communicating about technical subjects.
I'm guessing you saw some actual errors when you tried to compile the sketch. Don't you think it would have been useful to include those errors in your post in addition to the warning? Providing this type of important detail allows the forum helpers to more effectively assist you.
When a library contains low level code, we might find that it is only compatible with the architectures for which the library author added explicit support. Conversely, due to the standardization of the Arduino core API, libraries that only contain higher level code may be compatible with all architectures. In the latter case, we would expect the library developer to specify universal architecture compatibility. However, some library authors choose not to do that because they prefer to be conservative and only specify compatibility with the architectures they have personally verified as working, and which they are willing to support. In this case, you will see this warning even though the library is actually completely compatible with the board's architecture. So you can see that providing the warning by itself doesn't provide us with a full picture of the situation. Things become much more clear if the compiler errors are included along with the warning.