Hey guys,
I am trying to use some older code with my Arduino UNO, which I got here: GitHub - afaucher/LazerTagHost: A laser tag host for Phoenix LTX and LTTO type guns
It is a modified IRrelay, and it is using a modified library, so I can't just use the standard IRremote library.
I figured out the Wprogram.h thing and corrected that in the library.
However, I am now getting the following error when I try to verify the code, and I am not quite sure what to do to resolve it.
IRremote/IRremote.cpp.o: In function `IRrecv::decode(decode_results*)':
/home/redfoxdude/sketchbook/libraries/IRremote/IRremote.cpp:385:(.text._ZN6IRrecv24decodeLAZER_TAGEP14decode_results+0x70): relocation truncated to fit: R_AVR_7_PCREL against `no symbol'
collect2: error: ld returned 1 exit status
I think these are the relevant pieces from the library code:
long IRrecv::decodeLAZER_TAG(decode_results *results) {
unsigned long data = 0;
int offset = 1;
int i = 0;
results->bits = 0;
//HEAD
if (results->rawlen < 14) {
return ERR;
}
if (!MATCH_MARK(results->rawbuf[offset], LTTO_HDR_MARK_ONE)) {
return ERR;
}
offset++;
if (!MATCH_SPACE(results->rawbuf[offset], LTTO_HDR_SPACE)) {
return ERR;
}
offset++;
if (!MATCH_MARK(results->rawbuf[offset], LTTO_HDR_MARK_TWO)) {
return ERR;
}
offset++;
//DATA
for (i = 0; i < (results->rawlen - 4); i++) {
if (i % 2 == 1) {
if (MATCH_MARK(results->rawbuf[offset], LTTO_ONE_MARK)) {
data <<= 1;
data |= 1;
results->bits++;
} else if (MATCH_MARK(results->rawbuf[offset], LTTO_ZERO_MARK)) {
data <<= 1;
data |= 0;
results->bits++;
} else {
Serial.println(i, DEC);
return ERR;
}
} else {
if (!MATCH_SPACE(results->rawbuf[offset], LTTO_SPACE)) {
Serial.println(i, DEC);
return ERR;
}
}
offset++;
}
// Success
results->value = data;
results->decode_type = LAZER_TAG;
return DECODED;
}
and
// Decodes the received IR message
// Returns 0 if no data ready, 1 if data ready.
// Results of decoding are stored in results
int IRrecv::decode(decode_results *results) {
results->rawbuf = irparams.rawbuf;
results->rawlen = irparams.rawlen;
if (irparams.rcvstate != STATE_STOP) {
return ERR;
}
If anyone could assist me in remedying this issue, that would be awesome!
Thanks,
RFD