I wanted to use both TMRpcm and VirtualWire with ATmega328 in an Arduino-like board I'm making, but both libraries use TIMER1. I wanted to use each lib for the following purposes:
- TMRpcm: play a WAV sound from an SD Card;
- VirtualWire: to receive commands from an RF remote control.
TMRpcm Advanced Features Wiki has a section on how to use TIMER2 instead, but I couldn't get it to work. They also say:
Notes:
- This is usually not the best solution.
So, before I spend any more time on this, I would like to hear what you guys have to say.
So, my question is: is there a workaround to solve this conflict on the use of TIMER1, so I can use both libs in my project?
If not, what other alternatives do I have?
My circuits for reading the SD card and driving the speaker are similar to the schematic in this Instructable: Playing Wave file using Arduino. And I'm using one of those 433MHz Receiver modules for the RF part (standard, working circuit).
Both features, the RF receiver and SD card WAV playing, work correctly, when run separately (with separate sketches).