From ef4ba97522d74b26511c19229b7493ab5fa7d7f9 Mon Sep 17 00:00:00 2001 From: AnalysIR Date: Thu, 20 Aug 2015 15:46:23 +0100 Subject: [PATCH 1/2] change int to unsigned int in IRrecvDumpV2 some larger values could overflow to negative numbers, with unsigned int (vs int) --- examples/IRrecvDumpV2/IRrecvDumpV2.ino | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/examples/IRrecvDumpV2/IRrecvDumpV2.ino b/examples/IRrecvDumpV2/IRrecvDumpV2.ino index 6dfa810..bbfb674 100644 --- a/examples/IRrecvDumpV2/IRrecvDumpV2.ino +++ b/examples/IRrecvDumpV2/IRrecvDumpV2.ino @@ -95,7 +95,7 @@ void dumpRaw (decode_results *results) Serial.print(" -"); Serial.println(results->rawbuf[0] * USECPERTICK, DEC); for (int i = 1; i < results->rawlen; i++) { - int x = results->rawbuf[i] * USECPERTICK; + unsigned int x = results->rawbuf[i] * USECPERTICK; if (!(i & 1)) { // even Serial.print("-"); if (x < 1000) Serial.print(" ") ; From 3d3c2b9b282c8c35b61be656430903c4e9533de4 Mon Sep 17 00:00:00 2001 From: AnalysIR Date: Thu, 20 Aug 2015 15:53:50 +0100 Subject: [PATCH 2/2] Update IRrecvDumpV2.ino looks like this multiplier was omitted and needs to be include to make the output meaningful/useful??? Would also explain some weird output I have seen posted. --- examples/IRrecvDumpV2/IRrecvDumpV2.ino | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/examples/IRrecvDumpV2/IRrecvDumpV2.ino b/examples/IRrecvDumpV2/IRrecvDumpV2.ino index bbfb674..f29e74a 100644 --- a/examples/IRrecvDumpV2/IRrecvDumpV2.ino +++ b/examples/IRrecvDumpV2/IRrecvDumpV2.ino @@ -127,7 +127,7 @@ void dumpCode (decode_results *results) // Dump data for (int i = 0; i < results->rawlen; i++) { - Serial.print(results->rawbuf[i], DEC); + Serial.print(results->rawbuf[i] * USECPERTICK, DEC); Serial.print(","); if (!(i&1)) Serial.print(" "); }