Skip to content

Commit

Permalink
Bumped version to 3.8.0
Browse files Browse the repository at this point in the history
  • Loading branch information
Armin committed Aug 6, 2022
1 parent 8d65b19 commit b00e0ee
Show file tree
Hide file tree
Showing 10 changed files with 97 additions and 64 deletions.
4 changes: 2 additions & 2 deletions Doxyfile
Original file line number Diff line number Diff line change
Expand Up @@ -307,7 +307,7 @@ OPTIMIZE_OUTPUT_SLICE = NO
# Note that for custom extensions you also need to set FILE_PATTERNS otherwise
# the files are not read by doxygen.

EXTENSION_MAPPING = ino=C++ cpp=C++ h=C++
EXTENSION_MAPPING = ino=C++ cpp=C++ h=C++ hpp=C++

# If the MARKDOWN_SUPPORT tag is enabled then doxygen pre-processes all comments
# according to the Markdown format, which allows for more readable
Expand Down Expand Up @@ -842,7 +842,7 @@ INPUT_ENCODING = UTF-8
# C comment), *.py, *.pyw, *.f90, *.f95, *.f03, *.f08, *.f18, *.f, *.for, *.vhd,
# *.vhdl, *.ucf, *.qsf and *.ice.

FILE_PATTERNS = *.ino *.cpp *.c *.h *.md
FILE_PATTERNS = *.ino *.cpp *.c *.h *.hpp *.md

