IRremote

I am having a problem when I verify this is what I get. (see below) I’m using the Spider Controller I got from sparkfun. I’m running the sample program from sparkfun at the Bottom of the page. It had me download the IRremote library written by Ken Shirriff I place the file where it told me to.I am running Arduino 1.0.2And the latest files from Ken Any help you can give me will be greatly appreciated

IRremote\IRremote.cpp.o: In function `MATCH(int, int)':

/IRremoteInt.h:176: multiple definition of `MATCH(int, int)’

_12_DOF_Hexapod.cpp.o:C:\Users\Jim\Desktop\arduino\arduino-1.0.2\libraries\IRremote/IRremoteInt.h:176: first defined here

IRremote\IRremote.cpp.o: In function `MATCH_MARK(int, int)':

/IRremoteInt.h:177: multiple definition of `MATCH_MARK(int, int)’

_12_DOF_Hexapod.cpp.o:C:\Users\Jim\Desktop\arduino\arduino-1.0.2\libraries\IRremote/IRremoteInt.h:177: first defined here

IRremote\IRremote.cpp.o: In function `MATCH_SPACE(int, int)':

/IRremoteInt.h:178: multiple definition of `MATCH_SPACE(int, int)’

_12_DOF_Hexapod.cpp.o:C:\Users\Jim\Desktop\arduino\arduino-1.0.2\libraries\IRremote/IRremoteInt.h:178: first defined here

Thanks

Jim

It looks like one of the libraries got updated and is now attempting to overwrite the other. The best place to start would be to check each file where indicated in the errors and see what’s being defined for MATCH(int, int) in each.

Copy the same code from the file IRremoteInt.h to IRremote.cpp next to ifdefine statement

i.e.

#ifndef DEBUG

int MATCH(int measured, int desired)

{

return measured >= TICKS_LOW(desired) && measured <= TICKS_HIGH(desired);

}

int MATCH_MARK(int measured_ticks, int desired_us)

{

return MATCH(measured_ticks, (desired_us + MARK_EXCESS));

}

int MATCH_SPACE(int measured_ticks, int desired_us)

{

return MATCH(measured_ticks, (desired_us - MARK_EXCESS));

}

// Debugging versions are in IRremote.cpp

#endif

cut and paste like this,

#ifdef DEBUG

int MATCH(int measured, int desired) {

Serial.print("Testing: ");

Serial.print(TICKS_LOW(desired), DEC);

Serial.print(" <= ");

Serial.print(measured, DEC);

Serial.print(" <= ");

Serial.println(TICKS_HIGH(desired), DEC);

return measured >= TICKS_LOW(desired) && measured <= TICKS_HIGH(desired);

}

int MATCH_MARK(int measured_ticks, int desired_us) {

Serial.print("Testing mark ");

Serial.print(measured_ticks * USECPERTICK, DEC);

Serial.print(" vs ");

Serial.print(desired_us, DEC);

Serial.print(": ");

Serial.print(TICKS_LOW(desired_us + MARK_EXCESS), DEC);

Serial.print(" <= ");

Serial.print(measured_ticks, DEC);

Serial.print(" <= ");

Serial.println(TICKS_HIGH(desired_us + MARK_EXCESS), DEC);

return measured_ticks >= TICKS_LOW(desired_us + MARK_EXCESS) && measured_ticks <= TICKS_HIGH(desired_us + MARK_EXCESS);

}

int MATCH_SPACE(int measured_ticks, int desired_us) {

Serial.print("Testing space ");

Serial.print(measured_ticks * USECPERTICK, DEC);

Serial.print(" vs ");

Serial.print(desired_us, DEC);

Serial.print(": ");

Serial.print(TICKS_LOW(desired_us - MARK_EXCESS), DEC);

Serial.print(" <= ");

Serial.print(measured_ticks, DEC);

Serial.print(" <= ");

Serial.println(TICKS_HIGH(desired_us - MARK_EXCESS), DEC);

return measured_ticks >= TICKS_LOW(desired_us - MARK_EXCESS) && measured_ticks <= TICKS_HIGH(desired_us - MARK_EXCESS);

}

#endif

#ifndef DEBUG

int MATCH(int measured, int desired)

{

return measured >= TICKS_LOW(desired) && measured <= TICKS_HIGH(desired);

}

int MATCH_MARK(int measured_ticks, int desired_us)

{

return MATCH(measured_ticks, (desired_us + MARK_EXCESS));

}

int MATCH_SPACE(int measured_ticks, int desired_us)

{

return MATCH(measured_ticks, (desired_us - MARK_EXCESS));

}

// Debugging versions are in IRremote.cpp

#endif

in your code, remove the include #include <IRremoteInt.h>, and compile again.