I'm trying to create a program with the IR recoder and a speaker. The objetive is to play a note when I touch a number on the remote control, but i have a problem. I was looking at the code and the problem is in the function tone, but i don´t know why.
Problem: Tone.cpp.o (symbol from plugin): In function `timer0_pin_port':
(.text+0x0): multiple definition of `__vector_7'
libraries\IRremote\IRremote.cpp.o (symbol from plugin):(.text+0x0): first defined here
collect2.exe: error: ld returned 1 exit status
exit status 1
#include "IRremote.h"
int pinLED = 7;
int pinIR = 11;
int speaker = 9;
IRrecv receptor (pinIR);
decode_results resultados;
//NOTES
long DO= 523.25;
long RE=587.33;
long MI=659.26;
long FA=698.46;
long SOL=783.99;
long LA=880;
long SI=987.77;
long DoS=554.37;
void decodificar(){
switch(resultados.value){
case 0xFFA25D: //POWER
if (digitalRead(pinLED)==LOW){
digitalWrite(pinLED, HIGH);
}else{
digitalWrite(pinLED, LOW);
}
break;
if (digitalRead(pinLED)==HIGH){
case 0xFF30CF: //Num 1
tone (speaker, DO, 200);
break;
case 0xFF18E7: //Num 2
tone (speaker, RE, 200);
break;
case 0xFF7A85: //Num 3
tone (speaker, MI, 200);
break;
case 0xFF10EF: //Num 4
tone (speaker, FA, 200);
break;
case 0xFF38C7: //Num 5
tone (speaker, SOL), 200;
break;
case 0xFF5AA5: //Num 6
tone (speaker, LA, 200);
break;
case 0xFF42BD: //Num 7
tone (speaker, SI, 200);
break;
case 0xFF4AB5: //Num 8
tone (speaker, DoS, 200);
break;
}
}
}
void setup() {
pinMode (pinLED, OUTPUT);
pinMode (speaker, OUTPUT);
receptor.enableIRIn();
}
void loop() {
if (receptor.decode(&resultados)){
decodificar();
receptor.resume();
}
}