Im programming an archery timer, there is going to be a speaker which sounds off when the timer starts and finishes, for the seven segment timer display Ive used the SevenSeg library for the display control
http://playground.arduino.cc/Main/SevenSeg
When I try to add the tone command the sketch dosn't compile and gives a multiple definition error
C:\Users\THEREH~1\AppData\Local\Temp\build6232875995399216466.tmp/core.a(Tone.cpp.o): In function `__vector_13':
C:\Program Files (x86)\Arduino\hardware\arduino\avr\cores\arduino/Tone.cpp:538: multiple definition of `__vector_13'
C:\Users\THEREH~1\AppData\Local\Temp\build6232875995399216466.tmp\Seg_Test.cpp.o:C:\Program Files (x86)\Arduino/Seg_Test.ino:47: first defined here
c:/program files (x86)/arduino/hardware/tools/avr/bin/../lib/gcc/avr/4.8.1/../../../../avr/bin/ld.exe: Disabling relaxation: it will not work with multiple definitions
collect2.exe: error: ld returned 1 exit status
Error compiling.
And this is the code with the tone command which gives the error
#include <SevenSeg.h>
int AC = 12;
int BD = 13;
int ACState = 0;
int BDState = 0;
int btnPin = 26;
int btnState = 0;
SevenSeg disp(30,31,32,33,34,35,36);
const int numOfDigits=3;
int digitPins[numOfDigits]={2,3,4};
void setup () {
pinMode(AC, OUTPUT);
pinMode(BD, OUTPUT);
pinMode(btnPin, OUTPUT);
disp.setDigitPins(numOfDigits,digitPins);
disp.setCommonCathode();
disp.setTimer(2);
disp.startTimer();
digitalWrite(AC, HIGH);
digitalWrite(BD, LOW);
disp.write(000);
}
void loop() {
btnState = digitalRead(btnPin);
ACState = digitalRead(AC);
BDState = digitalRead(BD);
noTone(24);
if (btnState == HIGH){
tone(24,700,1000);
for (int i = 180; i >= 0; i--){
disp.writeClock(i);
delay(100);
}
if (ACState == HIGH){
digitalWrite(AC, LOW);
digitalWrite(BD, HIGH);
}
else{
digitalWrite(AC, HIGH);
digitalWrite(BD, LOW);
}
}
}
ISR(TIMER2_COMPA_vect){
disp.interruptAction();
}
When the tone command is deleted the code works
I have no idea whats causing this error so any help would be very much appreciated