Skip to main content
added 1 character in body; edited title
Source Link
dda
  • 1.6k
  • 1
  • 12
  • 18

What's wrong with mythis code?

//ErroError message Arduino: 1.8.5 (Windows 10), Placa:"Arduino/Genuino 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
Erro ao compilar para a placa Arduino/Genuino Uno.

Este relatório teria mais informação com a
opção «Mostrar mensagens detalhadas durante a
compilação» seleccionada nas Preferências.
//

What's wrong with my code

//Erro message Arduino: 1.8.5 (Windows 10), Placa:"Arduino/Genuino 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
Erro ao compilar para a placa Arduino/Genuino Uno.

Este relatório teria mais informação com a
opção «Mostrar mensagens detalhadas durante a
compilação» seleccionada nas Preferências.
//

What's wrong with this code?

//Error message Arduino: 1.8.5 (Windows 10), Placa:"Arduino/Genuino 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
Erro ao compilar para a placa Arduino/Genuino Uno.

Este relatório teria mais informação com a
opção «Mostrar mensagens detalhadas durante a
compilação» seleccionada nas Preferências.
//
Format
Source Link

//Erro message Arduino: 1.8.5 (Windows 10), Placa:"Arduino/Genuino 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 Erro ao compilar para a placa Arduino/Genuino Uno.

Este relatório teria mais informação com a opção «Mostrar mensagens detalhadas durante a compilação» seleccionada nas Preferências. //

#include <IRremote.h> //must copy IRremote library to arduino libraries #include <Servo.h> #define plus 0xFD10EF //clockwise rotation button #define minus 0xFD50AF //counter clockwise rotation button

int RECV_PIN = 2; //IR receiver pin Servo servo; int val; //rotation angle bool cwRotation, ccwRotation; //the states of rotation

IRrecv irrecv(RECV_PIN);

decode_results results;

const int pinoledlar=10; int portaled4 = 12; int portaled3 = 8; int portaled2 = 11; #define pinopir 3 int acionamento; const int sirene=7; int portaLDR = A5; //Porta analógica utilizada pelo LDR

