1 Commits

Author SHA1 Message Date
Rafi Khan
13ac290b3b working on restructuring and renaming. Change IRremote.h to AIRremote.h
If there are other ideas for a better name then we can use that, A =
Arduino in case it wasnt obvious.
2016-12-11 20:28:43 -06:00
49 changed files with 453 additions and 3113 deletions

View File

@@ -1,7 +1,3 @@
/**
* @file IRremote.h
* @brief Public API to the library.
*/
//******************************************************************************
// IRremote
@@ -19,13 +15,13 @@
// Whynter A/C ARC-110WD added by Francesco Meschia
//******************************************************************************
#ifndef IRremote_h
#define IRremote_h
#ifndef AIRremote_h
#define AIRremote_h
//------------------------------------------------------------------------------
// The ISR header contains several useful macros the user may wish to use
//
#include "private/IRremoteInt.h"
#include "IRremoteInt.h"
//------------------------------------------------------------------------------
// Supported IR protocols
@@ -98,10 +94,10 @@
#define PRONTO_FALLBACK true
#define PRONTO_NOFALLBACK false
/**
* An enum consisting of all supported formats.
* You do NOT need to remove entries from this list when disabling protocols!
*/
//------------------------------------------------------------------------------
// An enumerated list of all supported formats
// You do NOT need to remove entries from this list when disabling protocols!
//
typedef
enum {
UNKNOWN = -1,
@@ -126,9 +122,9 @@ typedef
}
decode_type_t;
/**
* Set DEBUG to 1 for lots of lovely debug output.
*/
//------------------------------------------------------------------------------
// Set DEBUG to 1 for lots of lovely debug output
//
#define DEBUG 0
//------------------------------------------------------------------------------
@@ -138,13 +134,7 @@ decode_type_t;
# define DBG_PRINT(...) Serial.print(__VA_ARGS__)
# define DBG_PRINTLN(...) Serial.println(__VA_ARGS__)
#else
/**
* If DEBUG, print the arguments, otherwise do nothing.
*/
# define DBG_PRINT(...)
/**
* If DEBUG, print the arguments as a line, otherwise do nothing.
*/
# define DBG_PRINTLN(...)
#endif
@@ -155,71 +145,39 @@ int MATCH (int measured, int desired) ;
int MATCH_MARK (int measured_ticks, int desired_us) ;
int MATCH_SPACE (int measured_ticks, int desired_us) ;
/**
* Results returned from the decoder
*/
//------------------------------------------------------------------------------
// Results returned from the decoder
//
class decode_results
{
public:
decode_type_t decode_type; ///< UNKNOWN, NEC, SONY, RC5, ...
unsigned int address; ///< Used by Panasonic & Sharp [16-bits]
unsigned long value; ///< Decoded value [max 32-bits]
int bits; ///< Number of bits in decoded value
volatile unsigned int *rawbuf; ///< Raw intervals in 50uS ticks
int rawlen; ///< Number of records in rawbuf
int overflow; ///< true iff IR raw code too long
decode_type_t decode_type; // UNKNOWN, NEC, SONY, RC5, ...
unsigned int address; // Used by Panasonic & Sharp [16-bits]
unsigned long value; // Decoded value [max 32-bits]
int bits; // Number of bits in decoded value
volatile unsigned int *rawbuf; // Raw intervals in 50uS ticks
int rawlen; // Number of records in rawbuf
int overflow; // true iff IR raw code too long
};
/**
* Decoded value for NEC when a repeat code is received
*/
//------------------------------------------------------------------------------
// Decoded value for NEC when a repeat code is received
//
#define REPEAT 0xFFFFFFFF
/**
* Main class for receiving IR
*/
//------------------------------------------------------------------------------
// Main class for receiving IR
//
class IRrecv
{
public:
/**
* Instantiate the IRrecv class. Multiple instantiation is not supported.
* @param recvpin Arduino pin to use. No sanity check is made.
*/
IRrecv (int recvpin) ;
/**
* Instantiate the IRrecv class. Multiple instantiation is not supported.
* @param recvpin Arduino pin to use, where a demodulating IR receiver is connected.
* @param blinkpin pin to blink when receiving IR. Not supported by all hardware. No sanity check is made.
*/
IRrecv (int recvpin, int blinkpin);
/**
* TODO: Why is this public???
* @param blinkflag
*/
void blink13 (int blinkflag) ;
/**
* Attempt to decode the recently receive IR signal
* @param results decode_results instance returning the decode, if any.
* @return success of operation. TODO: convert to bool
*/
int decode (decode_results *results) ;
/**
* Enable IR reception.
*/
void enableIRIn ( ) ;
/**
* Returns status of reception
* @return true if no reception is on-going.
*/
bool isIdle ( ) ;
/**
* Called to re-enable IR reception.
*/
void resume ( ) ;
private:
@@ -228,17 +186,10 @@ class IRrecv
//......................................................................
# if (DECODE_RC5 || DECODE_RC6)
/**
* This helper function is shared by RC5 and RC6
*/
// This helper function is shared by RC5 and RC6
int getRClevel (decode_results *results, int *offset, int *used, int t1) ;
# endif
# if DECODE_RC5
/**
* Try to decode the recently received IR signal as an RC5 signal-
* @param results decode_results instance returning the decode, if any.
* @return Success of the operation.
*/
bool decodeRC5 (decode_results *results) ;
# endif
# if DECODE_RC6
@@ -302,24 +253,13 @@ class IRrecv
# endif
} ;
/**
* Main class for sending IR
*/
//------------------------------------------------------------------------------
// Main class for sending IR
//
class IRsend
{
public:
#ifdef USE_SOFT_CARRIER
IRsend(int pin = SEND_PIN)
{
sendPin = pin;
}
#else
IRsend()
{
}
#endif
IRsend () { }
void custom_delay_usec (unsigned long uSecs);
void enableIROut (int khz) ;
@@ -330,7 +270,6 @@ class IRsend
//......................................................................
# if SEND_RC5
void sendRC5 (unsigned long data, int nbits) ;
void sendRC5ext (unsigned long addr, unsigned long cmd, boolean toggle);
# endif
# if SEND_RC6
void sendRC6 (unsigned long data, int nbits) ;
@@ -400,20 +339,6 @@ class IRsend
# if SEND_LEGO_PF
void sendLegoPowerFunctions (uint16_t data, bool repeat = true) ;
# endif
#ifdef USE_SOFT_CARRIER
private:
int sendPin;
unsigned int periodTime;
unsigned int periodOnTime;
void sleepMicros(unsigned long us);
void sleepUntilMicros(unsigned long targetTime);
#else
const int sendPin = SEND_PIN;
#endif
} ;
#endif

View File

