sdaitzman / arduino-new-ping

Automatically exported from code.google.com/p/arduino-new-ping
0 stars 0 forks source link

Not compatible with tone ( ) function. #10

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
1. #include <NewPing.h>
2. Use tone() function 
3.

What is the expected output? What do you see instead?
When compiling arduino sketch got the error:
core.a(Tone.cpp.o): In function `__vector_7':
C:\Program Files\Arduino\hardware\arduino\cores\arduino/Tone.cpp:535: multiple 
definition of `__vector_7'
NewPing\NewPing.cpp.o:D:\Documents and Settings\My 
Documents\Arduino\libraries\NewPing/NewPing.cpp:214: first defined here
What version of the product are you using? On what operating system?
Arduino 1.0.5
NewPing_v1.5

Please provide any additional information below.
Tone.cpp:535
#ifdef USE_TIMER2
ISR(TIMER2_COMPA_vect)

NewPing.cpp:214
#if defined (__AVR_ATmega32U4__) // Use Timer4 for ATmega32U4 (Teensy/Leonardo).
ISR(TIMER4_OVF_vect) {
#else
ISR(TIMER2_COMPA_vect) {
#endif

Original issue reported on code.google.com by wences...@gmail.com on 3 Feb 2014 at 10:16

GoogleCodeExporter commented 9 years ago
Both use the same timer, which is why it doesn't work.  Try using a different 
tone library, like NewTone.  For support please visit the official forum at: 
http://forum.arduino.cc/index.php/topic,106043.0.html

Original comment by eckel.tim on 25 Apr 2014 at 8:27

GoogleCodeExporter commented 9 years ago
Thank you Tim.

Original comment by wences...@gmail.com on 25 Apr 2014 at 8:52