Help me pls IRremote not function with buzzer in arduino


#1

help me pls
here is my code :

#include <IRremote.h>
#include <SoftwareSerial.h>
#define led 13

int interval=200;
unsigned long previousMillis=0;

const char DIN_RECEPTEUR_INFRAROUGE = 2 ;

IRrecv monRecepteurInfraRouge (DIN_RECEPTEUR_INFRAROUGE);

decode_results messageRecu;

void setup()
{
 Serial.begin(9600);
 monRecepteurInfraRouge.enableIRIn();
 pinMode (led, OUTPUT);
}

void loop()
{

  
  unsigned long currentMillis = millis();


  if (monRecepteurInfraRouge.decode(&messageRecu))
  {
    
    
    digitalWrite(13, 0);
  
    Serial.println(messageRecu.value,HEX);
    
    monRecepteurInfraRouge.resume();
    
    delay (50);
    previousMillis = currentMillis;
  }
  if ((unsigned long)(currentMillis - previousMillis) >= interval) {
    digitalWrite(13, 1);
    tone(8,1031);
    delay(500);
  }

  
 
}

i have this error :
Arduino : 1.8.13 (Windows 10), Carte : “Arduino Uno”

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

Error compilation Arduino Uno

i think there is incompatibility between tone and irremote i am novice idon’t know how to solve it