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
+18-10Lines changed: 18 additions & 10 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -45,7 +45,7 @@ This is a quite old but maybe useful wiki for this library.
45
45
46
46
47
47
# Converting your 2.x program to the 3.x version
48
-
Starting with the 3.1 version, **the generation of PWM is done by software**, thus saving the hardware timer and **enabling arbitrary output pins**.<br/>
48
+
Starting with the 3.1 version, **the generation of PWM for sending is done by software**, thus saving the hardware timer and **enabling arbitrary output pins for sending**.<br/>
49
49
If you use an (old) Arduino 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.
50
50
51
51
- Now there is an **IRreceiver** and **IRsender** object like the well known Arduino **Serial** object.
@@ -160,8 +160,11 @@ ReceiveDemo + SendDemo in one program. **Receiving while sending**.
160
160
### ReceiveAndSend
161
161
Record and play back last received IR signal at button press.
162
162
163
-
### MinimalReceiver + SmallReceiver
164
-
If code size matters, look at these examples.<br/>
163
+
### SmallReceiver
164
+
If code size matters, look at these example.<br/>
165
+
166
+
### MinimalReceiver
167
+
The MinimalReceiver example uses the **TinyReceiver** library which can **only receive NEC codes, but does not require any timer**.<br/>
165
168
MinimalReceiver can be tested online with [WOKWI](https://wokwi.com/arduino/projects/299034264157028877).
166
169
Click on the receiver while simulation is running to specify individual IR codes.
167
170
@@ -228,16 +231,19 @@ Digispark boards are tested with the recommended [ATTinyCore](https://github.com
228
231
- ATtiny84, 85, 167 (Digispark + Digispark Pro)
229
232
- SAMD (Zero, MKR*, **but not DUE, which is SAM architecture**)
230
233
- ESP32
231
-
- ESP8266. [This fork](https://github.com/crankyoldgit/IRremoteESP8266) supports an [impressive set of protocols](https://github.com/crankyoldgit/IRremoteESP8266/blob/master/SupportedProtocols.md).
234
+
- ESP8266. [This fork](https://github.com/crankyoldgit/IRremoteESP8266) supports an [impressive set of protocols and a lot of air conditioners](https://github.com/crankyoldgit/IRremoteESP8266/blob/master/SupportedProtocols.md).
232
235
- Sparkfun Pro Micro
233
236
- Nano Every, Uno WiFi Rev2, nRF5 BBC MicroBit, Nano33_BLE
234
237
235
238
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.
236
239
237
240
# Timer and pin usage
238
-
The receiver sample interval is generated by a timer. On many boards this must be a hardware timer, on some a software timer is available and used. The code for the timer and the timer selection is located in [private/IRTimer.cpp.h](https://github.com/Arduino-IRremote/Arduino-IRremote/blob/master/src/private/IRTimer.cpp.h).<br/>
241
+
The **receiver sample interval is generated by a timer**. On many boards this must be a hardware timer, on some, where a software timer is available, it is used. The code for the timer and the **timer selection** is located in [private/IRTimer.cpp.h](https://github.com/Arduino-IRremote/Arduino-IRremote/blob/master/src/private/IRTimer.cpp.h).<br/>
242
+
**Be aware that the hardware timer used for receiving is also used for analogWrite()!** E.g. <br/>
243
+
The MinimalReceiver example uses the **TinyReceiver** library which can **only receive NEC codes, but does not require any timer**.<br/>
239
244
Every pin can be used for receiving.<br/>
240
-
The send PWM signal is by default generated by software. **Therefore every pin can be used for sending**. The PWM pulse length is guaranteed to be constant by using `delayMicroseconds()`. Take care not to generate interrupts during sending with software generated PWM, otherwise you will get jitter in the generated PWM. E.g. wait for a former `Serial.print()` statement to be finished by `Serial.flush()`. Since the Arduino `micros()` function has a resolution of 4 us at 16 MHz, we always see a small jitter in the signal, which seems to be OK for the receivers.
245
+
246
+
The **send PWM signal** is by default generated by software. **Therefore every pin can be used for sending**. The PWM pulse length is guaranteed to be constant by using `delayMicroseconds()`. Take care not to generate interrupts during sending with software generated PWM, otherwise you will get jitter in the generated PWM. E.g. wait for a former `Serial.print()` statement to be finished by `Serial.flush()`. Since the Arduino `micros()` function has a resolution of 4 us at 16 MHz, we always see a small jitter in the signal, which seems to be OK for the receivers.
241
247
242
248
| 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 |
243
249
|-|-|
@@ -248,13 +254,15 @@ If you define `SEND_PWM_BY_TIMER`, the send PWM signal is generated by a hardwar
248
254
Since each hardware timer has its dedicated output pins, you must change timer to change PWN output.<br/>
249
255
The timer and the pin usage can be adjusted in [private/IRTimer.cpp.h](https://github.com/Arduino-IRremote/Arduino-IRremote/blob/master/src/private/IRTimer.cpp.h)
0 commit comments