Let's Make Robots!

tone

Need Help with conflicting Arduino libraries

Hello everyone,

I recently recieved some HC-SR04's and am wanting to make a little device to test them. The idea is that one sensor controls when a piezo buzzer will play, and the other sensor will decide the pitch of that note. I have written some code together but on trying to compile I get this error:

 

 


 

core.a(Tone.cpp.o): In function `__vector_7':

C:\Program Files (x86)\arduino-1.0.1\hardware\arduino\cores\arduino/Tone.cpp:523: multiple definition of `__vector_7'

Arduino "Tone" command and the ATmega8 - it just won't work

Recently Frits pointed out that sound was used much with robots on this site. I agree and am trying to add sound to a miniature bi-ped robot I am designing. I am now using an ATmega8A processor set up as an Arduino and recently tried using the tone command with strange results. I only get a few frequencies. The digital oscilloscope shows that I am only getting 5 frequencies  which I guess change when the timers prescaler is changed. These frequencies are:

61Hz, 244Hz, 976Hz, 3.9KHz and 31.2KHz

Arduino PWM output frequencies and Tone command

I've been playing with a new oscilloscope Dagu bought after the old one died. I decided to check out the Arduino PWM outputs because I'm using an Arduino in my new speed controller and wanted to check if there were any differences as the brake function requires two PWM outputs to be be in sync so that both input are high or low at the same time.

The PWM outputs on pins 5 and 6 share a timer with timing functions such as millis() and delay() run at about 976Hz while PWM outputs on pins 3,9,10 and 11 run at about 488Hz.