Tone() Function Interference

Hi all

I am working on an RC car project right now, and decided to put a buzzer on it, to be the horn. I also have my motor shield on my Arduino, which utilizes pins 3 and 11 for the activation/speed of the motors. I read that the tone function would mess with the PWM on those pins. I figured that it wouldn't matter, because when I send commands over serial to the car, they only function one at a time—not simultaneously. But after I use the horn, my motors will not turn back on. The only way to get them to function again is to reset the Arduino. Are there any alternatives to the tone function?


Depends on the buzzer type you select. Some buzzers/horns/alarm devices only require a digital on or off signal (possibly using a transistor if needing more then 5vdc or more then 20-30ma) and generate a fixed sound. Others require that you drive them with a square wave of some specific frequency range and thus need something like the tone library to operate.


Thanks. Good suggestion. I just used analogWrite. It works fine. thanks!