From e947f0924e28e75fced86949db6d1babb2fcb198 Mon Sep 17 00:00:00 2001 From: Ivan Kravets Date: Thu, 25 Sep 2014 14:18:56 +0300 Subject: [PATCH 01/12] PlatformIO-based manifest file Web: http://platformio.ikravets.com/#!/lib/show/Arduino-IRremote Docs: http://docs.platformio.ikravets.com/en/latest/librarymanager/index.html --- library.json | 10 ++++++++++ 1 file changed, 10 insertions(+) create mode 100644 library.json diff --git a/library.json b/library.json new file mode 100644 index 0000000..2edf145 --- /dev/null +++ b/library.json @@ -0,0 +1,10 @@ +{ + "name": "Arduino-IRremote", + "keywords": "infrared, ir, remote", + "description": "Send and receive infrared signals with multiple protocols", + "repository": + { + "type": "git", + "url": "https://github.com/shirriff/Arduino-IRremote.git" + } +} From a3cdf402d7acea346f9010ce431d7ff301d2b469 Mon Sep 17 00:00:00 2001 From: Ivan Kravets Date: Mon, 20 Oct 2014 11:41:09 +0300 Subject: [PATCH 02/12] Avoid trademark issues with library name Added frameworks and platforms fields --- library.json | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/library.json b/library.json index 2edf145..3a29ecd 100644 --- a/library.json +++ b/library.json @@ -1,10 +1,12 @@ { - "name": "Arduino-IRremote", + "name": "IRremote", "keywords": "infrared, ir, remote", "description": "Send and receive infrared signals with multiple protocols", "repository": { "type": "git", "url": "https://github.com/shirriff/Arduino-IRremote.git" - } + }, + "frameworks": "arduino", + "platforms": "atmelavr" } From 12f7ef1d28507fd9c71575981420b312f4df4359 Mon Sep 17 00:00:00 2001 From: Rafi Khan Date: Sun, 8 Mar 2015 16:03:41 -0600 Subject: [PATCH 03/12] Add contributors to readme --- README.md | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/README.md b/README.md index 952b7aa..cf97a7c 100644 --- a/README.md +++ b/README.md @@ -16,5 +16,18 @@ If you want to contribute to this project: - Create issues and pull requests - Tell other people about this library +## Contributors +These are the active contributors of this project that you may contact if there is anything you need help with or if you have suggestions. + +- [z3t0](github.com/z3t0) : Active Contributor and currently also the main contributor. + * Email: zetoslab@gmail.com + * Skype: polarised16 +- [shirriff](github.com/shirriff) : Owner of repository and creator of library. +- [Informatic](github.com/Informatic) : Active contributor +- [fmeschia](github.com/fmeschia) : Active contributor +- [PaullStoffregen](github.com/paullstroffregen) : Active contributor + +Note: This list is being updated constantly so please let @z3t0 know if you have been missed. + ## Copyright Copyright 2009-2012 Ken Shirriff From c0446fd6593fa612fdab0837edf4148f09430667 Mon Sep 17 00:00:00 2001 From: Rafi Khan Date: Sun, 8 Mar 2015 16:07:40 -0600 Subject: [PATCH 04/12] Fixed broken links --- README.md | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/README.md b/README.md index cf97a7c..388f379 100644 --- a/README.md +++ b/README.md @@ -19,15 +19,15 @@ If you want to contribute to this project: ## Contributors These are the active contributors of this project that you may contact if there is anything you need help with or if you have suggestions. -- [z3t0](github.com/z3t0) : Active Contributor and currently also the main contributor. +- [z3t0](https://github.com/z3t0) : Active Contributor and currently also the main contributor. * Email: zetoslab@gmail.com * Skype: polarised16 -- [shirriff](github.com/shirriff) : Owner of repository and creator of library. -- [Informatic](github.com/Informatic) : Active contributor -- [fmeschia](github.com/fmeschia) : Active contributor -- [PaullStoffregen](github.com/paullstroffregen) : Active contributor +- [shirriff](https://github.com/shirriff) : Owner of repository and creator of library. +- [Informatic](https://github.com/Informatic) : Active contributor +- [fmeschia](https://github.com/fmeschia) : Active contributor +- [PaulStoffregen](https://github.com/paulstroffregen) : Active contributor -Note: This list is being updated constantly so please let @z3t0 know if you have been missed. +Note: This list is being updated constantly so please let [z3t0](https://github.com/z3t0) know if you have been missed. ## Copyright Copyright 2009-2012 Ken Shirriff From bed4cc5c97b2d5ad440b5523bc9c28ca99354b54 Mon Sep 17 00:00:00 2001 From: Christian Musa Date: Wed, 30 Apr 2014 16:28:31 -0300 Subject: [PATCH 05/12] Added Aiwa protocol (remote control RC-T501). Added Aiwa protocol (remote control RC-T501) based on lirc file. Updated IRrecvDump example, added SendDemo example (AiwaRCT501SendDemo). --- IRremote.cpp | 116 ++++++++++++++++++ IRremote.h | 3 + IRremoteInt.h | 14 +++ .../AiwaRCT501SendDemo/AiwaRCT501SendDemo.ino | 25 ++++ examples/IRrecvDump/IRrecvDump.ino | 4 + 5 files changed, 162 insertions(+) create mode 100644 examples/AiwaRCT501SendDemo/AiwaRCT501SendDemo.ino diff --git a/IRremote.cpp b/IRremote.cpp index af5a3c8..b617559 100644 --- a/IRremote.cpp +++ b/IRremote.cpp @@ -506,6 +506,13 @@ int IRrecv::decode(decode_results *results) { if (decodeWhynter(results)) { return DECODED; } +// Aiwa RC-T501 +#ifdef DEBUG + Serial.println("Attempting Aiwa RC-T501 decode"); +#endif + if (decodeAiwaRCT501(results)) { + return DECODED; + } // decodeHash returns a hash on any input. // Thus, it needs to be last in the list. // If you add any decodes, add them before this. @@ -1117,6 +1124,65 @@ long IRrecv::decodeSAMSUNG(decode_results *results) { return DECODED; } +/** + * Aiwa system + * Remote control RC-T501 + * Lirc file http://lirc.sourceforge.net/remotes/aiwa/RC-T501 + * + */ +long IRrecv::decodeAiwaRCT501(decode_results *results) { + int data = 0; + int offset = 1; // skip first garbage read + + // Check SIZE + if(irparams.rawlen < 2 * (AIWA_RC_T501_SUM_BITS) + 4) { + return ERR; + } + + // Check HDR + if(!MATCH_MARK(results->rawbuf[offset], AIWA_RC_T501_HDR_MARK)) { + return ERR; + } + offset++; + + // Check HDR space + if(!MATCH_SPACE(results->rawbuf[offset], AIWA_RC_T501_HDR_SPACE)) { + return ERR; + } + offset++; + + offset += 26; // skip pre-data - optional + while(offset < irparams.rawlen - 4) { + if(MATCH_MARK(results->rawbuf[offset], AIWA_RC_T501_BIT_MARK)) { + offset++; + } + else { + return ERR; + } + + // ONE & ZERO + if(MATCH_SPACE(results->rawbuf[offset], AIWA_RC_T501_ONE_SPACE)) { + data = (data << 1) | 1; + } + else if(MATCH_SPACE(results->rawbuf[offset], AIWA_RC_T501_ZERO_SPACE)) { + data <<= 1; + } + else { + // End of one & zero detected + break; + } + offset++; + } + + results->bits = (offset - 1) / 2; + if(results->bits < 42) { + return ERR; + } + results->value = data; + results->decode_type = AIWA_RC_T501; + return DECODED; +} + /* ----------------------------------------------------------------------- * hashdecode - decode an arbitrary IR code. * Instead of decoding using a standard encoding scheme @@ -1239,3 +1305,53 @@ void IRsend::sendDISH(unsigned long data, int nbits) { data <<= 1; } } + +/** + * Aiwa system + * Remote control RC-T501 + * Lirc file http://lirc.sourceforge.net/remotes/aiwa/RC-T501 + * + */ +void IRsend::sendAiwaRCT501(int code) { + // PRE-DATA, 26 bits, 0x227EEC0 + long int pre = 0x227EEC0; + int i; + + enableIROut(AIWA_RC_T501_HZ); + + // HDR mark + HDR space + mark(AIWA_RC_T501_HDR_MARK); + space(AIWA_RC_T501_HDR_SPACE); + + // Skip leading zero's + pre <<= 6; + // Send pre-data + for(i=0; i < 26; i++) { + mark(AIWA_RC_T501_BIT_MARK); + if(pre & TOPBIT) { + space(AIWA_RC_T501_ONE_SPACE); + } else { + space(AIWA_RC_T501_ZERO_SPACE); + } + pre <<= 1; + } + + // Skip firts code bit + code <<= 1; + // Send code + for(i=0; i < 15; i++) { + mark(AIWA_RC_T501_BIT_MARK); + if(code & TOPBIT) { + space(AIWA_RC_T501_ONE_SPACE); + } else { + space(AIWA_RC_T501_ZERO_SPACE); + } + code <<= 1; + } + // POST-DATA, 1 bit, 0x0 + mark(AIWA_RC_T501_BIT_MARK); + space(AIWA_RC_T501_ZERO_SPACE); + + mark(AIWA_RC_T501_BIT_MARK); + space(0); +} \ No newline at end of file diff --git a/IRremote.h b/IRremote.h index e4b274e..271f17e 100644 --- a/IRremote.h +++ b/IRremote.h @@ -53,6 +53,7 @@ public: #define SAMSUNG 11 #define LG 12 #define WHYNTER 13 +#define AIWA_RC_T501 14 #define UNKNOWN -1 // Decoded value for NEC when a repeat code is received @@ -81,6 +82,7 @@ private: long decodeJVC(decode_results *results); long decodeSAMSUNG(decode_results *results); long decodeWhynter(decode_results *results); + long decodeAiwaRCT501(decode_results *results); long decodeHash(decode_results *results); int compare(unsigned int oldval, unsigned int newval); @@ -111,6 +113,7 @@ public: void sendSharpRaw(unsigned long data, int nbits); void sendPanasonic(unsigned int address, unsigned long data); void sendJVC(unsigned long data, int nbits, int repeat); // *Note instead of sending the REPEAT constant if you want the JVC repeat signal sent, send the original code value and change the repeat argument from 0 to 1. JVC protocol repeats by skipping the header NOT by sending a separate code value like NEC does. + void sendAiwaRCT501(int code); // private: void sendSAMSUNG(unsigned long data, int nbits); void enableIROut(int khz); diff --git a/IRremoteInt.h b/IRremoteInt.h index 53167c2..674ee8d 100644 --- a/IRremoteInt.h +++ b/IRremoteInt.h @@ -190,6 +190,20 @@ #define SHARP_BITS 15 #define DISH_BITS 16 +// AIWA RC T501 +// Lirc file http://lirc.sourceforge.net/remotes/aiwa/RC-T501 +#define AIWA_RC_T501_HZ 38 +#define AIWA_RC_T501_BITS 15 +#define AIWA_RC_T501_PRE_BITS 26 +#define AIWA_RC_T501_POST_BITS 1 +#define AIWA_RC_T501_SUM_BITS AIWA_RC_T501_PRE_BITS+AIWA_RC_T501_BITS+AIWA_RC_T501_POST_BITS +#define AIWA_RC_T501_HDR_MARK 8800 +#define AIWA_RC_T501_HDR_SPACE 4500 +#define AIWA_RC_T501_BIT_MARK 500 +#define AIWA_RC_T501_ONE_SPACE 600 +#define AIWA_RC_T501_ZERO_SPACE 1700 + + #define TOLERANCE 25 // percent tolerance in measurements #define LTOL (1.0 - TOLERANCE/100.) #define UTOL (1.0 + TOLERANCE/100.) diff --git a/examples/AiwaRCT501SendDemo/AiwaRCT501SendDemo.ino b/examples/AiwaRCT501SendDemo/AiwaRCT501SendDemo.ino new file mode 100644 index 0000000..694bacc --- /dev/null +++ b/examples/AiwaRCT501SendDemo/AiwaRCT501SendDemo.ino @@ -0,0 +1,25 @@ +/* + * IRremote: IRsendDemo - demonstrates sending IR codes with IRsend + * An IR LED must be connected to Arduino PWM pin 3. + * Version 0.1 July, 2009 + * Copyright 2009 Ken Shirriff + * http://arcfn.com + */ + +#include "IRremote.h" + +#define POWER 0x7F80 + +IRsend irsend; + +void setup() { + Serial.begin(9600); + Serial.println("Arduino Ready"); +} + +void loop() { + if (Serial.read() != -1) { + irsend.sendAiwaRCT501(POWER); + delay(60); // Optional + } +} diff --git a/examples/IRrecvDump/IRrecvDump.ino b/examples/IRrecvDump/IRrecvDump.ino index 0f8e4f1..a1ba3b2 100644 --- a/examples/IRrecvDump/IRrecvDump.ino +++ b/examples/IRrecvDump/IRrecvDump.ino @@ -54,6 +54,10 @@ void dump(decode_results *results) { } else if (results->decode_type == JVC) { Serial.print("Decoded JVC: "); + + } + else if (results->decode_type == AIWA_RC_T501) { + Serial.print("Decoded AIWA RC T501: "); } else if (results->decode_type == WHYNTER) { Serial.print("Decoded Whynter: "); From 18f5aa639b7c2048e03cfde9b7935e0c12094591 Mon Sep 17 00:00:00 2001 From: Rafi Khan Date: Sun, 8 Mar 2015 17:30:36 -0600 Subject: [PATCH 06/12] Added GitHub Page --- index.html | 7 +++++++ 1 file changed, 7 insertions(+) create mode 100644 index.html diff --git a/index.html b/index.html new file mode 100644 index 0000000..126a800 --- /dev/null +++ b/index.html @@ -0,0 +1,7 @@ + + + +

