Go Down

Topic: Weird Tone Error (Read 299 times) previous topic - next topic

Griphonium

I have an LED go green be pressing the 1 button on my remote and another go red when I press 2 and both turn off when I press 3. That all works, except I tried to add a buzzer so when the green goes off it buzzes. Once I tried that, I got this compiling error:


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 compiling for board Arduino/Genuino Uno.



Here's the code:
Code: [Select]
#include <IRremote.h>

const int RECV_PIN = 7;
IRrecv irrecv(RECV_PIN);
decode_results results;

void setup() {
  Serial.begin(9600);
  irrecv.enableIRIn();
  irrecv.blink13(true);
  pinMode(11, OUTPUT);
  pinMode(10, OUTPUT);
  pinMode(9, OUTPUT);
}

void loop() {
  if (irrecv.decode(&results)) {
    Serial.println(results.value, HEX);
    irrecv.resume();
    if (results.value == 0xFFA25D) {
      digitalWrite(11, HIGH);
      digitalWrite(10, LOW);
      tone(9, 200);
      delay(1000);
    }
    if (results.value == 0xFF629D) {
      digitalWrite(11, LOW);
      digitalWrite(10, HIGH);
    }
    if (results.value == 0xFFE21D) {
      digitalWrite(11, LOW);
      digitalWrite(10, LOW);
    }
  }
}

pert

It's a conflict between the IRremote library and tone().

Griphonium

Ya, i just downloaded a tone library from some guy on YT. It's all G now!

Go Up