You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Protocols can be switched off and on by definining macros before the line `#incude <IRremote.h>` like [here](https://github.com/Arduino-IRremote/Arduino-IRremote/blob/master/examples/SimpleReceiver/SimpleReceiver.ino#L14):
22
+
Protocols can be switched off and on by defining macros before the line `#include <IRremote.h>` like [here](https://github.com/Arduino-IRremote/Arduino-IRremote/blob/master/examples/SimpleReceiver/SimpleReceiver.ino#L14):
This is a quite old but maybe useful wiki for this library.
32
32
33
+
# Features of the 3.x version
34
+
- You can use any pin for sending now, like you are used with receiving.
35
+
- Simultaneous sending and receiving. See the [UnitTest](https://github.com/Arduino-IRremote/Arduino-IRremote/blob/master/examples/UnitTest/UnitTest.ino#L165-L166) example.
36
+
- No more need to use 32 bit hex values in your code. Instead a (8 bit) command value is provided for decoding (as well as an 16 bit address and a protocol number).
37
+
- Protocol values comply to protocol standards, i.e. NEC, Panasonic, Sony, Samsung and JVC decode and send LSB first.
38
+
- Supports more protocols, since adding a protocol is quite easy now.
39
+
- Better documentation and more examples :-).
40
+
- Compatible with tone() library, see [ReceiveDemo](https://github.com/Arduino-IRremote/Arduino-IRremote/blob/master/examples/ReceiveDemo/ReceiveDemo.ino#L150-L153).
41
+
- Supports more platforms, since the new structure allows to easily add a new platform.
42
+
- Feedback LED also for sending.
43
+
- Ability to generate a non PWM signal to just simulate an active low receiver signal for direct connect to existent receiving devices without using IR.
44
+
- Easy configuration of protocols required, directly in your [source code[(https://github.com/Arduino-IRremote/Arduino-IRremote/blob/master/examples/SimpleReceiver/SimpleReceiver.ino#L18-L34). This reduces the memory footprint and increases decoding time.
45
+
33
46
# Converting your program to the 3.1 version
34
47
This must be done also for all versions > 3.0.1 if `USE_NO_SEND_PWM` is defined.<br/>
35
-
Starting with this version, **the generation of PWM is done by software**, thus saving the hardware timer and **enabling abitrary output pins**.<br/>
48
+
Starting with this version, **the generation of PWM is done by software**, thus saving the hardware timer and **enabling arbitrary output pins**.<br/>
36
49
Therefore you must change all `IrSender.begin(true);` by `IrSender.begin(IR_SEND_PIN, ENABLE_LED_FEEDBACK);`.
37
50
If you use a core that does not use the `-flto` flag for compile, you can activate the line `#define SUPPRESS_ERROR_MESSAGE_FOR_BEGIN` in IRRemote.h, if you get false error messages regarding begin() during compilation.
38
51
@@ -47,12 +60,33 @@ If you use a core that does not use the `-flto` flag for compile, you can activa
47
60
- Seldom used: `results.rawbuf` and `results.rawlen` must be replaced by `IrReceiver.decodedIRData.rawDataPtr->rawbuf` and `IrReceiver.decodedIRData.rawDataPtr->rawlen`.
48
61
49
62
# Running your 2.x program with the 3.x library version
50
-
- The `results.value` is not set by the new decoders and for **NEC, Panasonic, Sony, Samsung and JVC** the `IrReceiver.decodedIRData.decodedRawData` is now LSB-first, as the definition of these protocols suggests!<br/>
51
-
To use your **old MSB-first 32 bit IR data codes**, you must have `decode_results results` and call `decode(&results)` as in most old sources.
63
+
If you program is of style:
64
+
```
65
+
IRrecv irrecv(RECV_PIN);
66
+
decode_results results;
67
+
68
+
void setup()
69
+
{
70
+
...
71
+
irrecv.enableIRIn(); // Start the receiver
72
+
}
73
+
74
+
void loop() {
75
+
if (irrecv.decode(&results)) {
76
+
Serial.println(results.value, HEX);
77
+
...
78
+
irrecv.resume(); // Receive the next value
79
+
}
80
+
...
81
+
}
82
+
```
83
+
it should run on the 3.1.1 version as before. The following decoders are available: Denon, JVC, LG, NEC, Panasonic, RC5, RC6, Samsung, Sony.
84
+
The `results.value` is set by the decoders for **NEC, Panasonic, Sony, Samsung and JVC** as MSB first like in 2.x.<br/>
52
85
- The old functions `sendNEC()` and `sendJVC()` are deprecated and renamed to `sendNECMSB()` and `sendJVCMSB()` to make it clearer that they send data with MSB first, which is not the standard for NEC and JVC. Use them to send your **old MSB-first 32 bit IR data codes**.
53
86
In the new version you will send NEC commands not by 32 bit codes but by a (constant) 8 bit address and an 8 bit command.
54
87
55
88
# Convert old MSB first 32 bit IR data codes to new LSB first 32 bit IR data codes
89
+
The new decoders for **NEC, Panasonic, Sony, Samsung and JVC**`IrReceiver.decodedIRData.decodedRawData` is now LSB-first, as the definition of these protocols suggests!
56
90
To convert one into the other, you must reverse the byte positions and then reverse all bit positions of each byte or write it as one binary string and reverse/mirror it.<br/>
@@ -97,7 +131,7 @@ If you do not know which protocol your IR transmitter uses, you have several cho
97
131
since one IR diode requires only 1.5 volt.
98
132
- The line \#include "ATtinySerialOut.h" in PinDefinitionsAndMore.h (requires the library to be installed) saves 370 bytes program space and 38 bytes RAM for **Digispark boards** as well as enables serial output at 8MHz.
99
133
- The default software generated PWM has **problems on ATtinies running with 8 MHz**. The PWM frequency is around 30 instead of 38 kHz and RC6 is not reliable. You can switch to timer PWM generation by `#define SEND_PWM_BY_TIMER`.
100
-
- Minimal CPU frequency for receiving is 4 MHz, sive the 50 us timer ISR takes around 12 us on a 16 MHz ATmega.
134
+
- Minimal CPU frequency for receiving is 4 MHz, since the 50 us timer ISR takes around 12 us on a 16 MHz ATmega.
101
135
102
136
# Examples
103
137
In order to fit the examples to the 8K flash of ATtiny85 and ATtiny88, the [Arduino library ATtinySerialOut](https://github.com/ArminJo/ATtinySerialOut) is required for this CPU's.
@@ -129,13 +163,13 @@ Modify it by commenting them out or in, or change the values if applicable. Or d
129
163
130
164
| Name | File | Default value | Description |
131
165
|-|-|-|-|
132
-
|`SEND_PWM_BY_TIMER`| Before `#include <IRremote.h>`| disabled | Disable carrier PWM generation in software and use (restricted) hardware PWM ecxept for ESP32 where both modes are using the flexible `hw_timer_t`. |
166
+
|`SEND_PWM_BY_TIMER`| Before `#include <IRremote.h>`| disabled | Disable carrier PWM generation in software and use (restricted) hardware PWM except for ESP32 where both modes are using the flexible `hw_timer_t`. |
133
167
|`USE_NO_SEND_PWM`| Before `#include <IRremote.h>`| disabled | Use no carrier PWM, just simulate an active low receiver signal. Overrides `SEND_PWM_BY_TIMER` definition. |
134
168
|`NO_LEGACY_COMPATIBILITY`| IRremoteInt.h | disabled | Disables the old decoder for version 2.x compatibility, where all protocols -especially NEC, Panasonic, Sony, Samsung and JVC- were MSB first. Saves around 60 bytes program space and 14 bytes RAM. |
135
169
|`EXCLUDE_EXOTIC_PROTOCOLS`| Before `#include <IRremote.h>`| disabled | If activated, BOSEWAVE, MAGIQUEST,WHYNTER and LEGO_PF are excluded in `decode()` and in sending with `IrSender.write()`. Saves up to 900 bytes program space. |
136
170
|`MARK_EXCESS_MICROS`| Before `#include <IRremote.h>`| 20 | MARK_EXCESS_MICROS is subtracted from all marks and added to all spaces before decoding, to compensate for the signal forming of different IR receiver modules. |
137
171
|`FEEDBACK_LED_IS_ACTIVE_LOW`| Before `#include <IRremote.h>`| disabled | Required on some boards (like my BluePill and my ESP8266 board), where the feedback LED is active low. |
138
-
|`DISABLE_LED_FEEDBACK_FOR_RECEIVE`| Before `#include <IRremote.h>`| disabled | This disables the LED feedback code for receive, thus saving around 108 bytes program space and halving the receiver ISR processing time. |
172
+
|`DISABLE_LED_FEEDBACK_FOR_RECEIVE`| Before `#include <IRremote.h>`| disabled | This completely disables the LED feedback code for receive, thus saving around 108 bytes program space and halving the receiver ISR processing time. |
139
173
|`IR_INPUT_IS_ACTIVE_HIGH`| Before `#include <IRremote.h>`| disabled | Enable it if you use a RF receiver, which has an active HIGH output signal. |
140
174
|`RAW_BUFFER_LENGTH`| IRremoteInt.h | 101 | Buffer size of raw input buffer. Must be odd! |
@@ -180,7 +214,7 @@ The send PWM signal is by default generated by software. **Therefore every pin c
180
214
181
215
| Software generated PWM showing small jitter because of the limited resolution of 4 us of the Arduino core `micros()` function for an ATmega328 | Detail (ATmega328 generated) showing 33% Duty cycle |
Copy file name to clipboardExpand all lines: changelog.md
+3-3Lines changed: 3 additions & 3 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -39,6 +39,7 @@ The latest version may not be released!
39
39
- Fixed JVC repeat error.
40
40
41
41
## 3.0.0 + 3.0.1 2021/02
42
+
- New LSB first decoders are default.
42
43
- Added SendRaw with byte data.
43
44
- Fixed resume bug if irparams.rawlen >= RAW_BUFFER_LENGTH. Thanks to Iosif Peterfi
44
45
- Added `dumpPronto(String *aString, unsigned int frequency)` with String object as argument. Thanks to Iosif Peterfi
@@ -60,10 +61,9 @@ The latest version may not be released!
60
61
- Changed License to MIT see https://github.com/Arduino-IRremote/Arduino-IRremote/issues/397.
61
62
- Added ATtiny timer 1 support.
62
63
- Changed wrong return code signature of decodePulseDistanceData() and its handling.
63
-
- Removed Mitsubishi protocol, since the implementation is in contradiction with all documentation I could found and therefore supposed to be wrong.
64
-
- Removed AIWA implementation, since it is only for 1 device and at least sending implemented wrong.
64
+
- Removed Mitsubishi protocol, since the implementation is in contradiction with all documentation I found and therefore supposed to be wrong.
65
+
- Removed AIWA implementation, since it is only for 1 device and at least the sending was implemented wrong.
65
66
- Added Lego_PF decode.
66
-
- Added new example IR2Keyboard.
67
67
- Changed internal usage of custom_delay_usec.
68
68
- Moved dump/print functions from example to irReceiver.
69
69
- irPronto.cpp: Using Print instead of Stream saves 1020 bytes program memory. Changed from & to * parameter type to be more transparent and consistent with other code of IRremote.
0 commit comments