void setup() { Serial.begin(9600); irrecv.enableIRIn(); // Start the receiver servo.attach(9); //servo pin pinMode(pinoledlar,OUTPUT); pinMode(portaled2, OUTPUT); pinMode(portaled3, OUTPUT); pinMode(portaled4, OUTPUT); pinMode(pinopir,INPUT); pinMode(sirene,OUTPUT); }

//Erro message Arduino: 1.8.5 (Windows 10), Placa:"Arduino/Genuino 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
Erro ao compilar para a placa Arduino/Genuino Uno.

Este relatório teria mais informação com a
opção «Mostrar mensagens detalhadas durante a
compilação» seleccionada nas Preferências.
//

void loop() { acionamento=digitalRead(pinopir); if (irrecv.decode(&results)) { Serial.println(results.value, HEX); irrecv.resume(); // Receive the next valueCode

#include <IRremote.h>      //must copy IRremote library to arduino libraries
#include <Servo.h>
#define plus 0xFD10EF   //clockwise rotation button
#define minus 0xFD50AF  //counter clockwise rotation button

int RECV_PIN = 2;       //IR receiver pin
Servo servo;
int val;                //rotation angle
bool cwRotation, ccwRotation;  //the states of rotation

IRrecv irrecv(RECV_PIN);

decode_results results;

const int pinoledlar=10;
int portaled4 = 12; 
int portaled3 = 8; 
int portaled2 = 11;
#define pinopir 3
int acionamento;
const int sirene=7;
int portaLDR = A5; //Porta analógica utilizada pelo LDR

void setup()
{
  Serial.begin(9600);
  irrecv.enableIRIn(); // Start the receiver
  servo.attach(9);     //servo pin
  pinMode(pinoledlar,OUTPUT);
  pinMode(portaled2, OUTPUT);
  pinMode(portaled3, OUTPUT);
  pinMode(portaled4, OUTPUT);
  pinMode(pinopir,INPUT);
  pinMode(sirene,OUTPUT);
}

void loop() 
{
    acionamento=digitalRead(pinopir);
    if (irrecv.decode(&results)) 
    {
    Serial.println(results.value, HEX);
    irrecv.resume(); // Receive the next value

    if (results.value == plus)
    {
      cwRotation = !cwRotation;      //toggle the rotation value
      ccwRotation = false;         //no rotation in this direction
    }

    if (results.value == minus)
    {
      ccwRotation = !ccwRotation;   //toggle the rotation value
      cwRotation = false;            //no rotation in this direction
    }
    }
    if (cwRotation && (val != 175))  
    {
    val++;                         //for colockwise button
    }
    if (ccwRotation && (val != 0))  
    {
    val--;                         //for counter colockwise button
    }
    servo.write(val);
    delay(20);          //General speed
    
    if (acionamento==HIGH)//se detetar movimento
    {
    digitalWrite(pinoledlar,LOW);
    tone(sirene,440,1000);
    delay(1500);
    }
    else// senão detetar movimento
    {
    digitalWrite(pinoledlar,HIGH);
    noTone(sirene);
    delay(1500);
    
    int estado = analogRead(portaLDR);  //Lê o valor fornecido pelo LDR  
    
    // Caso o valor lido na porta analógica seja maior do que 
    // 800, acende o LED  
    // Ajuste o valor abaixo de acordo com o seu circuito  
    if (estado > 900)    
    {  
    digitalWrite(portaled2, HIGH);
    digitalWrite(portaled3, HIGH);
    digitalWrite(portaled4, HIGH);
    }  
    else  //Caso contrário, apaga o led  
    {  
    digitalWrite(portaled2, LOW);
    digitalWrite(portaled3, LOW);
    digitalWrite(portaled4, LOW);
    }  
}  
}

}
}

//Erro message Arduino: 1.8.5 (Windows 10), Placa:"Arduino/Genuino 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 Erro ao compilar para a placa Arduino/Genuino Uno.

Este relatório teria mais informação com a opção «Mostrar mensagens detalhadas durante a compilação» seleccionada nas Preferências. //

#include <IRremote.h> //must copy IRremote library to arduino libraries #include <Servo.h> #define plus 0xFD10EF //clockwise rotation button #define minus 0xFD50AF //counter clockwise rotation button

int RECV_PIN = 2; //IR receiver pin Servo servo; int val; //rotation angle bool cwRotation, ccwRotation; //the states of rotation

IRrecv irrecv(RECV_PIN);

decode_results results;

const int pinoledlar=10; int portaled4 = 12; int portaled3 = 8; int portaled2 = 11; #define pinopir 3 int acionamento; const int sirene=7; int portaLDR = A5; //Porta analógica utilizada pelo LDR

void setup() { Serial.begin(9600); irrecv.enableIRIn(); // Start the receiver servo.attach(9); //servo pin pinMode(pinoledlar,OUTPUT); pinMode(portaled2, OUTPUT); pinMode(portaled3, OUTPUT); pinMode(portaled4, OUTPUT); pinMode(pinopir,INPUT); pinMode(sirene,OUTPUT); }

void loop() { acionamento=digitalRead(pinopir); if (irrecv.decode(&results)) { Serial.println(results.value, HEX); irrecv.resume(); // Receive the next value

if (results.value == plus)
{
  cwRotation = !cwRotation;      //toggle the rotation value
  ccwRotation = false;         //no rotation in this direction
}

if (results.value == minus)
{
  ccwRotation = !ccwRotation;   //toggle the rotation value
  cwRotation = false;            //no rotation in this direction
}
}
if (cwRotation && (val != 175))  
{
val++;                         //for colockwise button
}
if (ccwRotation && (val != 0))  
{
val--;                         //for counter colockwise button
}
servo.write(val);
delay(20);          //General speed

if (acionamento==HIGH)//se detetar movimento
{
digitalWrite(pinoledlar,LOW);
tone(sirene,440,1000);
delay(1500);
}
else// senão detetar movimento
{
digitalWrite(pinoledlar,HIGH);
noTone(sirene);
delay(1500);

int estado = analogRead(portaLDR);  //Lê o valor fornecido pelo LDR  

// Caso o valor lido na porta analógica seja maior do que 
// 800, acende o LED  
// Ajuste o valor abaixo de acordo com o seu circuito  
if (estado > 900)    
{  
digitalWrite(portaled2, HIGH);
digitalWrite(portaled3, HIGH);
digitalWrite(portaled4, HIGH);
}  
else  //Caso contrário, apaga o led  
{  
digitalWrite(portaled2, LOW);
digitalWrite(portaled3, LOW);
digitalWrite(portaled4, LOW);
}  

}
}

//Erro message Arduino: 1.8.5 (Windows 10), Placa:"Arduino/Genuino 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
Erro ao compilar para a placa Arduino/Genuino Uno.

Este relatório teria mais informação com a
opção «Mostrar mensagens detalhadas durante a
compilação» seleccionada nas Preferências.
//

Code

#include <IRremote.h>      //must copy IRremote library to arduino libraries
#include <Servo.h>
#define plus 0xFD10EF   //clockwise rotation button
#define minus 0xFD50AF  //counter clockwise rotation button

int RECV_PIN = 2;       //IR receiver pin
Servo servo;
int val;                //rotation angle
bool cwRotation, ccwRotation;  //the states of rotation

IRrecv irrecv(RECV_PIN);

decode_results results;

const int pinoledlar=10;
int portaled4 = 12; 
int portaled3 = 8; 
int portaled2 = 11;
#define pinopir 3
int acionamento;
const int sirene=7;
int portaLDR = A5; //Porta analógica utilizada pelo LDR

void setup()
{
  Serial.begin(9600);
  irrecv.enableIRIn(); // Start the receiver
  servo.attach(9);     //servo pin
  pinMode(pinoledlar,OUTPUT);
  pinMode(portaled2, OUTPUT);
  pinMode(portaled3, OUTPUT);
  pinMode(portaled4, OUTPUT);
  pinMode(pinopir,INPUT);
  pinMode(sirene,OUTPUT);
}

void loop() 
{
    acionamento=digitalRead(pinopir);
    if (irrecv.decode(&results)) 
    {
    Serial.println(results.value, HEX);
    irrecv.resume(); // Receive the next value

    if (results.value == plus)
    {
      cwRotation = !cwRotation;      //toggle the rotation value
      ccwRotation = false;         //no rotation in this direction
    }

    if (results.value == minus)
    {
      ccwRotation = !ccwRotation;   //toggle the rotation value
      cwRotation = false;            //no rotation in this direction
    }
    }
    if (cwRotation && (val != 175))  
    {
    val++;                         //for colockwise button
    }
    if (ccwRotation && (val != 0))  
    {
    val--;                         //for counter colockwise button
    }
    servo.write(val);
    delay(20);          //General speed
    
    if (acionamento==HIGH)//se detetar movimento
    {
    digitalWrite(pinoledlar,LOW);
    tone(sirene,440,1000);
    delay(1500);
    }
    else// senão detetar movimento
    {
    digitalWrite(pinoledlar,HIGH);
    noTone(sirene);
    delay(1500);
    
    int estado = analogRead(portaLDR);  //Lê o valor fornecido pelo LDR  
    
    // Caso o valor lido na porta analógica seja maior do que 
    // 800, acende o LED  
    // Ajuste o valor abaixo de acordo com o seu circuito  
    if (estado > 900)    
    {  
    digitalWrite(portaled2, HIGH);
    digitalWrite(portaled3, HIGH);
    digitalWrite(portaled4, HIGH);
    }  
    else  //Caso contrário, apaga o led  
    {  
    digitalWrite(portaled2, LOW);
    digitalWrite(portaled3, LOW);
    digitalWrite(portaled4, LOW);
    }  
}  
}
Source Link

What's wrong with my code

//Erro message Arduino: 1.8.5 (Windows 10), Placa:"Arduino/Genuino 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 Erro ao compilar para a placa Arduino/Genuino Uno.

Este relatório teria mais informação com a opção «Mostrar mensagens detalhadas durante a compilação» seleccionada nas Preferências. //

#include <IRremote.h> //must copy IRremote library to arduino libraries #include <Servo.h> #define plus 0xFD10EF //clockwise rotation button #define minus 0xFD50AF //counter clockwise rotation button

int RECV_PIN = 2; //IR receiver pin Servo servo; int val; //rotation angle bool cwRotation, ccwRotation; //the states of rotation

IRrecv irrecv(RECV_PIN);

decode_results results;

const int pinoledlar=10; int portaled4 = 12; int portaled3 = 8; int portaled2 = 11; #define pinopir 3 int acionamento; const int sirene=7; int portaLDR = A5; //Porta analógica utilizada pelo LDR

void setup() { Serial.begin(9600); irrecv.enableIRIn(); // Start the receiver servo.attach(9); //servo pin pinMode(pinoledlar,OUTPUT); pinMode(portaled2, OUTPUT); pinMode(portaled3, OUTPUT); pinMode(portaled4, OUTPUT); pinMode(pinopir,INPUT); pinMode(sirene,OUTPUT); }

void loop() { acionamento=digitalRead(pinopir); if (irrecv.decode(&results)) { Serial.println(results.value, HEX); irrecv.resume(); // Receive the next value

if (results.value == plus)
{
  cwRotation = !cwRotation;      //toggle the rotation value
  ccwRotation = false;         //no rotation in this direction
}

if (results.value == minus)
{
  ccwRotation = !ccwRotation;   //toggle the rotation value
  cwRotation = false;            //no rotation in this direction
}
}
if (cwRotation && (val != 175))  
{
val++;                         //for colockwise button
}
if (ccwRotation && (val != 0))  
{
val--;                         //for counter colockwise button
}
servo.write(val);
delay(20);          //General speed

if (acionamento==HIGH)//se detetar movimento
{
digitalWrite(pinoledlar,LOW);
tone(sirene,440,1000);
delay(1500);
}
else// senão detetar movimento
{
digitalWrite(pinoledlar,HIGH);
noTone(sirene);
delay(1500);

int estado = analogRead(portaLDR);  //Lê o valor fornecido pelo LDR  

// Caso o valor lido na porta analógica seja maior do que 
// 800, acende o LED  
// Ajuste o valor abaixo de acordo com o seu circuito  
if (estado > 900)    
{  
digitalWrite(portaled2, HIGH);
digitalWrite(portaled3, HIGH);
digitalWrite(portaled4, HIGH);
}  
else  //Caso contrário, apaga o led  
{  
digitalWrite(portaled2, LOW);
digitalWrite(portaled3, LOW);
digitalWrite(portaled4, LOW);
}  

}
}