From 47569a245e10d7675b40fec9e92d2490c421c87b Mon Sep 17 00:00:00 2001 From: AnalysIR Date: Sat, 28 Nov 2015 21:11:08 +0000 Subject: [PATCH 1/2] Create IRremoteInfo.ino A helper tool to assist in supporting troubleshooting with IRremote. Prints all of the current settings applied within the users IRremote set-up. A description og the utility is available here: http://www.analysir.com/blog/2015/11/28/helper-utility-for-troubleshooting-irremote/ --- examples/IRremoteInfo/IRremoteInfo.ino | 210 +++++++++++++++++++++++++ 1 file changed, 210 insertions(+) create mode 100644 examples/IRremoteInfo/IRremoteInfo.ino diff --git a/examples/IRremoteInfo/IRremoteInfo.ino b/examples/IRremoteInfo/IRremoteInfo.ino new file mode 100644 index 0000000..bc13c5d --- /dev/null +++ b/examples/IRremoteInfo/IRremoteInfo.ino @@ -0,0 +1,210 @@ +/* + * IRremote: IRremoteInfo - prints relevant config info & settings for IRremote over serial + * Intended to help identify & troubleshoot the various settings of IRremote + * For example, sometimes users are unsure of which pin is used for Tx or the RAWBUF values + * This example can be used to assist the user directly or with support. + * Intended to help identify & troubleshoot the various settings of IRremote + * Hopefully this utility will be a useful tool for support & troubleshooting for IRremote + * Check out the blog post describing the sketch via http://www.analysir.com/blog/2015/11/28/helper-utility-for-troubleshooting-irremote/ + * Version 1.0 November 2015 + * Original Author: AnalysIR - IR software & modules for Makers & Pros, visit http://www.AnalysIR.com + */ + + +#include + +void setup() +{ + Serial.begin(115200); //You may alter the BAUD rate here as needed + while (!Serial); //wait until Serial is established - required on some Platforms + + //Runs only once per restart of the Arduino. + dumpHeader(); + dumpRAWBUF(); + dumpTIMER(); + dumpTimerPin(); + dumpClock(); + dumpPlatform(); + dumpPulseParams(); + dumpSignalParams(); + dumpArduinoIDE(); + dumpDebugMode(); + dumpProtocols(); + dumpFooter(); +} + +void loop() { + //nothing to do! +} + +void dumpRAWBUF() { + Serial.print(F("RAWBUF: ")); + Serial.println(RAWBUF); +} + +void dumpTIMER() { + boolean flag = false; +#ifdef IR_USE_TIMER1 + Serial.print(F("Timer defined for use: ")); Serial.println(F("Timer1")); flag = true; +#endif +#ifdef IR_USE_TIMER2 + Serial.print(F("Timer defined for use: ")); Serial.println(F("Timer2")); flag = true; +#endif +#ifdef IR_USE_TIMER3 + Serial.print(F("Timer defined for use: ")); Serial.println(F("Timer3")); flag = true; +#endif +#ifdef IR_USE_TIMER4 + Serial.print(F("Timer defined for use: ")); Serial.println(F("Timer4")); flag = true; +#endif +#ifdef IR_USE_TIMER5 + Serial.print(F("Timer defined for use: ")); Serial.println(F("Timer5")); flag = true; +#endif +#ifdef IR_USE_TIMER4_HS + Serial.print(F("Timer defined for use: ")); Serial.println(F("Timer4_HS")); flag = true; +#endif +#ifdef IR_USE_TIMER_CMT + Serial.print(F("Timer defined for use: ")); Serial.println(F("Timer_CMT")); flag = true; +#endif +#ifdef IR_USE_TIMER_TPM1 + Serial.print(F("Timer defined for use: ")); Serial.println(F("Timer_TPM1")); flag = true; +#endif +#ifdef IR_USE_TIMER_TINY0 + Serial.print(F("Timer defined for use: ")); Serial.println(F("Timer_TINY0")); flag = true; +#endif + + if (!flag) { + Serial.print(F("Timer Error: ")); Serial.println(F("not defined")); + } +} + +void dumpTimerPin() { + Serial.print(F("IR Tx Pin: ")); + Serial.println(TIMER_PWM_PIN); +} + +void dumpClock() { + Serial.print(F("MCU Clock: ")); + Serial.println(F_CPU); +} + +void dumpPlatform() { + Serial.print(F("MCU Platform: ")); + +#if defined(__AVR_ATmega1280__) + Serial.println(F("Arduino Mega1280")); +#elif defined(__AVR_ATmega2560__) + Serial.println(F("Arduino Mega2560")); +#elif defined(__AVR_AT90USB162__) + Serial.println(F("Teensy 1.0 / AT90USB162")); + // Teensy 2.0 +#elif defined(__AVR_ATmega32U4__) + Serial.println(F("Arduino Leonardo / Yun / Teensy 1.0 / ATmega32U4")); +#elif defined(__MK20DX128__) || defined(__MK20DX256__) + Serial.println(F("Teensy 3.0 / Teensy 3.1 / MK20DX128 / MK20DX256")); +#elif defined(__MKL26Z64__) + Serial.println(F("Teensy-LC / MKL26Z64")); +#elif defined(__AVR_AT90USB646__) + Serial.println(F("Teensy++ 1.0 / AT90USB646")); +#elif defined(__AVR_AT90USB1286__) + Serial.println(F("Teensy++ 2.0 / AT90USB1286")); +#elif defined(__AVR_ATmega644P__) || defined(__AVR_ATmega644__) + Serial.println(F("Sanguino / ATmega644(P)")); +#elif defined(__AVR_ATmega8P__) || defined(__AVR_ATmega8__) + Serial.println(F("Atmega8 / ATmega8(P)")); +#elif defined(__AVR_ATtiny84__) + Serial.println(F("ATtiny84")); +#elif defined(__AVR_ATtiny85__) + Serial.println(F("ATtiny85")); +#else + Serial.println(F("ATmega328(P) / (Duemilanove, Diecimila, LilyPad, Mini, Micro, Fio, Nano, etc)")); +#endif +} + +void dumpPulseParams() { + Serial.print(F("Mark Excess: ")); Serial.print(MARK_EXCESS);; Serial.println(F(" uSecs")); + Serial.print(F("Microseconds per tick: ")); Serial.print(USECPERTICK);; Serial.println(F(" uSecs")); + Serial.print(F("Measurement tolerance: ")); Serial.print(TOLERANCE); Serial.println(F("%")); +} + +void dumpSignalParams() { + Serial.print(F("Minimum Gap between IR Signals: ")); Serial.print(_GAP); Serial.println(F(" uSecs")); +} + +void dumpDebugMode() { + Serial.print(F("Debug Mode: ")); +#if DEBUG + Serial.println(F("ON")); +#else + Serial.println(F("OFF (Normal)")); +#endif + +} + +void dumpArduinoIDE() { + Serial.print(F("Arduino IDE version: ")); + Serial.print(ARDUINO / 10000); + Serial.write('.'); + Serial.print((ARDUINO % 10000) / 100); + Serial.write('.'); + Serial.println(ARDUINO % 100); +} + +void dumpProtocols() { + + Serial.println(); Serial.print(F("IR PROTOCOLS ")); Serial.print(F("SEND ")); Serial.println(F("DECODE")); + Serial.print(F("============= ")); Serial.print(F("======== ")); Serial.println(F("========")); + Serial.print(F("RC5: ")); printSendEnabled(SEND_RC5); printDecodeEnabled(DECODE_RC6); + Serial.print(F("RC6: ")); printSendEnabled(SEND_RC6); printDecodeEnabled(DECODE_RC5); + Serial.print(F("NEC: ")); printSendEnabled(SEND_NEC); printDecodeEnabled(DECODE_NEC); + Serial.print(F("SONY: ")); printSendEnabled(SEND_SONY); printDecodeEnabled(DECODE_SONY); + Serial.print(F("PANASONIC: ")); printSendEnabled(SEND_PANASONIC); printDecodeEnabled(DECODE_PANASONIC); + Serial.print(F("JVC: ")); printSendEnabled(SEND_JVC); printDecodeEnabled(DECODE_JVC); + Serial.print(F("SAMSUNG: ")); printSendEnabled(SEND_SAMSUNG); printDecodeEnabled(DECODE_SAMSUNG); + Serial.print(F("WHYNTER: ")); printSendEnabled(SEND_WHYNTER); printDecodeEnabled(DECODE_WHYNTER); + Serial.print(F("AIWA_RC_T501: ")); printSendEnabled(SEND_AIWA_RC_T501); printDecodeEnabled(DECODE_AIWA_RC_T501); + Serial.print(F("LG: ")); printSendEnabled(SEND_LG); printDecodeEnabled(DECODE_LG); + Serial.print(F("SANYO: ")); printSendEnabled(SEND_SANYO); printDecodeEnabled(DECODE_SANYO); + Serial.print(F("MITSUBISHI: ")); printSendEnabled(SEND_MITSUBISHI); printDecodeEnabled(DECODE_MITSUBISHI); + Serial.print(F("DISH: ")); printSendEnabled(SEND_DISH); printDecodeEnabled(DECODE_DISH); + Serial.print(F("SHARP: ")); printSendEnabled(SEND_SHARP); printDecodeEnabled(DECODE_SHARP); + Serial.print(F("DENON: ")); printSendEnabled(SEND_DENON); printDecodeEnabled(DECODE_DENON); + Serial.print(F("PRONTO: ")); printSendEnabled(SEND_PRONTO); Serial.println(F("(Not Applicable)")); +} + +void printSendEnabled(int flag) { + if (flag) { + Serial.print(F("Enabled ")); + } + else { + Serial.print(F("Disabled ")); + } +} + +void printDecodeEnabled(int flag) { + if (flag) { + Serial.println(F("Enabled")); + } + else { + Serial.println(F("Disabled")); + } +} + +void dumpHeader() { + Serial.println(F("IRremoteInfo - by AnalysIR (http://www.AnalysIR.com/)")); + Serial.println(F(" - A helper sketch to assist in troubleshooting issues with the library by reviewing the settings within the IRremote library")); + Serial.println(F(" - Prints out the important settings within the library, which can be configured to suit the many supported platforms")); + Serial.println(F(" - When seeking on-line support, please post or upload the output of this sketch, where appropriate")); + Serial.println(); + Serial.println(F("IRremote Library Settings")); + Serial.println(F("=========================")); +} + +void dumpFooter() { + Serial.println(); + Serial.println(F("Notes: ")); + Serial.println(F(" - Most of the seetings above can be configured in the following files included as part of the library")); + Serial.println(F(" - IRremteInt.h")); + Serial.println(F(" - IRremote.h")); + Serial.println(F(" - You can save SRAM by disabling the Decode or Send features for any protocol (Near the top of IRremoteInt.h)")); + Serial.println(F(" - Some Timer conflicts, with other libraries, can be easily resolved by configuring a differnt Timer for your platform")); +} From 1a3fd3e310cf5b61895d1337a0343acd182ebbf0 Mon Sep 17 00:00:00 2001 From: Rafi Khan Date: Wed, 2 Dec 2015 23:57:00 +0000 Subject: [PATCH 2/2] merging #241 --- .travis.yml | 1 + changelog.md | 5 +++++ 2 files changed, 6 insertions(+) diff --git a/.travis.yml b/.travis.yml index 43666bd..f4b1ba0 100644 --- a/.travis.yml +++ b/.travis.yml @@ -13,6 +13,7 @@ env: - PLATFORMIO_CI_SRC=examples/IRtest PLATFORMIO_BUILD_FLAGS="-DSEND_NEC -DSEND_SONY -DSEND_RC5 -DSEND_RC6" - PLATFORMIO_CI_SRC=examples/IRtest2 PLATFORMIO_BUILD_FLAGS="-DSEND_NEC -DSEND_SONY -DSEND_RC5 -DSEND_RC6" - PLATFORMIO_CI_SRC=examples/JVCPanasonicSendDemo PLATFORMIO_BUILD_FLAGS="-DSEND_JVC -DSEND_PANASONIC" + - PLATFORMIO_CI_SRC=examples/IRremoteInfo install: - python -c "$(curl -fsSL https://raw.githubusercontent.com/platformio/platformio/master/scripts/get-platformio.py)" diff --git a/changelog.md b/changelog.md index 81e95d8..d5f4cff 100644 --- a/changelog.md +++ b/changelog.md @@ -1,3 +1,8 @@ + +## 2.0.2 - 2015/12/02 +- Added IRremoteInfo Sketch - [PR](https://github.com/z3t0/Arduino-IRremote/pull/241) +- Enforcing changelog.md + ## 2.0.1 - 2015/07/26 - [Release](https://github.com/shirriff/Arduino-IRremote/releases/tag/BETA) ### Changes - Updated README