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
Copy file name to clipboardExpand all lines: README.md
+13-4Lines changed: 13 additions & 4 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -95,7 +95,7 @@ The new decoders for **NEC, Panasonic, Sony, Samsung and JVC** `IrReceiver.decod
95
95
If you read the first binary sequence backwards (right to left), you get the second sequence.
96
96
97
97
# FAQ
98
-
- IR does not work right when I use Neopixels (aka WS2811/WS2812/WS2812B) or other libraries blocking interrupts for a longer time (> 50 us).<br/>
98
+
- IR does not work right when I use **Neopixels** (aka WS2811/WS2812/WS2812B) or other libraries blocking interrupts for a longer time (> 50 us).<br/>
99
99
Whether you use the Adafruit Neopixel lib, or FastLED, interrupts get disabled on many lower end CPUs like the basic Arduinos for longer than 50 µs.
100
100
In turn, this stops the IR interrupt handler from running when it needs to. There are some solutions to this on some processors,
101
101
[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)
@@ -105,6 +105,7 @@ If you can live with the NEC protocol, you can try the MinimalReceiver example,
105
105
- You can use **multiple IR receiver** by just connecting the output pins of several IR receivers together.
106
106
The IR receivers use an NPN transistor as output device with just a 30k resistor to VCC.
107
107
This is almost "open collector" and allows connecting of several output pins to one Arduino input pin.
108
+
- The **minimal CPU frequency** for receiving is 4 MHz, since the 50 us timer ISR takes around 12 us on a 16 MHz ATmega.
108
109
109
110
# Minimal version
110
111
For applications only requiring NEC protocol, there is a receiver which has very **small codesize of 500 bytes and does NOT require any timer**. See the MinimalReceiver and IRDispatcherDemo example how to use it. Mapping of pins to interrupts can be found [here](https://github.com/Arduino-IRremote/Arduino-IRremote/tree/master/src/TinyIRReceiver.cpp.h#L307).
@@ -115,7 +116,14 @@ This library was never designed to handle long codes like the ones used by air c
115
116
See [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).<br/>
116
117
The main reason is, that it was designed to fit inside MCUs with relatively low levels of resources and was intended to work as a library together with other applications which also require some resources of the MCU to operate.
117
118
118
-
## Hints
119
+
## Protocol=UNKNOWN
120
+
If you see something like `Protocol=UNKNOWN Hash=0x13BD886C 35 bits received` as output of e.g. the ReceiveDemo example, you either have a problem with decoding a protocol, or an unsupported protocol.
121
+
122
+
- If you have an **odd number of bits** received, it is likely, that your receiver circuit has problems. Maybe because the IR signal is too weak.
123
+
- If you see timings like `+ 600,- 600 + 550,- 150 + 200,- 100 + 750,- 550` then one 450 µs space was split into two 150 and 100 µs spaces with a spike / error signal of 200 µs between. Maybe because of a defective receiver or a weak signal in conjunction with another light emitting source nearby.
124
+
- To see more info supporting you to find the reason for your UNKNOWN protocol, you must enable the line `//#define DEBUG` in IRremoteInt.h.
125
+
126
+
## How to deal with protocols not supported by IRremote
119
127
If you do not know which protocol your IR transmitter uses, you have several choices.
120
128
- Use the [IRreceiveDump example](examples/ReceiveDump) to dump out the IR timing.
121
129
You can then reproduce/send this timing with the [SendRawDemo example](examples/SendRawDemo).
@@ -127,11 +135,12 @@ If you do not know which protocol your IR transmitter uses, you have several cho
127
135
- Use [IrScrutinizer](http://www.harctoolbox.org/IrScrutinizer.html).
128
136
It can automatically generate a send sketch for your protocol by exporting as "Arduino Raw". It supports IRremote,
129
137
the old [IRLib](https://github.com/cyborg5/IRLib) and [Infrared4Arduino](https://github.com/bengtmartensson/Infrared4Arduino).
138
+
139
+
# Hints
130
140
- To **increase strength of sent output signal** you can increase the current through the send diode, and/or use 2 diodes in series,
131
141
since one IR diode requires only 1.5 volt.
132
142
- 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.
133
143
- 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`.
134
-
- Minimal CPU frequency for receiving is 4 MHz, since the 50 us timer ISR takes around 12 us on a 16 MHz ATmega.
135
144
136
145
# Examples
137
146
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.
@@ -143,7 +152,7 @@ This examples are a good starting point.
143
152
More complete examples for the advanced user.
144
153
145
154
### UnitTest
146
-
ReceiveDemo + SendDemo in one program. Receiving while sending.
155
+
ReceiveDemo + SendDemo in one program. **Receiving while sending**.
147
156
148
157
### ReceiveAndSend
149
158
Record and play back last received IR signal at button press.
#if FLASHEND > 0x1FFF && !defined(SEND_PWM_BY_TIMER) && !defined(USE_NO_SEND_PWM) && !defined(ESP32) // for esp32 we use PWM generation by ledcWrite() for each pin
0 commit comments