I have a functionnal Zumo now, but I’d like to add the buzzer and accelerometer features. From now, I’m playing with the buzzer.
But, I can not compile the code because of this error :
ZumoBuzzer/ZumoBuzzer.cpp.o: In function `ZumoBuzzer::playMode(unsigned char)':
/usr/share/arduino/libraries/ZumoBuzzer/ZumoBuzzer.cpp:722: multiple definition of `__vector_9'
ServoTimer2/ServoTimer2.cpp.o:/usr/share/arduino/libraries/ServoTimer2/ServoTimer2.cpp:94: first defined here
collect2: ld returned 1 exit status
It looks like your code isn’t compiling because there are multiple conflicting definitions of the Timer2 overflow interrupt. The ZumoBuzzer library uses Timer2 to control the buzzer, so unfortunately, you won’t be able to use it along with any other library that uses Timer2.
So, I presumed that I can put the jumper and directly use a digitalWrite() on pin3 to play a note. But the zumo is still very quiet…
Do you have an idea on how should I fix it ?
You need to drive the buzzer pin at the frequency of the sound you want it to make. Just driving it steadily high could just burn it out. So, for example, if you want to play a 1 kHz note, you would drive the buzzer pin high for 500 us, low for 500 us, high for 500 us, low for 500 us, etc.