Hello World

+

I'm hosted with GitHub Pages.

+ + From c35f7219dd10665b483ecd799eddbefd5fb27d2a Mon Sep 17 00:00:00 2001 From: Rafi Khan Date: Sun, 8 Mar 2015 17:35:21 -0600 Subject: [PATCH 07/12] removed index --- index.html | 7 +++++++ 1 file changed, 7 insertions(+) create mode 100644 index.html diff --git a/index.html b/index.html new file mode 100644 index 0000000..126a800 --- /dev/null +++ b/index.html @@ -0,0 +1,7 @@ + + + +

Hello World

+

I'm hosted with GitHub Pages.

+ + From 3256c847b23d5237bfb631966c533ad3182e3c7e Mon Sep 17 00:00:00 2001 From: Rafi Khan Date: Sun, 8 Mar 2015 17:37:06 -0600 Subject: [PATCH 08/12] remove index (for real) --- index.html | 7 ------- 1 file changed, 7 deletions(-) delete mode 100644 index.html diff --git a/index.html b/index.html deleted file mode 100644 index 126a800..0000000 --- a/index.html +++ /dev/null @@ -1,7 +0,0 @@ - - - -

Hello World

-

I'm hosted with GitHub Pages.

- - From 9c2064c5b4027f6d5c406e0fb90f52a731c88ae2 Mon Sep 17 00:00:00 2001 From: Rafi Khan Date: Sun, 8 Mar 2015 17:38:20 -0600 Subject: [PATCH 09/12] add crash7 to contributors list --- README.md | 1 + 1 file changed, 1 insertion(+) diff --git a/README.md b/README.md index 388f379..a333ce3 100644 --- a/README.md +++ b/README.md @@ -26,6 +26,7 @@ These are the active contributors of this project that you may contact if there - [Informatic](https://github.com/Informatic) : Active contributor - [fmeschia](https://github.com/fmeschia) : Active contributor - [PaulStoffregen](https://github.com/paulstroffregen) : Active contributor +- [crash7](https://github.com/crash7) : Active contributor Note: This list is being updated constantly so please let [z3t0](https://github.com/z3t0) know if you have been missed. From 3b16c12b59cdfa7ef8687f0f43bf7ba761b34787 Mon Sep 17 00:00:00 2001 From: Rafi Khan Date: Sun, 8 Mar 2015 19:40:16 -0600 Subject: [PATCH 10/12] Added Neco777 to contributors --- README.md | 1 + 1 file changed, 1 insertion(+) diff --git a/README.md b/README.md index a333ce3..4f3fc2a 100644 --- a/README.md +++ b/README.md @@ -27,6 +27,7 @@ These are the active contributors of this project that you may contact if there - [fmeschia](https://github.com/fmeschia) : Active contributor - [PaulStoffregen](https://github.com/paulstroffregen) : Active contributor - [crash7](https://github.com/crash7) : Active contributor +- [Neco777](https://github.com/neco777) : Active contributor Note: This list is being updated constantly so please let [z3t0](https://github.com/z3t0) know if you have been missed. From 7b08532e47cbd117aea110eabb99e411d85f1a3f Mon Sep 17 00:00:00 2001 From: Rafi Khan Date: Sun, 8 Mar 2015 19:42:47 -0600 Subject: [PATCH 11/12] Moved contributors to a different file --- Contributors.md | 16 ++++++++++++++++ README.md | 14 +------------- 2 files changed, 17 insertions(+), 13 deletions(-) create mode 100644 Contributors.md diff --git a/Contributors.md b/Contributors.md new file mode 100644 index 0000000..2af3126 --- /dev/null +++ b/Contributors.md @@ -0,0 +1,16 @@ +## Contributors +These are the active contributors of this project that you may contact if there is anything you need help with or if you have suggestions. + +- [z3t0](https://github.com/z3t0) : Active Contributor and currently also the main contributor. + * Email: zetoslab@gmail.com + * Skype: polarised16 +- [shirriff](https://github.com/shirriff) : Owner of repository and creator of library. +- [Informatic](https://github.com/Informatic) : Active contributor +- [fmeschia](https://github.com/fmeschia) : Active contributor +- [PaulStoffregen](https://github.com/paulstroffregen) : Active contributor +- [crash7](https://github.com/crash7) : Active contributor +- [Neco777](https://github.com/neco777) : Active contributor + +Note: This list is being updated constantly so please let [z3t0](https://github.com/z3t0) know if you have been missed. + + diff --git a/README.md b/README.md index 4f3fc2a..086736c 100644 --- a/README.md +++ b/README.md @@ -17,19 +17,7 @@ If you want to contribute to this project: - Tell other people about this library ## Contributors -These are the active contributors of this project that you may contact if there is anything you need help with or if you have suggestions. - -- [z3t0](https://github.com/z3t0) : Active Contributor and currently also the main contributor. - * Email: zetoslab@gmail.com - * Skype: polarised16 -- [shirriff](https://github.com/shirriff) : Owner of repository and creator of library. -- [Informatic](https://github.com/Informatic) : Active contributor -- [fmeschia](https://github.com/fmeschia) : Active contributor -- [PaulStoffregen](https://github.com/paulstroffregen) : Active contributor -- [crash7](https://github.com/crash7) : Active contributor -- [Neco777](https://github.com/neco777) : Active contributor - -Note: This list is being updated constantly so please let [z3t0](https://github.com/z3t0) know if you have been missed. +Check [here](Contributors.md) ## Copyright Copyright 2009-2012 Ken Shirriff From 9a5d40a74cdf2045b2003646e9f2bd89ad19c4ff Mon Sep 17 00:00:00 2001 From: Rafi Khan Date: Sun, 8 Mar 2015 21:09:48 -0600 Subject: [PATCH 12/12] Changed define for Aiwa from 14 to 15 --- IRremote.h | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/IRremote.h b/IRremote.h index 271f17e..d8717b1 100644 --- a/IRremote.h +++ b/IRremote.h @@ -53,7 +53,8 @@ public: #define SAMSUNG 11 #define LG 12 #define WHYNTER 13 -#define AIWA_RC_T501 14 +#define Sharp 14 +#define AIWA_RC_T501 15 #define UNKNOWN -1 // Decoded value for NEC when a repeat code is received