Bonjour,
Je suis assez étonné de voir que les deux libraires NewPing et IRremote ne peuvent pas fonctionner ensembles ...
Auriez vous une solution à ce problème ?
Willy
#include <NewPing.h>
#include <IRremote.h>
#define TRIGGER_PIN 5 // Arduino pin tied to trigger pin on ping sensor.
#define ECHO_PIN 6 // Arduino pin tied to echo pin on ping sensor.
#define MAX_DISTANCE 100
NewPing sonar(TRIGGER_PIN, ECHO_PIN, MAX_DISTANCE); // NewPing setup of pins and maximum distance.
void setup() {
Serial.begin(115200); // Open serial monitor at 115200 baud to see ping results.
}
void loop() {
delay(50); // Wait 50ms between pings (about 20 pings/sec). 29ms should be the shortest delay between pings.
Serial.print("Ping: ");
Serial.print(sonar.ping_cm()); // Send ping, get distance in cm and print result (0 = outside set distance range)
Serial.println("cm");
}
libraries\Arduino-IRremote-master\IRremote.cpp.o (symbol from plugin): In function `MATCH(int, int)':
(.text+0x0): multiple definition of `__vector_7'
libraries\NewPing\NewPing.cpp.o (symbol from plugin):(.text+0x0): first defined here
collect2.exe: error: ld returned 1 exit status
exit status 1
Erreur de compilation pour la carte Arduino/Genuino Uno