mirror of
https://github.com/Theaninova/Arduino-IRremote.git
synced 2025-12-24 23:36:16 +00:00
Compare commits
12 Commits
v2.4.0
...
feature-re
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
222630922f | ||
|
|
9b39a2f7dc | ||
|
|
42b791f9ad | ||
|
|
c43d221a7b | ||
|
|
4eb95a3272 | ||
|
|
542516f116 | ||
|
|
563c82c6c4 | ||
|
|
a406f3b9f9 | ||
|
|
31968a4875 | ||
|
|
635e8a923d | ||
|
|
b0d15b6020 | ||
|
|
622e28bf69 |
@@ -1,240 +0,0 @@
|
||||
{
|
||||
"auto_complete":
|
||||
{
|
||||
"selected_items":
|
||||
[
|
||||
[
|
||||
"vb",
|
||||
"vboMatrix"
|
||||
]
|
||||
]
|
||||
},
|
||||
"buffers":
|
||||
[
|
||||
],
|
||||
"build_system": "",
|
||||
"build_system_choices":
|
||||
[
|
||||
],
|
||||
"build_varint": "",
|
||||
"command_palette":
|
||||
{
|
||||
"height": 275.0,
|
||||
"last_filter": "blame",
|
||||
"selected_items":
|
||||
[
|
||||
[
|
||||
"blame",
|
||||
"Git: Blame"
|
||||
],
|
||||
[
|
||||
"install",
|
||||
"Package Control: Install Package"
|
||||
],
|
||||
[
|
||||
"diff",
|
||||
"Git: Diff Current File"
|
||||
],
|
||||
[
|
||||
"js",
|
||||
"Set Syntax: JavaScript"
|
||||
],
|
||||
[
|
||||
"i",
|
||||
"Package Control: Install Package"
|
||||
],
|
||||
[
|
||||
"instal",
|
||||
"Package Control: Install Package"
|
||||
]
|
||||
],
|
||||
"width": 510.0
|
||||
},
|
||||
"console":
|
||||
{
|
||||
"height": 126.0,
|
||||
"history":
|
||||
[
|
||||
"import urllib.request,os,hashlib; h = '2915d1851351e5ee549c20394736b442' + '8bc59f460fa1548d1514676163dafc88'; pf = 'Package Control.sublime-package'; ipp = sublime.installed_packages_path(); urllib.request.install_opener( urllib.request.build_opener( urllib.request.ProxyHandler()) ); by = urllib.request.urlopen( 'http://packagecontrol.io/' + pf.replace(' ', '%20')).read(); dh = hashlib.sha256(by).hexdigest(); print('Error validating download (got %s instead of %s), please try manual install' % (dh, h)) if dh != h else open(os.path.join( ipp, pf), 'wb' ).write(by)"
|
||||
]
|
||||
},
|
||||
"distraction_free":
|
||||
{
|
||||
"menu_visible": true,
|
||||
"show_minimap": false,
|
||||
"show_open_files": false,
|
||||
"show_tabs": false,
|
||||
"side_bar_visible": false,
|
||||
"status_bar_visible": false
|
||||
},
|
||||
"expanded_folders":
|
||||
[
|
||||
"/C/Users/Rafi Khan/Documents/Arduino/libraries/Arduino-IRremote"
|
||||
],
|
||||
"file_history":
|
||||
[
|
||||
"/C/Users/Rafi Khan/Documents/Arduino/libraries/Arduino-IRremote/changelog.md",
|
||||
"/C/Users/Rafi Khan/Documents/Development/Arduino-IRremote/arduino-irremote.sublime-project",
|
||||
"/C/Users/Rafi Khan/Documents/Development/Arduino-IRremote/.gitignore",
|
||||
"/C/Users/Rafi Khan/Documents/Development/magic/README.md",
|
||||
"/C/Users/Rafi Khan/Documents/Development/magic/shader.frag",
|
||||
"/C/Users/Rafi Khan/Documents/Development/magic/package.json",
|
||||
"/C/Users/Rafi Khan/Documents/Development/magic/block.js",
|
||||
"/C/Users/Rafi Khan/Documents/Development/magic/chunker.js",
|
||||
"/C/Users/Rafi Khan/Documents/Development/magic/index.js",
|
||||
"/C/Users/Rafi Khan/Documents/Development/magic/blocks",
|
||||
"/C/Users/Rafi Khan/AppData/Roaming/Sublime Text 3/Packages/User/Preferences.sublime-settings",
|
||||
"/C/Users/Rafi Khan/Documents/Development/magic/shader.vert",
|
||||
"/C/Users/Rafi Khan/Documents/Development/magic/magic.sublime-project",
|
||||
"/C/Users/Rafi Khan/Documents/Development/magic/node_modules/browserify/node_modules/syntax-error/node_modules/acorn/.tern-project",
|
||||
"/C/Users/Rafi Khan/OneDrive/Documents/School-RafiKhan/Grade 11/CS30/Python/supermarket.py",
|
||||
"/C/Users/Rafi Khan/OneDrive/Documents/School-RafiKhan/Grade 11/CS30/Python/takingavacation.py",
|
||||
"/C/Users/Rafi Khan/OneDrive/Documents/School-RafiKhan/Grade 11/CS30/Python/TipCalculator.py",
|
||||
"/C/Users/Rafi Khan/OneDrive/Documents/School-RafiKhan/Grade 11/CS30/Python/battleship.py",
|
||||
"/C/Users/Rafi Khan/OneDrive/Documents/School-RafiKhan/Grade 11/CS30/Python/exam.py",
|
||||
"/C/Users/Rafi Khan/OneDrive/Documents/School-RafiKhan/Grade 11/CS30/Python/pyglatin.py",
|
||||
"/C/Users/Rafi Khan/OneDrive/Documents/School-RafiKhan/Grade 11/CS30/Python/student.py"
|
||||
],
|
||||
"find":
|
||||
{
|
||||
"height": 28.0
|
||||
},
|
||||
"find_in_files":
|
||||
{
|
||||
"height": 0.0,
|
||||
"where_history":
|
||||
[
|
||||
]
|
||||
},
|
||||
"find_state":
|
||||
{
|
||||
"case_sensitive": false,
|
||||
"find_history":
|
||||
[
|
||||
"i",
|
||||
"Direction",
|
||||
";",
|
||||
";\n",
|
||||
"north",
|
||||
"cubeMatrix",
|
||||
")\n",
|
||||
"vec3.set",
|
||||
"f",
|
||||
";",
|
||||
"();\n",
|
||||
"render",
|
||||
"this",
|
||||
"y"
|
||||
],
|
||||
"highlight": true,
|
||||
"in_selection": false,
|
||||
"preserve_case": false,
|
||||
"regex": false,
|
||||
"replace_history":
|
||||
[
|
||||
],
|
||||
"reverse": false,
|
||||
"show_context": true,
|
||||
"use_buffer2": true,
|
||||
"whole_word": false,
|
||||
"wrap": true
|
||||
},
|
||||
"groups":
|
||||
[
|
||||
{
|
||||
"sheets":
|
||||
[
|
||||
]
|
||||
}
|
||||
],
|
||||
"incremental_find":
|
||||
{
|
||||
"height": 28.0
|
||||
},
|
||||
"input":
|
||||
{
|
||||
"height": 66.0
|
||||
},
|
||||
"layout":
|
||||
{
|
||||
"cells":
|
||||
[
|
||||
[
|
||||
0,
|
||||
0,
|
||||
1,
|
||||
1
|
||||
]
|
||||
],
|
||||
"cols":
|
||||
[
|
||||
0.0,
|
||||
1.0
|
||||
],
|
||||
"rows":
|
||||
[
|
||||
0.0,
|
||||
1.0
|
||||
]
|
||||
},
|
||||
"menu_visible": true,
|
||||
"output.find_results":
|
||||
{
|
||||
"height": 0.0
|
||||
},
|
||||
"pinned_build_system": "",
|
||||
"project": "arduino-irremote.sublime-project",
|
||||
"replace":
|
||||
{
|
||||
"height": 52.0
|
||||
},
|
||||
"save_all_on_build": true,
|
||||
"select_file":
|
||||
{
|
||||
"height": 0.0,
|
||||
"last_filter": "",
|
||||
"selected_items":
|
||||
[
|
||||
[
|
||||
"json",
|
||||
"package.json"
|
||||
],
|
||||
[
|
||||
"inde",
|
||||
"index.js"
|
||||
]
|
||||
],
|
||||
"width": 0.0
|
||||
},
|
||||
"select_project":
|
||||
{
|
||||
"height": 0.0,
|
||||
"last_filter": "",
|
||||
"selected_items":
|
||||
[
|
||||
],
|
||||
"width": 0.0
|
||||
},
|
||||
"select_symbol":
|
||||
{
|
||||
"height": 0.0,
|
||||
"last_filter": "",
|
||||
"selected_items":
|
||||
[
|
||||
],
|
||||
"width": 0.0
|
||||
},
|
||||
"selected_group": 0,
|
||||
"settings":
|
||||
{
|
||||
},
|
||||
"show_minimap": true,
|
||||
"show_open_files": false,
|
||||
"show_tabs": true,
|
||||
"side_bar_visible": true,
|
||||
"side_bar_width": 150.0,
|
||||
"status_bar_visible": true,
|
||||
"template_settings":
|
||||
{
|
||||
}
|
||||
}
|
||||
@@ -56,6 +56,7 @@ void encoding (decode_results *results)
|
||||
case AIWA_RC_T501: Serial.print("AIWA_RC_T501"); break ;
|
||||
case PANASONIC: Serial.print("PANASONIC"); break ;
|
||||
case DENON: Serial.print("Denon"); break ;
|
||||
case RECS80: Serial.print("RECS80"); break ;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
16
examples/IRsendRECS80Test/IRsendRECS80Test.ino
Normal file
16
examples/IRsendRECS80Test/IRsendRECS80Test.ino
Normal file
@@ -0,0 +1,16 @@
|
||||
|
||||
#include <IRremote.h>
|
||||
|
||||
IRsend irsend;
|
||||
|
||||
void setup()
|
||||
{
|
||||
delay(2000);
|
||||
}
|
||||
|
||||
void loop() {
|
||||
for (int i = 0; i < 512; i++) {
|
||||
irsend.sendRECS80(i);
|
||||
delay(5000); //5 second delay between each signal burst
|
||||
}
|
||||
}
|
||||
@@ -7,7 +7,7 @@
|
||||
"type": "git",
|
||||
"url": "https://github.com/z3t0/Arduino-IRremote.git"
|
||||
},
|
||||
"version": "2.3.3",
|
||||
"version": "2.4.0",
|
||||
"frameworks": "arduino",
|
||||
"platforms": "atmelavr",
|
||||
"authors" :
|
||||
|
||||
@@ -1,9 +1,9 @@
|
||||
name=IRremote
|
||||
version=2.2.3
|
||||
author=shirriff
|
||||
maintainer=shirriff
|
||||
version=2.4.0
|
||||
author=shirriff, z3t0
|
||||
maintainer=z3t0
|
||||
sentence=Send and receive infrared signals with multiple protocols
|
||||
paragraph=Send and receive infrared signals with multiple protocols
|
||||
category=Signal Input/Output
|
||||
url=https://github.com/shirriff/Arduino-IRremote.git
|
||||
paragraph=See more at https://github.com/z3t0/Arduino-IRremote
|
||||
category=Communication
|
||||
url=https://github.com/z3t0/Arduino-IRremote
|
||||
architectures=*
|
||||
|
||||
@@ -79,6 +79,9 @@
|
||||
#define DECODE_LEGO_PF 0 // NOT WRITTEN
|
||||
#define SEND_LEGO_PF 1
|
||||
|
||||
#define DECODE_RECS80 1 // NOT WRITTEN
|
||||
#define SEND_RECS80 1 // Still being tested
|
||||
|
||||
//------------------------------------------------------------------------------
|
||||
// When sending a Pronto code we request to send either the "once" code
|
||||
// or the "repeat" code
|
||||
@@ -119,13 +122,14 @@ typedef
|
||||
DENON,
|
||||
PRONTO,
|
||||
LEGO_PF,
|
||||
RECS80,
|
||||
}
|
||||
decode_type_t;
|
||||
|
||||
//------------------------------------------------------------------------------
|
||||
// Set DEBUG to 1 for lots of lovely debug output
|
||||
//
|
||||
#define DEBUG 0
|
||||
#define DEBUG 0
|
||||
|
||||
//------------------------------------------------------------------------------
|
||||
// Debug directives
|
||||
@@ -251,6 +255,10 @@ class IRrecv
|
||||
# if DECODE_LEGO_PF
|
||||
bool decodeLegoPowerFunctions (decode_results *results) ;
|
||||
# endif
|
||||
|
||||
# if DECODE_RECS80
|
||||
bool decodeRECS80(decode_results *results);
|
||||
# endif
|
||||
} ;
|
||||
|
||||
//------------------------------------------------------------------------------
|
||||
@@ -350,6 +358,10 @@ class IRsend
|
||||
# if SEND_LEGO_PF
|
||||
void sendLegoPowerFunctions (uint16_t data, bool repeat = true) ;
|
||||
# endif
|
||||
//......................................................................
|
||||
# if SEND_RECS80
|
||||
void sendRECS80 (uint16_t data) ;
|
||||
# endif
|
||||
|
||||
#ifdef USE_SOFT_CARRIER
|
||||
private:
|
||||
@@ -18,15 +18,9 @@
|
||||
#define IRremoteint_h
|
||||
|
||||
//------------------------------------------------------------------------------
|
||||
// Include the right Arduino header
|
||||
// Include the Arduino header
|
||||
//
|
||||
#if defined(ARDUINO) && (ARDUINO >= 100)
|
||||
# include <Arduino.h>
|
||||
#else
|
||||
# if !defined(IRPRONTO)
|
||||
# include <WProgram.h>
|
||||
# endif
|
||||
#endif
|
||||
#include <Arduino.h>
|
||||
|
||||
//------------------------------------------------------------------------------
|
||||
// This handles definition and access to global variables
|
||||
@@ -95,7 +89,7 @@ EXTERN volatile irparams_t irparams;
|
||||
#define UTOL (1.0 + (TOLERANCE/100.))
|
||||
|
||||
// Minimum gap between IR transmissions
|
||||
#define _GAP 5000
|
||||
#define _GAP 8000
|
||||
#define GAP_TICKS (_GAP/USECPERTICK)
|
||||
|
||||
#define TICKS_LOW(us) ((int)(((us)*LTOL/USECPERTICK)))
|
||||
@@ -85,6 +85,11 @@ int IRrecv::decode (decode_results *results)
|
||||
if (decodeLegoPowerFunctions(results)) return true ;
|
||||
#endif
|
||||
|
||||
#if DECODE_RECS80
|
||||
DBG_PRINTLN("Attempting RECS80 decode");
|
||||
if (decodeRECS80(results)) return true;
|
||||
#endif
|
||||
|
||||
// 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.
|
||||
92
src/ir_RECS80.cpp
Normal file
92
src/ir_RECS80.cpp
Normal file
@@ -0,0 +1,92 @@
|
||||
#include "IRremote.h"
|
||||
#include "IRremoteInt.h"
|
||||
|
||||
// RECS80
|
||||
// Documentation : http://www.sbprojects.com/knowledge/ir/recs80.php
|
||||
|
||||
#define RECS80_MARK 158
|
||||
#define RECS80_ONE_SPACE 7432
|
||||
#define RECS80_ZERO_SPACE 4902
|
||||
#define RECS80_BITS 12
|
||||
#define RECS80_BITS_DATA 9
|
||||
#define RECS80_ADDRESS_BITS 3
|
||||
#define RECS80_COMMAND_BITS 6
|
||||
|
||||
#if SEND_RECS80
|
||||
|
||||
void IRsend::sendRECS80 (uint16_t data) {
|
||||
// Set IR carrier frequency
|
||||
enableIROut(38);
|
||||
|
||||
// Header
|
||||
mark(RECS80_MARK);
|
||||
space(RECS80_ONE_SPACE);
|
||||
|
||||
// Data: address and command
|
||||
for (uint16_t mask = 1 << (RECS80_COMMAND_BITS + RECS80_ADDRESS_BITS - 1); mask; mask >>=1) {
|
||||
mark(RECS80_MARK);
|
||||
|
||||
if (data & mask) {
|
||||
space(RECS80_ONE_SPACE);
|
||||
} else {
|
||||
space(RECS80_ZERO_SPACE);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
mark(RECS80_MARK);
|
||||
space(0);
|
||||
}
|
||||
|
||||
|
||||
#endif // SEND_RECS80
|
||||
|
||||
#if DECODE_RECS80
|
||||
|
||||
bool IRrecv::decodeRECS80 (decode_results *results)
|
||||
{
|
||||
long data = 0;
|
||||
long offset = 1;
|
||||
|
||||
// Check that there is enough data
|
||||
if (irparams.rawlen < (2 * RECS80_BITS) - 2) {
|
||||
|
||||
DBG_PRINTLN("Not long enough");
|
||||
DBG_PRINTLN(irparams.rawlen);
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
// Initial mark and space
|
||||
if (!MATCH_MARK(results->rawbuf[offset++], RECS80_MARK)) return false;
|
||||
if (!MATCH_SPACE(results->rawbuf[offset++], RECS80_ONE_SPACE)) return false;
|
||||
|
||||
// Data: Address and command stored as one variable
|
||||
for (int i = 0; i < (RECS80_ADDRESS_BITS + RECS80_COMMAND_BITS); i++) {
|
||||
if (!MATCH_MARK(results->rawbuf[offset++], RECS80_MARK)) return false;
|
||||
|
||||
// One
|
||||
if (MATCH_MARK(results->rawbuf[offset], RECS80_ONE_SPACE))
|
||||
data = (data << 1) | 1;
|
||||
|
||||
// Zero
|
||||
else if (MATCH_MARK(results->rawbuf[offset], RECS80_ZERO_SPACE))
|
||||
data = (data << 1) | 0;
|
||||
|
||||
else return false;
|
||||
offset++;
|
||||
}
|
||||
|
||||
if (!MATCH_MARK(results->rawbuf[offset], RECS80_MARK)) return false;
|
||||
|
||||
// Success
|
||||
results->decode_type = RECS80;
|
||||
results->bits = RECS80_BITS_DATA;
|
||||
results->value = data;
|
||||
|
||||
return true;
|
||||
|
||||
|
||||
}
|
||||
|
||||
#endif
|
||||
Reference in New Issue
Block a user