@@ -3,6 +3,7 @@ These are the active contributors of this project that you may contact if there
- [z3t0](https://github.com/z3t0) : Active Contributor and currently also the main contributor.
* Email: zetoslab@gmail.com
* Skype: polarised16
- [shirriff](https://github.com/shirriff) : An amazing person who worked to create this awesome library and provide unending support
- [AnalysIR](https:/github.com/AnalysIR): Active contributor and is amazing with providing support!
- [Informatic](https://github.com/Informatic) : Active contributor
@@ -15,10 +16,7 @@ These are the active contributors of this project that you may contact if there
- [Sebazzz](https://github.com/sebazz): Contributor
- [lumbric](https://github.com/lumbric): Contributor
- [ElectricRCAircraftGuy](https://github.com/electricrcaircraftguy): Active Contributor
- [philipphenkel](https://github.com/philipphenkel): Active Contributor
- [henkel](https://github.com/henkel): Contributor
- [MCUdude](https://github.com/MCUdude): Contributor
- [marcmerlin](https://github.com/marcmerlin): Contributor (ESP32 port)
- [bengtmartensson](https://github.com/bengtmartensson): Active Contributor
- [MrBryonMiller](https://github.com/MrBryonMiller): Contributor
Note: This list is being updated constantly so please let [z3t0](https://github.com/z3t0) know if you have been missed.

2417
Doxyfile

File diff suppressed because it is too large Load Diff

View File

@@ -18,16 +18,14 @@
// Whynter A/C ARC-110WD added by Francesco Meschia
//******************************************************************************
#include <avr/interrupt.h>
// Defining IR_GLOBAL here allows us to declare the instantiation of global variables
#define IR_GLOBAL
#include "IRremote.h"
# include "AIRremote.h"
# include "IRremoteInt.h"
#undef IR_GLOBAL
#ifdef HAS_AVR_INTERRUPT_H
#include <avr/interrupt.h>
#endif
//+=============================================================================
// The match functions were (apparently) originally MACROs to improve code speed
// (although this would have bloated the code) hence the names being CAPS
@@ -51,12 +49,11 @@ int MATCH (int measured, int desired)
DBG_PRINT(TICKS_HIGH(desired), DEC);
bool passed = ((measured >= TICKS_LOW(desired)) && (measured <= TICKS_HIGH(desired)));
if (passed) {
if (passed)
DBG_PRINTLN(F("?; passed"));
} else {
DBG_PRINTLN(F("?; FAILED"));
}
return passed;
else
DBG_PRINTLN(F("?; FAILED"));
return passed;
}
//+========================================================
@@ -68,7 +65,7 @@ int MATCH_MARK (int measured_ticks, int desired_us)
DBG_PRINT(measured_ticks * USECPERTICK, DEC);
DBG_PRINT(F("us vs "));
DBG_PRINT(desired_us, DEC);
DBG_PRINT("us");
DBG_PRINT("us");
DBG_PRINT(": ");
DBG_PRINT(TICKS_LOW(desired_us + MARK_EXCESS) * USECPERTICK, DEC);
DBG_PRINT(F(" <= "));
@@ -78,12 +75,11 @@ int MATCH_MARK (int measured_ticks, int desired_us)
bool passed = ((measured_ticks >= TICKS_LOW (desired_us + MARK_EXCESS))
&& (measured_ticks <= TICKS_HIGH(desired_us + MARK_EXCESS)));
if (passed) {
if (passed)
DBG_PRINTLN(F("?; passed"));
} else {
DBG_PRINTLN(F("?; FAILED"));
}
return passed;
else
DBG_PRINTLN(F("?; FAILED"));
return passed;
}
//+========================================================
@@ -95,7 +91,7 @@ int MATCH_SPACE (int measured_ticks, int desired_us)
DBG_PRINT(measured_ticks * USECPERTICK, DEC);
DBG_PRINT(F("us vs "));
DBG_PRINT(desired_us, DEC);
DBG_PRINT("us");
DBG_PRINT("us");
DBG_PRINT(": ");
DBG_PRINT(TICKS_LOW(desired_us - MARK_EXCESS) * USECPERTICK, DEC);
DBG_PRINT(F(" <= "));
@@ -105,12 +101,11 @@ int MATCH_SPACE (int measured_ticks, int desired_us)
bool passed = ((measured_ticks >= TICKS_LOW (desired_us - MARK_EXCESS))
&& (measured_ticks <= TICKS_HIGH(desired_us - MARK_EXCESS)));
if (passed) {
if (passed)
DBG_PRINTLN(F("?; passed"));
} else {
DBG_PRINTLN(F("?; FAILED"));
}
return passed;
else
DBG_PRINTLN(F("?; FAILED"));
return passed;
}
//+=============================================================================
@@ -187,7 +182,6 @@ ISR (TIMER_INTR_NAME)
break;
}
#ifdef BLINKLED
// If requested, flash LED while receiving IR data
if (irparams.blinkflag) {
if (irdata == MARK)
@@ -196,5 +190,4 @@ ISR (TIMER_INTR_NAME)
else if (irparams.blinkpin) digitalWrite(irparams.blinkpin, LOW); // Turn user defined pin LED on
else BLINKLED_OFF() ; // if no user defined LED pin, turn default LED pin for the hardware on
}
#endif // BLINKLED
}

View File

@@ -18,9 +18,15 @@
#define IRremoteint_h
//------------------------------------------------------------------------------
// Include the Arduino header
// Include the right Arduino header
//
#include <Arduino.h>
#if defined(ARDUINO) && (ARDUINO >= 100)
# include <Arduino.h>
#else
# if !defined(IRPRONTO)
# include <WProgram.h>
# endif
#endif
//------------------------------------------------------------------------------
// This handles definition and access to global variables
@@ -34,22 +40,19 @@
//------------------------------------------------------------------------------
// Information for the Interrupt Service Routine
//
#define RAWBUF 101 ///< Maximum length of raw duration buffer. Must be odd.
#define RAWBUF 101 // Maximum length of raw duration buffer
/**
* This struct is used to communicate with the ISR (interrupt service routine).
*/
typedef
struct {
// The fields are ordered to reduce memory over caused by struct-padding
uint8_t rcvstate; ///< State Machine state
uint8_t recvpin; ///< Pin connected to IR data from detector
uint8_t rcvstate; // State Machine state
uint8_t recvpin; // Pin connected to IR data from detector
uint8_t blinkpin;
uint8_t blinkflag; ///< true -> enable blinking of pin on IR processing
uint8_t rawlen; ///< counter of entries in rawbuf
unsigned int timer; ///< State timer, counts 50uS ticks.
unsigned int rawbuf[RAWBUF]; ///< raw data
uint8_t overflow; ///< Raw buffer overflow occurred
uint8_t blinkflag; // true -> enable blinking of pin on IR processing
uint8_t rawlen; // counter of entries in rawbuf
unsigned int timer; // State timer, counts 50uS ticks.
unsigned int rawbuf[RAWBUF]; // raw data
uint8_t overflow; // Raw buffer overflow occurred
}
irparams_t;
@@ -60,11 +63,9 @@ irparams_t;
#define STATE_STOP 5
#define STATE_OVERFLOW 6
/**
* Allow all parts of the code access to the ISR data
* NB. The data can be changed by the ISR at any time, even mid-function
* Therefore we declare it as "volatile" to stop the compiler/CPU caching it
*/
// Allow all parts of the code access to the ISR data
// NB. The data can be changed by the ISR at any time, even mid-function
// Therefore we declare it as "volatile" to stop the compiler/CPU caching it
EXTERN volatile irparams_t irparams;
//------------------------------------------------------------------------------
@@ -84,12 +85,8 @@ EXTERN volatile irparams_t irparams;
// Pulse parameters in uSec
//
/**
* When received, marks tend to be too long and
* spaces tend to be too short.
* To compensate for this, MARK_EXCESS is subtracted from all marks,
* and added to all spaces.
*/
// Due to sensor lag, when received, Marks tend to be 100us too long and
// Spaces tend to be 100us too short
#define MARK_EXCESS 100
// Upper and Lower percentage tolerances in measurements

View File

@@ -5,7 +5,7 @@
**Code Block:**
```c
#include <IRremote.h>
#include <AIRremote.h>
.....
@@ -14,12 +14,8 @@
Use [a gist](gist.github.com) if the code exceeds 30 lines
**checklist:**
- [] I have **read** the README.md file thoroughly
- [] I have searched existing issues to see if there is anything I have missed.
- [] The latest [release](https://github.com/z3t0/Arduino-IRremote/releases/latest) is used
- [] Any code referenced is provided and if over 30 lines a gist is linked INSTEAD of it being pasted in here
- [] Any code referenced is provided
- [] The title of the issue is helpful and relevant
** We will start to close issues that do not follow these guidelines as it doesn't help the contributors who spend time trying to solve issues if the community ignores guidelines!**
The above is a short template allowing you to make detailed issues!
The above is a short template allowing you to make detailed issues!

View File

@@ -8,7 +8,7 @@ This library enables you to send and receive using infra-red signals on an Ardui
Tutorials and more information will be made available on [the official homepage](http://z3t0.github.io/Arduino-IRremote/).
## Version - 2.5.0b
## Version - 2.2.1
## Installation
1. Navigate to the [Releases](https://github.com/z3t0/Arduino-IRremote/releases) page.
@@ -17,12 +17,6 @@ Tutorials and more information will be made available on [the official homepage]
4. Move the "IRremote" folder that has been extracted to your libraries directory.
5. Make sure to delete Arduino_Root/libraries/RobotIRremote. Where Arduino_Root refers to the install directory of Arduino. The library RobotIRremote has similar definitions to IRremote and causes errors.
## FAQ
- IR does not work right when I use Neopixels (aka WS2811/WS2812/WS2812B)
Whether you use the Adafruit Neopixel lib, or FastLED, interrupts get disabled on many lower end CPUs like the basic arduinos. In turn, this stops the IR interrupt handler from running when it needs to. There are some solutions to this on some processors, [see this page from Marc MERLIN](http://marc.merlins.org/perso/arduino/post_2017-04-03_Arduino-328P-Uno-Teensy3_1-ESP8266-ESP32-IR-and-Neopixels.html)
## Supported Boards
- Arduino Uno / Mega / Leonardo / Duemilanove / Diecimila / LilyPad / Mini / Fio / Nano etc.
- Teensy 1.0 / 1.0++ / 2.0 / 2++ / 3.0 / 3.1 / Teensy-LC; Credits: @PaulStoffregen (Teensy Team)
@@ -31,8 +25,6 @@ Whether you use the Adafruit Neopixel lib, or FastLED, interrupts get disabled o
- ATmega8535, 16, 32, 164, 324, 644, 1284,
- ATmega64, 128
- ATtiny 84 / 85
- ESP32 (receive only)
- ESP8266 is supported in a fork based on an old codebase that isn't as recent, but it works reasonably well given that perfectly timed sub millisecond interrupts are different on that chip. See https://github.com/markszabo/IRremoteESP8266
We are open to suggestions for adding support to new boards, however we highly recommend you contact your supplier first and ask them to provide support from their side.
@@ -43,45 +35,24 @@ We are open to suggestions for adding support to new boards, however we highly r
| [ATtiny84](https://github.com/SpenceKonde/ATTinyCore) | **6** | **1** |
| [ATtiny85](https://github.com/SpenceKonde/ATTinyCore) | **1** | **TINY0** |
| [ATmega8](https://github.com/MCUdude/MiniCore) | **9** | **1** |
| Atmega32u4 | 5, **9**, 13 | 1, 3, **4** |
| Atmega32u4 | 5, 9, **13** | 1, 3, **4** |
| [ATmega48, ATmega88, ATmega168, ATmega328](https://github.com/MCUdude/MiniCore) | **3**, 9 | 1, **2** |
| [ATmega1284](https://github.com/MCUdude/MightyCore) | 13, 14, 6 | 1, **2**, 3 |
| [ATmega164, ATmega324, ATmega644](https://github.com/MCUdude/MightyCore) | 13, **14** | 1, **2** |
| [ATmega8535 ATmega16, ATmega32](https://github.com/MCUdude/MightyCore) | **13** | **1** |
| [ATmega64, ATmega128](https://github.com/MCUdude/MegaCore) | **13** | **1** |
| ATmega1280, ATmega2560 | 5, 6, **9**, 11, 46 | 1, **2**, 3, 4, 5 |
| [ESP32](http://esp32.net/) | N/A (not supported) | **1** |
| [Teensy 1.0](https://www.pjrc.com/teensy/) | **17** | **1** |
| [Teensy 2.0](https://www.pjrc.com/teensy/) | 9, **10**, 14 | 1, 3, **4_HS** |
| [Teensy++ 1.0 / 2.0](https://www.pjrc.com/teensy/) | **1**, 16, 25 | 1, **2**, 3 |
| [Teensy 3.0 / 3.1](https://www.pjrc.com/teensy/) | **5** | **CMT** |
| [Teensy-LC](https://www.pjrc.com/teensy/) | **16** | **TPM1** |
### Experimental patches
The following are strictly community supported patches that have yet to make it into mainstream. If you have issues feel free to ask here. If it works well then let us know!
[Arduino 101](https://github.com/z3t0/Arduino-IRremote/pull/481#issuecomment-311243146)
The table above lists the currently supported timers and corresponding send pins, many of these can have additional pins opened up and we are open to requests if a need arises for other pins.
## Usage
- TODO (Check examples for now)
## API documentation
This project documents the library API using [Doxygen](http://www.doxygen.org).
It is planned to make generated and up-to-date API documentation available online.
To generate the API documentation,
Doxygen, as well as [Graphviz](http://www.graphviz.org/) should be installed.
(Note that on Windows, it may be necessary to add the Graphviz binary directory
(something like `C:\Program Files\Graphviz2.38\bin`)
to the `PATH` variable manually.)
With Doxygen and Graphviz installed, issue the command
`doxygen` from the command line in the main project directory, which will
generate the API documentation in HTML format.
The just generated `api-doc/index.html` can now be opened in a browser.
## Contributing
If you want to contribute to this project:
- Report bugs and errors
@@ -94,7 +65,7 @@ Check [here](Contributing.md) for some guidelines.
## Contact
Email: zetoslab@gmail.com
Please only email me if it is more appropriate than creating an Issue / PR. I **will** not respond to requests for adding support for particular boards, unless of course you are the creator of the board and would like to cooperate on the project. I will also **ignore** any emails asking me to tell you how to implement your ideas. However, if you have a private inquiry that you would only apply to you and you would prefer it to be via email, by all means.
Please only email me if it is more appropriate than creating an Issue / PR. I **will** not respond to requests for adding support for particular boards, unless of course you are the creator of the board and would like to cooperate on the project. I will also **ignore** any emails asking me to tell you how to implement your ideas. However, if you have a private inquiry that you would only apply to you and you would prefer it to be via email, by all means.
## Contributors
Check [here](Contributors.md)

View File

@@ -0,0 +1,240 @@
{
"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":
{
}
}

View File

@@ -20,32 +20,6 @@
#ifndef boarddefs_h
#define boarddefs_h
// Define some defaults, that some boards may like to override
// (This is to avoid negative logic, ! DONT_... is just awkward.)
// This board has/needs the avr/interrupt.h
#define HAS_AVR_INTERRUPT_H
// Define if sending is supported
#define SENDING_SUPPORTED
// If defined, a standard enableIRIn function will be define.
// Undefine for boards supplying their own.
#define USE_DEFAULT_ENABLE_IR_IN
// Duty cycle in percent for sent signals. Presently takes effect only with USE_SOFT_CARRIER
#define DUTY_CYCLE 50
// If USE_SOFT_CARRIER, this amount (in micro seconds) is subtracted from the
// on-time of the pulses.
#define PULSE_CORRECTION 3
// digitalWrite is supposed to be slow. If this is an issue, define faster,
// board-dependent versions of these macros SENDPIN_ON(pin) and SENDPIN_OFF(pin).
// Portable, possibly slow, default definitions are given at the end of this file.
// If defining new versions, feel free to ignore the pin argument if it
// is not configurable on the current board.
//------------------------------------------------------------------------------
// Defines for blinking the LED
//
@@ -65,34 +39,9 @@
# define BLINKLED_ON() (PORTD |= B00000001)
# define BLINKLED_OFF() (PORTD &= B11111110)
#elif defined(ARDUINO_ARCH_SAM) || defined(ARDUINO_ARCH_SAMD)
# define BLINKLED LED_BUILTIN
# define BLINKLED_ON() (digitalWrite(LED_BUILTIN, HIGH))
# define BLINKLED_OFF() (digitalWrite(LED_BUILTIN, LOW))
# define USE_SOFT_CARRIER
// Define to use spin wait instead of delayMicros()
//# define USE_SPIN_WAIT
# undef USE_DEFAULT_ENABLE_IR_IN
// The default pin used used for sending.
# define SEND_PIN 9
#elif defined(ESP32)
// No system LED on ESP32, disable blinking by NOT defining BLINKLED
// avr/interrupt.h is not present
# undef HAS_AVR_INTERRUPT_H
// Sending not implemented
# undef SENDING_SUPPORTED
// Supply own enbleIRIn
# undef USE_DEFAULT_ENABLE_IR_IN
#else
# define BLINKLED 13
# define BLINKLED_ON() (PORTB |= B00100000)
#define BLINKLED_ON() (PORTB |= B00100000)
# define BLINKLED_OFF() (PORTB &= B11011111)
#endif
@@ -131,8 +80,8 @@
// Teensy 2.0
#elif defined(__AVR_ATmega32U4__)
//#define IR_USE_TIMER1 // tx = pin 14
#define IR_USE_TIMER3 // tx = pin 9
//#define IR_USE_TIMER4_HS // tx = pin 10
//#define IR_USE_TIMER3 // tx = pin 9
#define IR_USE_TIMER4_HS // tx = pin 10
// Teensy 3.0 / Teensy 3.1
#elif defined(__MK20DX128__) || defined(__MK20DX256__) || defined(__MK64FX512__) || defined(__MK66FX1M0__)
@@ -161,7 +110,7 @@
|| defined(__AVR_ATmega164P__)
//#define IR_USE_TIMER1 // tx = pin 13
#define IR_USE_TIMER2 // tx = pin 14
//MegaCore - ATmega64, ATmega128
#elif defined(__AVR_ATmega64__) || defined(__AVR_ATmega128__)
#define IR_USE_TIMER1 // tx = pin 13
@@ -176,21 +125,15 @@
// ATtiny84
#elif defined(__AVR_ATtiny84__)
#define IR_USE_TIMER1 // tx = pin 6
#define IR_USE_TIMER1 // tx = pin 6
//ATtiny85
#elif defined(__AVR_ATtiny85__)
#define IR_USE_TIMER_TINY0 // tx = pin 1
#define IR_USE_TIMER_TINY0 // tx = pin 1
#elif defined(ESP32)
#define IR_TIMER_USE_ESP32
#elif defined(ARDUINO_ARCH_SAM) || defined(ARDUINO_ARCH_SAMD)
#define TIMER_PRESCALER_DIV 64
#else
// Arduino Duemilanove, Diecimila, LilyPad, Mini, Fio, Nano, etc
// ATmega48, ATmega88, ATmega168, ATmega328
#else
//#define IR_USE_TIMER1 // tx = pin 9
#define IR_USE_TIMER2 // tx = pin 3
@@ -240,17 +183,17 @@
//-----------------
#if defined(CORE_OC2B_PIN)
# define SEND_PIN CORE_OC2B_PIN // Teensy
# define TIMER_PWM_PIN CORE_OC2B_PIN // Teensy
#elif defined(__AVR_ATmega1280__) || defined(__AVR_ATmega2560__)
# define SEND_PIN 9 // Arduino Mega
# define TIMER_PWM_PIN 9 // Arduino Mega
#elif defined(__AVR_ATmega1284__) || defined(__AVR_ATmega1284P__) \
|| defined(__AVR_ATmega644__) || defined(__AVR_ATmega644P__) \
|| defined(__AVR_ATmega324P__) || defined(__AVR_ATmega324A__) \
|| defined(__AVR_ATmega324PA__) || defined(__AVR_ATmega164A__) \
|| defined(__AVR_ATmega164P__)
# define SEND_PIN 14 // MightyCore
# define TIMER_PWM_PIN 14 // MightyCore
#else
# define SEND_PIN 3 // Arduino Duemilanove, Diecimila, LilyPad, etc
# define TIMER_PWM_PIN 3 // Arduino Duemilanove, Diecimila, LilyPad, etc
#endif // ATmega48, ATmega88, ATmega168, ATmega328
//---------------------------------------------------------
@@ -293,22 +236,22 @@
//-----------------
#if defined(CORE_OC1A_PIN)
# define SEND_PIN CORE_OC1A_PIN // Teensy
# define TIMER_PWM_PIN CORE_OC1A_PIN // Teensy
#elif defined(__AVR_ATmega1280__) || defined(__AVR_ATmega2560__)
# define SEND_PIN 11 // Arduino Mega
# define TIMER_PWM_PIN 11 // Arduino Mega
#elif defined(__AVR_ATmega64__) || defined(__AVR_ATmega128__)
# define SEND_PIN 13 // MegaCore
# define TIMER_PWM_PIN 13 // MegaCore
#elif defined(__AVR_ATmega1284__) || defined(__AVR_ATmega1284P__) \
|| defined(__AVR_ATmega644__) || defined(__AVR_ATmega644P__) \
|| defined(__AVR_ATmega324P__) || defined(__AVR_ATmega324A__) \
|| defined(__AVR_ATmega324PA__) || defined(__AVR_ATmega164A__) \
|| defined(__AVR_ATmega164P__) || defined(__AVR_ATmega32__) \
|| defined(__AVR_ATmega16__) || defined(__AVR_ATmega8535__)
# define SEND_PIN 13 // MightyCore
# define TIMER_PWM_PIN 13 // MightyCore
#elif defined(__AVR_ATtiny84__)
# define SEND_PIN 6
# define TIMER_PWM_PIN 6
#else
# define SEND_PIN 9 // Arduino Duemilanove, Diecimila, LilyPad, etc
# define TIMER_PWM_PIN 9 // Arduino Duemilanove, Diecimila, LilyPad, etc
#endif // ATmega48, ATmega88, ATmega168, ATmega328
//---------------------------------------------------------
@@ -340,11 +283,11 @@
//-----------------
#if defined(CORE_OC3A_PIN)
# define SEND_PIN CORE_OC3A_PIN // Teensy
# define TIMER_PWM_PIN CORE_OC3A_PIN // Teensy
#elif defined(__AVR_ATmega1280__) || defined(__AVR_ATmega2560__)
# define SEND_PIN 5 // Arduino Mega
# define TIMER_PWM_PIN 5 // Arduino Mega
#elif defined(__AVR_ATmega1284__) || defined(__AVR_ATmega1284P__)
# define SEND_PIN 6 // MightyCore
# define TIMER_PWM_PIN 6 // MightyCore
#else
# error "Please add OC3A pin number here\n"
#endif
@@ -388,9 +331,9 @@
//-----------------
#if defined(CORE_OC4A_PIN)
# define SEND_PIN CORE_OC4A_PIN // Teensy
# define TIMER_PWM_PIN CORE_OC4A_PIN // Teensy
#elif defined(__AVR_ATmega32U4__)
# define SEND_PIN 13 // Leonardo
# define TIMER_PWM_PIN 13 // Leonardo
#else
# error "Please add OC4A pin number here\n"
#endif
@@ -424,9 +367,9 @@
//-----------------
#if defined(CORE_OC4A_PIN)
# define SEND_PIN CORE_OC4A_PIN
# define TIMER_PWM_PIN CORE_OC4A_PIN
#elif defined(__AVR_ATmega1280__) || defined(__AVR_ATmega2560__)
# define SEND_PIN 6 // Arduino Mega
# define TIMER_PWM_PIN 6 // Arduino Mega
#else
# error "Please add OC4A pin number here\n"
#endif
@@ -460,9 +403,9 @@
//-----------------
#if defined(CORE_OC5A_PIN)
# define SEND_PIN CORE_OC5A_PIN
# define TIMER_PWM_PIN CORE_OC5A_PIN
#elif defined(__AVR_ATmega1280__) || defined(__AVR_ATmega2560__)
# define SEND_PIN 46 // Arduino Mega
# define TIMER_PWM_PIN 46 // Arduino Mega
#else
# error "Please add OC5A pin number here\n"
#endif
@@ -529,7 +472,7 @@
CMT_MSC = 0x03; \
})
#define SEND_PIN 5
#define TIMER_PWM_PIN 5
// defines for TPM1 timer on Teensy-LC
#elif defined(IR_USE_TIMER_TPM1)
@@ -559,7 +502,7 @@
FTM1_C0V = 0; \
FTM1_SC = FTM_SC_CLKS(1) | FTM_SC_PS(0) | FTM_SC_TOF | FTM_SC_TOIE; \
})
#define SEND_PIN 16
#define TIMER_PWM_PIN 16
// defines for timer_tiny0 (8 bits)
#elif defined(IR_USE_TIMER_TINY0)
@@ -593,46 +536,7 @@
})
#endif
#define SEND_PIN 1 /* ATtiny85 */
//---------------------------------------------------------
// ESP32 (ESP8266 should likely be added here too)
//
// ESP32 has it own timer API and does not use these macros, but to avoid ifdef'ing
// them out in the common code, they are defined to no-op. This allows the code to compile
// (which it wouldn't otherwise) but irsend will not work until ESP32 specific code is written
// for that -- merlin
// As a warning, sending timing specific code from an ESP32 can be challenging if you need 100%
// reliability because the arduino code may be interrupted and cause your sent waveform to be the
// wrong length. This is specifically an issue for neopixels which require 800Khz resolution.
// IR may just work as is with the common code since it's lower frequency, but if not, the other
// way to do this on ESP32 is using the RMT built in driver like in this incomplete library below
// https://github.com/ExploreEmbedded/ESP32_RMT
#elif defined(IR_TIMER_USE_ESP32)
#define TIMER_RESET
#ifdef ISR
# undef ISR
#endif
#define ISR(f) void IRTimer()
#elif defined(ARDUINO_ARCH_SAM) || defined(ARDUINO_ARCH_SAMD)
// use timer 3 hardcoded at this time
#define TIMER_RESET
#define TIMER_ENABLE_PWM // Not presently used
#define TIMER_DISABLE_PWM
#define TIMER_ENABLE_INTR NVIC_EnableIRQ(TC3_IRQn) // Not presently used
#define TIMER_DISABLE_INTR NVIC_DisableIRQ(TC3_IRQn)
#define TIMER_INTR_NAME TC3_Handler // Not presently used
#define TIMER_CONFIG_KHZ(f)
#ifdef ISR
# undef ISR
#endif
#define ISR(f) void irs()
#define TIMER_PWM_PIN 1 /* ATtiny85 */
//---------------------------------------------------------
// Unknown Timer
@@ -641,13 +545,4 @@
# error "Internal code configuration error, no known IR_USE_TIMER# defined\n"
#endif
// Provide default definitions, portable but possibly slower than necessary.
#ifndef SENDPIN_ON
#define SENDPIN_ON(pin) digitalWrite(pin, HIGH)
#endif
#ifndef SENDPIN_OFF
#define SENDPIN_OFF(pin) digitalWrite(pin, LOW)
#endif
#endif // ! boarddefs_h

View File

@@ -1,18 +1,3 @@
## 2.5.0
- Added Philips Extended RC-5 protocol support [PR #522] (https://github.com/z3t0/Arduino-IRremote/pull/522)
## 2.4.0 - 2017/08/10
- Cleanup of hardware dependencies. Merge in SAM support [PR #437](https://github.com/z3t0/Arduino-IRremote/pull/437)
## 2.3.3 - 2017/03/31
- Added ESP32 IR receive support [PR #427](https://github.com/z3t0/Arduino-IRremote/pull/425)
## 2.2.3 - 2017/03/27
- Fix calculation of pause length in LEGO PF protocol [PR #427](https://github.com/z3t0/Arduino-IRremote/pull/427)
## 2.2.2 - 2017/01/20
- Fixed naming bug [PR #398](https://github.com/z3t0/Arduino-IRremote/pull/398)
## 2.2.1 - 2016/07/27
- Added tests for Lego Power Functions Protocol [PR #336](https://github.com/z3t0/Arduino-IRremote/pull/336)

View File

@@ -6,7 +6,7 @@
* http://arcfn.com
*/
#include "IRremote.h"
#include "AIRremote.h"
#define POWER 0x7F80
#define AIWA_RC_T501

View File

@@ -15,7 +15,7 @@
* http://arcfn.com
*/
#include <IRremote.h>
#include <AIRremote.h>
int RECV_PIN = 11;
int BUTTON_PIN = 12;
@@ -126,7 +126,7 @@ void sendCode(int repeat) {
Serial.println(codeValue, HEX);
}
else if (codeType == JVC) {
irsend.sendJVC(codeValue, codeLen, false);
irsend.sendPanasonic(codeValue, codeLen);
Serial.print("Sent JVC");
Serial.println(codeValue, HEX);
}

View File

@@ -6,7 +6,7 @@
* http://arcfn.com
*/
#include <IRremote.h>
#include <AIRremote.h>
int RECV_PIN = 11;
@@ -17,11 +17,7 @@ decode_results results;
void setup()
{
Serial.begin(9600);
// In case the interrupt driver crashes on setup, give a clue
// to the user what's going on.
Serial.println("Enabling IRin");
irrecv.enableIRIn(); // Start the receiver
Serial.println("Enabled IRin");
}
void loop() {

View File

@@ -8,14 +8,14 @@
* LG added by Darryl Smith (based on the JVC protocol)
*/
#include <IRremote.h>
#include <AIRremote.h>
/*
* Default is Arduino pin D11.
* You can change this to another available Arduino Pin.
* Your IR receiver should be connected to the pin defined here
*/
int RECV_PIN = 11;
int RECV_PIN = 11;
IRrecv irrecv(RECV_PIN);

View File

@@ -1,7 +1,7 @@
//------------------------------------------------------------------------------
// Include the IRremote library header
//
#include <IRremote.h>
#include <AIRremote.h>
//------------------------------------------------------------------------------
// Tell IRremote which Arduino pin is connected to the IR Receiver (TSOP4838)
@@ -66,7 +66,7 @@ void dumpInfo (decode_results *results)
{
// Check if the buffer overflowed
if (results->overflow) {
Serial.println("IR code too long. Edit IRremoteInt.h and increase RAWBUF");
Serial.println("IR code too long. Edit IRremoteInt.h and increase RAWLEN");
return;
}

View File

@@ -6,7 +6,7 @@
* http://arcfn.com
*/
#include <IRremote.h>
#include <AIRremote.h>
int RECV_PIN = 11;
int RELAY_PIN = 4;

View File

@@ -11,7 +11,7 @@
*/
#include <IRremote.h>
#include <AIRremote.h>
void setup()
{
@@ -79,7 +79,7 @@ void dumpTIMER() {
void dumpTimerPin() {
Serial.print(F("IR Tx Pin: "));
Serial.println(SEND_PIN);
Serial.println(TIMER_PWM_PIN);
}
void dumpClock() {
@@ -224,7 +224,7 @@ void dumpFooter() {
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(" - AIRremote.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"));
}

View File

@@ -7,7 +7,7 @@
*/
#include <IRremote.h>
#include <AIRremote.h>
IRsend irsend;

View File

@@ -18,7 +18,7 @@
*/
#include <IRremote.h>
#include <AIRremote.h>
IRsend irsend;

View File

@@ -4,12 +4,13 @@
* Copyright 2009 Ken Shirriff
* http://arcfn.com
*
* Note: to run these tests, edit IRremote/IRremote.h to add "#define TEST"
* Note: to run these tests, edit IRremote/AIRremote.h to add "#define TEST"
* You must then recompile the library by removing IRremote.o and restarting
* the arduino IDE.
*/
#include <IRremote.h>
#include <AIRremote.h>
#include <IRremoteInt.h>
// Dumps out the decode_results structure.
// Call this after IRrecv::decode()

View File

@@ -25,7 +25,7 @@
* http://arcfn.com
*/
#include <IRremote.h>
#include <AIRremote.h>
int RECV_PIN = 11;
int LED_PIN = 3;

View File

@@ -6,7 +6,7 @@
* http://arcfn.com
* JVC and Panasonic protocol added by Kristian Lauszus (Thanks to zenwheel and other people at the original blog post)
*/
#include <IRremote.h>
#include <AIRremote.h>
#define PanasonicAddress 0x4004 // Panasonic address (Pre data)
#define PanasonicPower 0x100BCBD // Panasonic Power button

View File

@@ -1,4 +1,4 @@
#include <IRremote.h>
#include <AIRremote.h>
#include <Wire.h>

View File

@@ -3,7 +3,8 @@
* Copyright (c) 2016 Philipp Henkel
*/
#include <IRremote.h>
#include <AIRremote.h>
#include <IRremoteInt.h>
IRsend irsend;

View File

@@ -1,6 +1,6 @@
/*
* LegoPowerFunctionsTest: LEGO Power Functions Tests
* Copyright (c) 2016, 2017 Philipp Henkel
* Copyright (c) 2016 Philipp Henkel
*/
#include <ir_Lego_PF_BitStreamEncoder.h>
@@ -78,14 +78,14 @@ void testMessageBitCount(LegoPfBitStreamEncoder& bitStreamEncoder) {
logTestResult(bitCount == 18);
}
boolean check(LegoPfBitStreamEncoder& bitStreamEncoder, unsigned long markDuration, unsigned long pauseDuration) {
boolean check(LegoPfBitStreamEncoder& bitStreamEncoder, int markDuration, int pauseDuration) {
bool result = true;
result = result && bitStreamEncoder.getMarkDuration() == markDuration;
result = result && bitStreamEncoder.getPauseDuration() == pauseDuration;
return result;
}
boolean checkNext(LegoPfBitStreamEncoder& bitStreamEncoder, unsigned long markDuration, unsigned long pauseDuration) {
boolean checkNext(LegoPfBitStreamEncoder& bitStreamEncoder, int markDuration, int pauseDuration) {
bool result = bitStreamEncoder.next();
result = result && check(bitStreamEncoder, markDuration, pauseDuration);
return result;
@@ -129,16 +129,16 @@ void testMessage407Repeated(LegoPfBitStreamEncoder& bitStreamEncoder) {
bool result = true;
result = result && check(bitStreamEncoder, 158, 1026);
result = result && checkDataBitsOfMessage407(bitStreamEncoder);
result = result && checkNext(bitStreamEncoder, 158, 1026L + 5L * 16000L - 10844L);
result = result && checkNext(bitStreamEncoder, 158, 1026 + 5 * 16000 - 10844);
result = result && checkNext(bitStreamEncoder, 158, 1026);
result = result && checkDataBitsOfMessage407(bitStreamEncoder);
result = result && checkNext(bitStreamEncoder, 158, 1026L + 5L * 16000L - 10844L);
result = result && checkNext(bitStreamEncoder, 158, 1026 + 5 * 16000 - 10844);
result = result && checkNext(bitStreamEncoder, 158, 1026);
result = result && checkDataBitsOfMessage407(bitStreamEncoder);
result = result && checkNext(bitStreamEncoder, 158, 1026L + 8L * 16000L - 10844L);
result = result && checkNext(bitStreamEncoder, 158, 1026 + 8 * 16000 - 10844);
result = result && checkNext(bitStreamEncoder, 158, 1026);
result = result && checkDataBitsOfMessage407(bitStreamEncoder);
result = result && checkNext(bitStreamEncoder, 158, 1026L + 8L * 16000L - 10844L);
result = result && checkNext(bitStreamEncoder, 158, 1026 + 8 * 16000 - 10844);
result = result && checkNext(bitStreamEncoder, 158, 1026);
result = result && checkDataBitsOfMessage407(bitStreamEncoder);
result = result && checkNext(bitStreamEncoder, 158, 1026);
@@ -191,3 +191,7 @@ void testGetMessageLengthAllLow(LegoPfBitStreamEncoder& bitStreamEncoder) {
bitStreamEncoder.reset(0x0, false);
logTestResult(bitStreamEncoder.getMessageLength() == 9104);
}

View File

@@ -17,7 +17,7 @@
void mark (int t) { printf("+%d," , t); }
void space (int t) { printf("-%d, ", t); }
#else
# include "IRremote.h"
# include "AIRremote.h"
#endif // TEST
//+=============================================================================

View File

@@ -1,4 +1,5 @@
#include "IRremote.h"
#include "AIRremote.h"
#include "IRremoteInt.h"
//+=============================================================================
// Decodes the received IR message
@@ -114,10 +115,8 @@ IRrecv::IRrecv (int recvpin, int blinkpin)
//+=============================================================================
// initialization
//
#ifdef USE_DEFAULT_ENABLE_IR_IN
void IRrecv::enableIRIn ( )
{
// Interrupt Service Routine - Fires every 50uS
cli();
// Setup pulse clock timer interrupt
// Prescale /8 (16M/8 = 0.5 microseconds per tick)
@@ -139,17 +138,14 @@ void IRrecv::enableIRIn ( )
// Set pin modes
pinMode(irparams.recvpin, INPUT);
}
#endif // USE_DEFAULT_ENABLE_IR_IN
//+=============================================================================
// Enable/disable blinking of pin 13 on IR processing
//
void IRrecv::blink13 (int blinkflag)
{
#ifdef BLINKLED
irparams.blinkflag = blinkflag;
if (blinkflag) pinMode(BLINKLED, OUTPUT) ;
#endif
}
//+=============================================================================

View File

@@ -1,6 +1,6 @@
#include "IRremote.h"
#include "AIRremote.h"
#include "IRremoteInt.h"
#ifdef SENDING_SUPPORTED
//+=============================================================================
void IRsend::sendRaw (const unsigned int buf[], unsigned int len, unsigned int hz)
{
@@ -15,59 +15,14 @@ void IRsend::sendRaw (const unsigned int buf[], unsigned int len, unsigned in
space(0); // Always end with the LED off
}
#ifdef USE_SOFT_CARRIER
void inline IRsend::sleepMicros(unsigned long us)
{
#ifdef USE_SPIN_WAIT
sleepUntilMicros(micros() + us);
#else
if (us > 0U) // Is this necessary? (Official docu https://www.arduino.cc/en/Reference/DelayMicroseconds does not tell.)
delayMicroseconds((unsigned int) us);
#endif
}
void inline IRsend::sleepUntilMicros(unsigned long targetTime)
{
#ifdef USE_SPIN_WAIT
while (micros() < targetTime)
;
#else
unsigned long now = micros();
if (now < targetTime)
sleepMicros(targetTime - now);
#endif
}
#endif // USE_SOFT_CARRIER
//+=============================================================================
// Sends an IR mark for the specified number of microseconds.
// The mark output is modulated at the PWM frequency.
//
void IRsend::mark(unsigned int time)
void IRsend::mark (unsigned int time)
{
#ifdef USE_SOFT_CARRIER
unsigned long start = micros();
unsigned long stop = start + time;
if (stop + periodTime < start)
// Counter wrap-around, happens very seldomly, but CAN happen.
// Just give up instead of possibly damaging the hardware.
return;
unsigned long nextPeriodEnding = start;
unsigned long now = micros();
while (now < stop) {
SENDPIN_ON(sendPin);
sleepMicros(periodOnTime);
SENDPIN_OFF(sendPin);
nextPeriodEnding += periodTime;
sleepUntilMicros(nextPeriodEnding);
now = micros();
}
#else
TIMER_ENABLE_PWM; // Enable pin 3 PWM output
if (time > 0) custom_delay_usec(time);
#endif
}
//+=============================================================================
@@ -99,16 +54,11 @@ void IRsend::space (unsigned int time)
//
void IRsend::enableIROut (int khz)
{
#ifdef USE_SOFT_CARRIER
periodTime = (1000U + khz/2) / khz; // = 1000/khz + 1/2 = round(1000.0/khz)
periodOnTime = periodTime * DUTY_CYCLE / 100U - PULSE_CORRECTION;
#endif
// Disable the Timer2 Interrupt (which is used for receiving IR)
TIMER_DISABLE_INTR; //Timer2 Overflow Interrupt
pinMode(sendPin, OUTPUT);
SENDPIN_OFF(sendPin); // When not sending, we want it low
pinMode(TIMER_PWM_PIN, OUTPUT);
digitalWrite(TIMER_PWM_PIN, LOW); // When not sending PWM, we want it low
// COM2A = 00: disconnect OC2A
// COM2B = 00: disconnect OC2B; to send signal set to 10: OC2B non-inverted
@@ -135,4 +85,3 @@ void IRsend::custom_delay_usec(unsigned long uSecs) {
//}
}
#endif // SENDING_SUPPORTED

View File

@@ -1,4 +1,5 @@
#include "IRremote.h"
#include "AIRremote.h"
#include "IRremoteInt.h"
//==============================================================================
// AAA IIIII W W AAA

View File

@@ -1,4 +1,5 @@
#include "IRremote.h"
#include "AIRremote.h"
#include "IRremoteInt.h"
// Reverse Engineered by looking at RAW dumps generated by IRremote

View File

@@ -1,4 +1,5 @@
#include "IRremote.h"
#include "AIRremote.h"
#include "IRremoteInt.h"
//==============================================================================
// DDDD IIIII SSSS H H

View File

@@ -1,4 +1,5 @@
#include "IRremote.h"
#include "AIRremote.h"
#include "IRremoteInt.h"
//==============================================================================
// JJJJJ V V CCCC

View File

@@ -1,4 +1,5 @@
#include "IRremote.h"
#include "AIRremote.h"
#include "IRremoteInt.h"
//==============================================================================
// L GGGG

View File

@@ -1,4 +1,5 @@
#include "IRremote.h"
#include "AIRremote.h"
#include "IRremoteInt.h"
#include "ir_Lego_PF_BitStreamEncoder.h"
//==============================================================================

View File

@@ -4,7 +4,7 @@
// L E E O O
// L EEEE E EEE O O
// L E E E O O LEGO Power Functions
// LLLLLL EEEEEE EEEE OOOO Copyright (c) 2016, 2017 Philipp Henkel
// LLLLLL EEEEEE EEEE OOOO Copyright (c) 2016 Philipp Henkel
//==============================================================================
//+=============================================================================
@@ -14,25 +14,25 @@ class LegoPfBitStreamEncoder {
private:
uint16_t data;
bool repeatMessage;
uint8_t messageBitIdx;
uint8_t repeatCount;
uint16_t messageLength;
int messageBitIdx;
int repeatCount;
int messageLength;
public:
// HIGH data bit = IR mark + high pause
// LOW data bit = IR mark + low pause
static const uint16_t LOW_BIT_DURATION = 421;
static const uint16_t HIGH_BIT_DURATION = 711;
static const uint16_t START_BIT_DURATION = 1184;
static const uint16_t STOP_BIT_DURATION = 1184;
static const uint8_t IR_MARK_DURATION = 158;
static const uint16_t HIGH_PAUSE_DURATION = HIGH_BIT_DURATION - IR_MARK_DURATION;
static const uint16_t LOW_PAUSE_DURATION = LOW_BIT_DURATION - IR_MARK_DURATION;
static const uint16_t START_PAUSE_DURATION = START_BIT_DURATION - IR_MARK_DURATION;
static const uint16_t STOP_PAUSE_DURATION = STOP_BIT_DURATION - IR_MARK_DURATION;
static const uint8_t MESSAGE_BITS = 18;
static const uint16_t MAX_MESSAGE_LENGTH = 16000;
static const int LOW_BIT_DURATION = 421;
static const int HIGH_BIT_DURATION = 711;
static const int START_BIT_DURATION = 1184;
static const int STOP_BIT_DURATION = 1184;
static const int IR_MARK_DURATION = 158;
static const int HIGH_PAUSE_DURATION = HIGH_BIT_DURATION - IR_MARK_DURATION;
static const int LOW_PAUSE_DURATION = LOW_BIT_DURATION - IR_MARK_DURATION;
static const int START_PAUSE_DURATION = START_BIT_DURATION - IR_MARK_DURATION;
static const int STOP_PAUSE_DURATION = STOP_BIT_DURATION - IR_MARK_DURATION;
static const int MESSAGE_BITS = 18;
static const int MAX_MESSAGE_LENGTH = 16000;
public:
void reset(uint16_t data, bool repeatMessage) {
this->data = data;
this->repeatMessage = repeatMessage;
@@ -43,9 +43,9 @@ class LegoPfBitStreamEncoder {
int getChannelId() const { return 1 + ((data >> 12) & 0x3); }
uint16_t getMessageLength() const {
int getMessageLength() const {
// Sum up all marks
uint16_t length = MESSAGE_BITS * IR_MARK_DURATION;
int length = MESSAGE_BITS * IR_MARK_DURATION;
// Sum up all pauses
length += START_PAUSE_DURATION;
@@ -75,9 +75,9 @@ class LegoPfBitStreamEncoder {
}
}
uint8_t getMarkDuration() const { return IR_MARK_DURATION; }
int getMarkDuration() const { return IR_MARK_DURATION; }
uint32_t getPauseDuration() const {
int getPauseDuration() const {
if (messageBitIdx == 0)
return START_PAUSE_DURATION;
else if (messageBitIdx < MESSAGE_BITS - 1) {
@@ -88,13 +88,13 @@ class LegoPfBitStreamEncoder {
}
private:
uint16_t getDataBitPause() const {
int getDataBitPause() const {
const int pos = MESSAGE_BITS - 2 - messageBitIdx;
const bool isHigh = data & (1 << pos);
return isHigh ? HIGH_PAUSE_DURATION : LOW_PAUSE_DURATION;
}
uint32_t getStopPause() const {
int getStopPause() const {
if (repeatMessage) {
return getRepeatStopPause();
} else {
@@ -102,12 +102,12 @@ class LegoPfBitStreamEncoder {
}
}
uint32_t getRepeatStopPause() const {
int getRepeatStopPause() const {
if (repeatCount == 0 || repeatCount == 1) {
return STOP_PAUSE_DURATION + (uint32_t)5 * MAX_MESSAGE_LENGTH - messageLength;
return STOP_PAUSE_DURATION + 5 * MAX_MESSAGE_LENGTH - messageLength;
} else if (repeatCount == 2 || repeatCount == 3) {
return STOP_PAUSE_DURATION
+ (uint32_t)(6 + 2 * getChannelId()) * MAX_MESSAGE_LENGTH - messageLength;
+ (6 + 2 * getChannelId()) * MAX_MESSAGE_LENGTH - messageLength;
} else {
return STOP_PAUSE_DURATION;
}

View File

@@ -1,4 +1,5 @@
#include "IRremote.h"
#include "AIRremote.h"
#include "IRremoteInt.h"
//==============================================================================
// MMMMM IIIII TTTTT SSSS U U BBBB IIIII SSSS H H IIIII

View File

@@ -1,4 +1,5 @@
#include "IRremote.h"
#include "AIRremote.h"
#include "IRremoteInt.h"
//==============================================================================
// N N EEEEE CCCC

View File

@@ -1,4 +1,5 @@
#include "IRremote.h"
#include "AIRremote.h"
#include "IRremoteInt.h"
//==============================================================================
// PPPP AAA N N AAA SSSS OOO N N IIIII CCCC

View File

@@ -1,4 +1,5 @@
#include "IRremote.h"
#include "AIRremote.h"
#include "IRremoteInt.h"
//+=============================================================================
// Gets one undecoded level at a time from the raw buffer.
@@ -77,73 +78,6 @@ void IRsend::sendRC5 (unsigned long data, int nbits)
space(0); // Always end with the LED off
}
void IRsend::sendRC5ext (unsigned long addr, unsigned long cmd, boolean toggle)
{
// Set IR carrier frequency
enableIROut(36);
unsigned long addressBits = 5;
unsigned long commandBits = 7;
unsigned long nbits = addressBits + commandBits;
// Start
mark(RC5_T1);
// Bit #6 of the command part, but inverted!
unsigned long cmdBit6 = (1UL << (commandBits-1)) & cmd;
if (cmdBit6) {
// Inverted (1 -> 0 = mark-to-space)
mark(RC5_T1);
space(RC5_T1);
} else {
space(RC5_T1);
mark(RC5_T1);
}
commandBits--;
// Toggle bit
static int toggleBit = 1;
if (toggle) {
if (toggleBit == 0) {
toggleBit = 1;
} else {
toggleBit = 0;
}
}
if (toggleBit) {
space(RC5_T1);
mark(RC5_T1);
} else {
mark(RC5_T1);
space(RC5_T1);
}
// Address
for (unsigned long mask = 1UL << (addressBits - 1); mask; mask >>= 1) {
if (addr & mask) {
space(RC5_T1); // 1 is space, then mark
mark(RC5_T1);
} else {
mark(RC5_T1);
space(RC5_T1);
}
}
// Command
for (unsigned long mask = 1UL << (commandBits - 1); mask; mask >>= 1) {
if (cmd & mask) {
space(RC5_T1); // 1 is space, then mark
mark(RC5_T1);
} else {
mark(RC5_T1);
space(RC5_T1);
}
}
space(0); // Always end with the LED off
}
#endif
//+=============================================================================

View File

@@ -1,4 +1,5 @@
#include "IRremote.h"
#include "AIRremote.h"
#include "IRremoteInt.h"
//==============================================================================
// SSSS AAA MMM SSSS U U N N GGGG

View File

@@ -1,4 +1,5 @@
#include "IRremote.h"
#include "AIRremote.h"
#include "IRremoteInt.h"
//==============================================================================
// SSSS AAA N N Y Y OOO

View File

@@ -1,4 +1,5 @@
#include "IRremote.h"
#include "AIRremote.h"
#include "IRremoteInt.h"
//==============================================================================
// SSSS H H AAA RRRR PPPP

View File

@@ -1,4 +1,5 @@
#include "IRremote.h"
#include "AIRremote.h"
#include "IRremoteInt.h"
//==============================================================================
// SSSS OOO N N Y Y

View File

@@ -31,7 +31,7 @@ You have written the code to support your new protocol!
Now you must do a few things to add it to the IRremote system:
1. Open IRremote.h and make the following changes:
1. Open AIRremote.h and make the following changes:
REMEMEBER to change occurences of "SHUZU" with the name of your protocol
A. At the top, in the section "Supported Protocols", add:
@@ -91,7 +91,8 @@ Regards,
BlueChip
*/
#include "IRremote.h"
#include "AIRremote.h"
#include "IRremoteInt.h"
//==============================================================================
//

View File

@@ -1,4 +1,5 @@
#include "IRremote.h"
#include "AIRremote.h"
#include "IRremoteInt.h"
//==============================================================================
// W W H H Y Y N N TTTTT EEEEE RRRRR

View File

@@ -7,7 +7,7 @@
"type": "git",
"url": "https://github.com/z3t0/Arduino-IRremote.git"
},
"version": "2.4.0",
"version": "2.2.1",
"frameworks": "arduino",
"platforms": "atmelavr",
"authors" :

View File

@@ -1,9 +1,9 @@
name=IRremote
version=2.4.0
author=shirriff, z3t0
maintainer=z3t0
version=2.2.1
author=shirriff
maintainer=shirriff
sentence=Send and receive infrared signals with multiple protocols
paragraph=Find more information at https://github.com/z3t0/Arduino-IRremote
category=Communication
url=https://github.com/z3t0/Arduino-IRremote
paragraph=Send and receive infrared signals with multiple protocols
category=Signal Input/Output
url=https://github.com/shirriff/Arduino-IRremote.git
architectures=*

View File

@@ -1,38 +0,0 @@
#ifdef ESP32
// This file contains functions specific to the ESP32.
#include "IRremote.h"
// "Idiot check"
#ifdef USE_DEFAULT_ENABLE_IR_IN
#error Must undef USE_DEFAULT_ENABLE_IR_IN
#endif
hw_timer_t *timer;
void IRTimer(); // defined in IRremote.cpp, masqueraded as ISR(TIMER_INTR_NAME)
//+=============================================================================
// initialization
//
void IRrecv::enableIRIn ( )
{
// Interrupt Service Routine - Fires every 50uS
// ESP32 has a proper API to setup timers, no weird chip macros needed
// simply call the readable API versions :)
// 3 timers, choose #1, 80 divider nanosecond precision, 1 to count up
timer = timerBegin(1, 80, 1);
timerAttachInterrupt(timer, &IRTimer, 1);
// every 50ns, autoreload = true
timerAlarmWrite(timer, 50, true);
timerAlarmEnable(timer);
// Initialize state machine variables
irparams.rcvstate = STATE_IDLE;
irparams.rawlen = 0;
// Set pin modes
pinMode(irparams.recvpin, INPUT);
}
#endif // ESP32

View File

@@ -1,101 +0,0 @@
// Support routines for SAM processor boards
#include "IRremote.h"
#if defined(ARDUINO_ARCH_SAM) || defined(ARDUINO_ARCH_SAMD)
// "Idiot check"
#ifdef USE_DEFAULT_ENABLE_IR_IN
#error Must undef USE_DEFAULT_ENABLE_IR_IN
#endif
//+=============================================================================
// ATSAMD Timer setup & IRQ functions
//
// following based on setup from GitHub jdneo/timerInterrupt.ino
static void setTimerFrequency(int frequencyHz)
{
int compareValue = (SYSCLOCK / (TIMER_PRESCALER_DIV * frequencyHz)) - 1;
//Serial.println(compareValue);
TcCount16* TC = (TcCount16*) TC3;
// Make sure the count is in a proportional position to where it was
// to prevent any jitter or disconnect when changing the compare value.
TC->COUNT.reg = map(TC->COUNT.reg, 0, TC->CC[0].reg, 0, compareValue);
TC->CC[0].reg = compareValue;
//Serial.print("COUNT.reg ");
//Serial.println(TC->COUNT.reg);
//Serial.print("CC[0].reg ");
//Serial.println(TC->CC[0].reg);
while (TC->STATUS.bit.SYNCBUSY == 1);
}
static void startTimer()
{
REG_GCLK_CLKCTRL = (uint16_t) (GCLK_CLKCTRL_CLKEN | GCLK_CLKCTRL_GEN_GCLK0 | GCLK_CLKCTRL_ID_TCC2_TC3);
while (GCLK->STATUS.bit.SYNCBUSY == 1); // wait for sync
TcCount16* TC = (TcCount16*) TC3;
TC->CTRLA.reg &= ~TC_CTRLA_ENABLE;
while (TC->STATUS.bit.SYNCBUSY == 1); // wait for sync
// Use the 16-bit timer
TC->CTRLA.reg |= TC_CTRLA_MODE_COUNT16;
while (TC->STATUS.bit.SYNCBUSY == 1); // wait for sync
// Use match mode so that the timer counter resets when the count matches the compare register
TC->CTRLA.reg |= TC_CTRLA_WAVEGEN_MFRQ;
while (TC->STATUS.bit.SYNCBUSY == 1); // wait for sync
// Set prescaler to 1024
//TC->CTRLA.reg |= TC_CTRLA_PRESCALER_DIV1024;
TC->CTRLA.reg |= TC_CTRLA_PRESCALER_DIV64;
while (TC->STATUS.bit.SYNCBUSY == 1); // wait for sync
setTimerFrequency(1000000 / USECPERTICK);
// Enable the compare interrupt
TC->INTENSET.reg = 0;
TC->INTENSET.bit.MC0 = 1;
NVIC_EnableIRQ(TC3_IRQn);
TC->CTRLA.reg |= TC_CTRLA_ENABLE;
while (TC->STATUS.bit.SYNCBUSY == 1); // wait for sync
}
//+=============================================================================
// initialization
//
void IRrecv::enableIRIn()
{
// Interrupt Service Routine - Fires every 50uS
//Serial.println("Starting timer");
startTimer();
//Serial.println("Started timer");
// Initialize state machine variables
irparams.rcvstate = STATE_IDLE;
irparams.rawlen = 0;
// Set pin modes
pinMode(irparams.recvpin, INPUT);
}
void irs(); // Defined in IRRemote as ISR(TIMER_INTR_NAME)
void TC3_Handler(void)
{
TcCount16* TC = (TcCount16*) TC3;
// If this interrupt is due to the compare register matching the timer count
// we toggle the LED.
if (TC->INTFLAG.bit.MC0 == 1) {
TC->INTFLAG.bit.MC0 = 1;
irs();
}
}
#endif // defined(ARDUINO_ARCH_SAM) || defined(ARDUINO_ARCH_SAMD)