# The RECURSIVE tag can be used to specify whether or not subdirectories should
# be searched for input files as well.
Expand Down
39 changes: 28 additions & 11 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,10 +15,8 @@ Available as [Arduino library "IRremote"](https://www.arduinolibraries.info/libr
- [API](https://github.com/Arduino-IRremote/Arduino-IRremote#api)
- [Installation](https://github.com/Arduino-IRremote/Arduino-IRremote#installation)
- [Supported IR Protocols](https://github.com/Arduino-IRremote/Arduino-IRremote#supported-ir-protocols)
- [Old Wiki](https://github.com/Arduino-IRremote/Arduino-IRremote#old-wiki)
- [Features of the 3.x version](https://github.com/Arduino-IRremote/Arduino-IRremote#features-of-the-3x-version)
* [Converting your 2.x program to the 3.x version](https://github.com/Arduino-IRremote/Arduino-IRremote#converting-your-2x-program-to-the-3x-version)
+ [Example](https://github.com/Arduino-IRremote/Arduino-IRremote#example)
* [Do not want to convert your 2.x program and use the 3.x library version?](https://github.com/Arduino-IRremote/Arduino-IRremote#do-not-want-to-convert-your-2x-program-and-use-the-3x-library-version)
* [How to convert old MSB first 32 bit IR data codes to new LSB first 32 bit IR data codes](https://github.com/Arduino-IRremote/Arduino-IRremote#how-to-convert-old-msb-first-32-bit-ir-data-codes-to-new-lsb-first-32-bit-ir-data-codes)
- [Errors with old tutorials and the 3.x versions](https://github.com/Arduino-IRremote/Arduino-IRremote#errors-with-old-tutorials-and-the-3x-versions)
Expand All @@ -40,6 +38,7 @@ Available as [Arduino library "IRremote"](https://www.arduinolibraries.info/libr
* [Protocol=UNKNOWN](https://github.com/Arduino-IRremote/Arduino-IRremote#protocolunknown)
* [How to deal with protocols not supported by IRremote](https://github.com/Arduino-IRremote/Arduino-IRremote#how-to-deal-with-protocols-not-supported-by-irremote)
- [Examples for this library](https://github.com/Arduino-IRremote/Arduino-IRremote#examples-for-this-library)
- [WOKWI online examples](https://github.com/Arduino-IRremote/Arduino-IRremote#wokwi-online-examples)
- [Issues and discussions](https://github.com/Arduino-IRremote/Arduino-IRremote#issues-and-discussions)
- [Compile options / macros for this library](https://github.com/Arduino-IRremote/Arduino-IRremote#compile-options--macros-for-this-library)
+ [Changing include (*.h) files with Arduino IDE](https://github.com/Arduino-IRremote/Arduino-IRremote#changing-include-h-files-with-arduino-ide)
Expand All @@ -53,14 +52,15 @@ Available as [Arduino library "IRremote"](https://www.arduinolibraries.info/libr
- [How we decode signals](https://github.com/Arduino-IRremote/Arduino-IRremote#how-we-decode-signals)
- [NEC encoding diagrams](https://github.com/Arduino-IRremote/Arduino-IRremote#nec-encoding-diagrams)
- [Quick comparison of 5 Arduino IR receiving libraries](https://github.com/Arduino-IRremote/Arduino-IRremote#quick-comparison-of-5-arduino-ir-receiving-libraries)
- [Useful links](https://github.com/Arduino-IRremote/Arduino-IRremote#useful-links)
- [Revision History](https://github.com/Arduino-IRremote/Arduino-IRremote#revision-history)
- [Contributing](https://github.com/Arduino-IRremote/Arduino-IRremote#contributing)
* [Adding new protocols](https://github.com/Arduino-IRremote/Arduino-IRremote#adding-new-protocols)
+ [Integration](https://github.com/Arduino-IRremote/Arduino-IRremote#integration)
+ [Creating API documentation](https://github.com/Arduino-IRremote/Arduino-IRremote#creating-api-documentation)
* [Contributors](https://github.com/Arduino-IRremote/Arduino-IRremote#contributors)
- [License](https://github.com/Arduino-IRremote/Arduino-IRremote#license)
* [Copyright](https://github.com/Arduino-IRremote/Arduino-IRremote#copyright)
- [Copyright](https://github.com/Arduino-IRremote/Arduino-IRremote#copyright)

# API
A Doxygen documentation of the sources is available on the [project homepage](https://arduino-irremote.github.io/Arduino-IRremote/classIRrecv.html).
Expand All @@ -78,9 +78,6 @@ Protocols can be switched off and on by defining macros before the line `#includ
#include <IRremote.hpp>
```

# [Old Wiki](https://github.com/Arduino-IRremote/Arduino-IRremote/wiki)
This is a quite old but maybe useful [wiki](https://github.com/Arduino-IRremote/Arduino-IRremote/wiki) for this library.

# Features of the 3.x version
- You can use any pin for sending now, like you are used with receiving.
- Simultaneous sending and receiving. See the [SendAndReceive](https://github.com/Arduino-IRremote/Arduino-IRremote/blob/master/examples/SendAndReceive/SendAndReceive.ino#L167-L170) example.
Expand Down Expand Up @@ -191,8 +188,9 @@ And now our problem with Arduino is: **How to set [compile options](#compile-opt
IDE's like [Sloeber](https://github.com/ArminJo/ServoEasing#modifying-compile-options--macros-with-sloeber-ide) or [PlatformIO](https://github.com/ArminJo/ServoEasing#modifying-compile-options--macros-with-platformio) support this by allowing to specify a set of options per project.
They add these options at each compiler call e.g. `-DTRACE`.<br/>
But Arduino lacks this feature. So the **workaround** is not to compile all sources separately, but to concatenate them to one huge source file by including them in your source.
This is done by e.g. `#include "ServoEasing.hpp"`.<br/>
But why not `#include "ServoEasing.cpp"`?<br/>
This is done by e.g. `#include "IRremote.hpp"`.
<br/>
But why not `#include "IRremote.cpp"`?<br/>
Try it and you will see tons of errors, because each function of the *.cpp file is now compiled twice,
first by compiling the huge file and second by compiling the *.cpp file separately, like described above.
So using the extension *cpp* is not longer possible, and one solution is to use *hpp* as extension, to show that it is an included *.cpp file.
Expand Down Expand Up @@ -319,6 +317,7 @@ In order to fit the examples to the 8K flash of ATtiny85 and ATtiny88, the [Ardu
### SimpleReceiver + SimpleSender
This examples are a good starting point.
A simple example can be tested online with [WOKWI](https://wokwi.com/projects/338611596994544210).
### ReceiveDemo
Receives all protocols and **generates a beep with the Arduino tone() function** on each packet received. By connecting pin 5 to ground, you can see the raw values for each packet. **Example how to use IRremote and tone() together**.
Expand Down Expand Up @@ -363,7 +362,9 @@ Example for a user defined class, which itself uses the IRrecv class from IRremo
Example for sending LG air conditioner IR codes controlled by Serial input.<br/>
By just using the function `bool Aircondition_LG::sendCommandAndParameter(char aCommand, int aParameter)` you can control the air conditioner by any other command source.<br/>
The file *acLG.h* contains the command documentation of the LG air conditioner IR protocol. Based on reverse engineering of the LG AKB73315611 remote.
![LG AKB73315611 remote](https://github.com/Arduino-IRremote/Arduino-IRremote/blob/master/pictures/LG_AKB73315611.jpg)
![LG AKB73315611 remote](https://github.com/Arduino-IRremote/Arduino-IRremote/blob/master/pictures/LG_AKB73315611.jpg)<br/>
IReceiverTimingAnalysis can be tested online with [WOKWI](https://wokwi.com/projects/299033930562011656)
Click on the receiver while simulation is running to specify individual IR codes.
### ReceiverTimingAnalysis
This example analyzes the signal delivered by your IR receiver module.
Expand All @@ -372,6 +373,12 @@ It also computes the `MARK_EXCESS_MICROS` value, which is the extension of the m
It can be tested online with [WOKWI](https://wokwi.com/arduino/projects/299033930562011656).
Click on the receiver while simulation is running to specify individual NEC IR codes.
# WOKWI online examples
- [Simple receiver] (https://wokwi.com/projects/338611596994544210).
- [MinimalReceiver](https://wokwi.com/arduino/projects/339264565653013075)
- [ReceiverTimingAnalysis](https://wokwi.com/projects/299033930562011656)
- [Receiver with LCD output and switch statement](https://wokwi.com/projects/298934082074575369)
# Issues and discussions
- Do not open an issue without first testing some of the examples!
- If you have a problem, please post the MCVE (Minimal Complete Verifiable Example) showing this problem. My experience is, that most of the times you will find the problem while creating this MCVE :smile:.
Expand Down Expand Up @@ -579,12 +586,22 @@ It is dated from **24.06.2022**. If you have complains about the data or request
| LED feedback | x | % | x | x | x | % |
| FLASH usage (simple NEC example with 5 prints) | 1820<br/>(4300 for 15 main / 8000 for all 40 protocols)<br/>(+200 for callback)<br/>(+80 for interrupt at pin 2+3)| 1270<br/>(1400 for pin 2+3) | 4830 | 1770 | **900** | ?1100? |
| RAM usage | 52<br/>(73 / 100 for 15 (main) / 40 protocols) | 62 | 334 | 227 | **19** | 29 |
| Supported platforms | **avr, megaAVR, attiny, Digispark (Pro), esp8266, ESP32, STM32, SAMD 21, Apollo3<br/>(plus arm and pic for non Arduino IDE)** | avr, esp8266 | avr, SAMD 21, SAMD 51 | avr, attiny, [esp8266](https://github.com/crankyoldgit/IRremoteESP8266), esp32, SAM, SAMD | **All platforms with attach<br/>Interrupt()** | **All platforms with attach<br/>Interrupt()** |
| Supported platforms | **avr, megaavr, attiny, Digispark (Pro), esp8266, ESP32, STM32, SAMD 21, Apollo3<br/>(plus arm and pic for non Arduino IDE)** | avr, esp8266 | avr, SAMD 21, SAMD 51 | avr, attiny, [esp8266](https://github.com/crankyoldgit/IRremoteESP8266), esp32, SAM, SAMD | **All platforms with attach<br/>Interrupt()** | **All platforms with attach<br/>Interrupt()** |
| Last library update | 6/2022 | 4/2018 | 3/2022 | 6/2022 | 6/2022 | 2/2022 |
| Remarks | Decodes 40 protocols concurrently.<br/>39 Protocols to send.<br/>Work in progress. | Only one protocol at a time. | Consists of 5 libraries. **Project containing bugs - 45 issues, no reaction for at least one year.** | Decoding and sending are easy to extend.<br/>Supports **Pronto** codes. | Requires no timer. | Requires no timer. |

\* The Hash protocol gives you a hash as code, which may be sufficient to distinguish your keys on the remote, but may not work with some protocols like Mitsubishi

# Useful links
- [List of public IR code databases](http://www.harctoolbox.org/IR-resources.html)
- [LIRC database](http://lirc-remotes.sourceforge.net/remotes-table.html)
- [IRMP list of IR protocols](https://www.mikrocontroller.net/articles/IRMP_-_english#IR_Protocols]
- [IR Remote Control Theory and some protocols (upper right hamburger icon)](https://www.sbprojects.net/knowledge/ir/)
- [Interpreting Decoded IR Signals (v2.45)](http://www.hifi-remote.com/johnsfine/DecodeIR.html)
- ["Recording long Infrared Remote control signals with Arduino"](https://www.analysir.com/blog/2014/03/19/air-conditioners-problems-recording-long-infrared-remote-control-signals-arduino)
- The original blog post of Ken Shirriff [A Multi-Protocol Infrared Remote Library for the Arduino](http://www.arcfn.com/2009/08/multi-protocol-infrared-remote-library.html)
- [Vishay datasheet](https://www.vishay.com/docs/80069/circuit.pdf)

# Revision History
Please see [changelog.md](https://github.com/Arduino-IRremote/Arduino-IRremote/blob/master/changelog.md).

Expand Down Expand Up @@ -630,7 +647,7 @@ Check [here](https://github.com/Arduino-IRremote/Arduino-IRremote/blob/master/Co
Up to the version 2.7.0, the License is GPLv2.
From the version 2.8.0, the license is the MIT license.

## Copyright
# Copyright
Initially coded 2009 Ken Shirriff http://www.righto.com<br/>
Copyright (c) 2016-2017 Rafi Khan<br/>
Copyright (c) 2020-2022 [Armin Joachimsmeyer](https://github.com/ArminJo)
2 changes: 1 addition & 1 deletion library.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
"type": "git",
"url": "https://github.com/z3t0/Arduino-IRremote.git"
},
"version": "3.7.1",
"version": "3.8.0",
"frameworks": "arduino",
"platforms": ["atmelavr", "atmelmegaavr", "atmelsam", "espressif8266", "espressif32", "ststm32"],
"authors" :
Expand Down
4 changes: 2 additions & 2 deletions library.properties
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
name=IRremote
version=3.7.1
version=3.8.0
author=shirriff, z3t0, ArminJo
maintainer=Armin Joachimsmeyer <[email protected]>
sentence=Send and receive infrared signals with multiple protocols
paragraph=Currently included protocols: Denon / Sharp, JVC, LG / LG2, NEC / Onkyo / Apple, Panasonic / Kaseikyo, RC5, RC6, Samsung, Sony, (Pronto), BoseWave, Lego, Whynter, MagiQuest.<br/><br/><b>New: </b>Minor improvements, changed types to fast ones and improved MagiQuest protocol.<br/><a href="https://github.com/Arduino-IRremote/Arduino-IRremote/blob/master/changelog.md">Release notes</a><br/>
paragraph=Currently included protocols: Denon / Sharp, JVC, LG / LG2, NEC / Onkyo / Apple, Panasonic / Kaseikyo, RC5, RC6, Samsung, Sony, (Pronto), BoseWave, Lego, Whynter, MagiQuest.<br/><br/><b>New: </b>Improvements and bug fixes. Added SAMD51 support.<br/><a href="https://github.com/Arduino-IRremote/Arduino-IRremote/blob/master/changelog.md">Release notes</a><br/>
category=Communication
url=https://github.com/Arduino-IRremote/Arduino-IRremote
architectures=avr,megaavr,samd,esp8266,esp32,stm32,STM32F1,mbed,mbed_nano,rp2040
Expand Down
25 changes: 19 additions & 6 deletions src/IRReceive.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,7 @@ IRrecv::IRrecv(uint_fast8_t aReceivePin) {
setLEDFeedback(0, DO_NOT_ENABLE_LED_FEEDBACK);
#endif
}

/**
* Instantiate the IRrecv class. Multiple instantiation is not supported.
* @param aReceivePin Arduino pin to use, where a demodulating IR receiver is connected.
Expand Down Expand Up @@ -136,13 +137,16 @@ void IRrecv::start() {
// Timer interrupt is enabled after state machine reset
TIMER_ENABLE_RECEIVE_INTR;
}
/**
* Alias for start().
*/
void IRrecv::enableIRIn() {
start();
}

/**
* Configures the timer and the state machine for IR reception.
* @param aMicrosecondsToAddToGapCounter To compensate for microseconds the timer was stopped / disabled.
* @param aMicrosecondsToAddToGapCounter To compensate for the amount of microseconds the timer was stopped / disabled.
*/
void IRrecv::start(uint32_t aMicrosecondsToAddToGapCounter) {
start();
Expand All @@ -166,9 +170,15 @@ void IRrecv::restartAfterSend() {
void IRrecv::stop() {
TIMER_DISABLE_RECEIVE_INTR;
}
/**
* Alias for stop().
*/
void IRrecv::disableIRIn() {
stop();
}
/**
* Alias for stop().
*/
void IRrecv::end() {
stop();
}
Expand Down Expand Up @@ -246,8 +256,8 @@ IRData* IRrecv::read() {

/**
* The main decode function, attempts to decode the recently receive IR signal.
* @return false if no IR receiver data available, true if data available. Results of decoding are stored in IrReceiver.decodedIRData.
* The set of decoders used is determined by active definitions of the DECODE_<PROTOCOL> macros.
* @return false if no IR receiver data available, true if data available. Results of decoding are stored in IrReceiver.decodedIRData.
*/
bool IRrecv::decode() {
if (irparams.StateForISR != IR_REC_STATE_STOP) {
Expand Down Expand Up @@ -498,8 +508,8 @@ bool IRrecv::decodePulseWidthData(uint_fast8_t aNumberOfBits, uint_fast8_t aStar
* Input is IrReceiver.decodedIRData.rawDataPtr->rawbuf[]
* Output is IrReceiver.decodedIRData.decodedRawData
*
* @param aStartOffset must point to a mark
* @return true if decoding was successful
* @param aStartOffset must point to a mark
* @return true if decoding was successful
*/
bool IRrecv::decodePulseDistanceData(uint_fast8_t aNumberOfBits, uint_fast8_t aStartOffset, unsigned int aBitMarkMicros,
unsigned int aOneSpaceMicros, unsigned int aZeroSpaceMicros, bool aMSBfirst) {
Expand Down Expand Up @@ -947,8 +957,10 @@ void IRrecv::printIRResultShort(Print *aSerial) {
* Ends with println().
*
* @param aSerial The Print object on which to write, for Arduino you can use &Serial.
* @param aIRDataPtr Pointer to the data to be printed.
* @param aPrintRepeatGap If true also print the gap before repeats.
*/
void printIRResultShort(Print *aSerial, IRData *aIRDataPtr, bool aPrintGap) {
void printIRResultShort(Print *aSerial, IRData *aIRDataPtr, bool aPrintRepeatGap) {
aSerial->print(F("Protocol="));
aSerial->print(getProtocolString(aIRDataPtr->protocol));
if (aIRDataPtr->protocol == UNKNOWN) {
Expand Down Expand Up @@ -997,7 +1009,7 @@ void printIRResultShort(Print *aSerial, IRData *aIRDataPtr, bool aPrintGap) {
aSerial->print(F("Auto-"));
}
aSerial->print(F("Repeat"));
if (aPrintGap) {
if (aPrintRepeatGap) {
aSerial->print(F(" gap="));
aSerial->print((uint32_t) aIRDataPtr->rawDataPtr->rawbuf[0] * MICROS_PER_TICK);
aSerial->print(F("us"));
Expand Down Expand Up @@ -1149,6 +1161,7 @@ void IRrecv::printIRResultMinimal(Print *aSerial) {
* Dump out the timings in IrReceiver.decodedIRData.rawDataPtr->rawbuf[] array 8 values per line.
*
* @param aSerial The Print object on which to write, for Arduino you can use &Serial.
* @param aOutputMicrosecondsInsteadOfTicks Output the (rawbuf_values * MICROS_PER_TICK) for better readability.
*/
void IRrecv::printIRResultRawFormatted(Print *aSerial, bool aOutputMicrosecondsInsteadOfTicks) {
// Print Raw data
Expand Down

0 comments on commit b00e0ee

Please sign in to comment.