Skip to content

Commit 58bb87b

Browse files
committed
Documentation
1 parent 22451e7 commit 58bb87b

File tree

9 files changed

+90
-62
lines changed

9 files changed

+90
-62
lines changed

.github/workflows/LibraryBuild.yml

Lines changed: 8 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -51,8 +51,8 @@ jobs:
5151
- arduino:avr:leonardo
5252
- arduino:megaavr:nona4809:mode=off
5353
- megaTinyCore:megaavr:atxy4:chip=1604,clock=16internal
54-
- digistump:avr:digispark-tiny:clock=clock1
55-
- ATTinyCore:avr:attinyx5:chip=85,clock=1internal
54+
- digistump:avr:digispark-tiny:clock=clock16
55+
- ATTinyCore:avr:attinyx5micr:LTO=enable,sketchclock=16pll
5656
- TinyCore:avr:tiny32
5757
- arduino:samd:arduino_zero_native
5858
- MegaCore:avr:128:bootloader=no_bootloader,eeprom=keep,BOD=2v7,LTO=Os_flto,clock=8MHz_internal # ATmega128
@@ -106,26 +106,20 @@ jobs:
106106
platform-url: http://drazzy.com/package_drazzy.com_index.json
107107
sketches-exclude: MinimalReceiver,IRDispatcherDemo # digitalWriteFast.h not available for this board
108108

109-
- arduino-boards-fqbn: digistump:avr:digispark-tiny:clock=clock1
109+
- arduino-boards-fqbn: digistump:avr:digispark-tiny:clock=clock16
110110
platform-url: https://raw.githubusercontent.com/ArminJo/DigistumpArduino/master/package_digistump_index.json
111111
required-libraries: ATtinySerialOut
112-
sketches-exclude: UnitTest,ControlRelay,ReceiveAndSend,SendAndReceive,ReceiveDump,SendProntoDemo,SendBoseWaveDemo,MicroGirs,IRDispatcherDemo,SendLGAirConditionerDemo,ReceiverTimingAnalysis,IRremoteExtensionTest # Does not fit in FLASH or RAM, missing digitalPinToInterrupt
113-
build-properties: # the flags were put in compiler.cpp.extra_flags
114-
All: -DEXCLUDE_EXOTIC_PROTOCOLS -DEXCLUDE_UNIVERSAL_PROTOCOLS
112+
sketch-names: MinimalReceiver.ino,IRremoteInfo.ino,SimpleReceiver.ino,ReceiveDemo.ino,ControlRelay.ino,SimpleSender.ino,SendDemo.ino,SendRawDemo.ino,SendAndReceive.ino
115113

116114
- arduino-boards-fqbn: digistump:avr:MHETtiny88 # ATtiny88 China clone board @16 MHz
117115
platform-url: https://raw.githubusercontent.com/ArminJo/DigistumpArduino/master/package_digistump_index.json
118116
required-libraries: ATtinySerialOut
119-
sketches-exclude: UnitTest,ControlRelay,ReceiveAndSend,SendAndReceive,ReceiveDump,SendProntoDemo,SendBoseWaveDemo,MicroGirs,IRDispatcherDemo,SendLGAirConditionerDemo,ReceiverTimingAnalysis,IRremoteExtensionTest # Does not fit in FLASH or RAM, missing digitalPinToInterrupt
120-
build-properties: # the flags were put in compiler.cpp.extra_flags
121-
All: -DEXCLUDE_EXOTIC_PROTOCOLS -DEXCLUDE_UNIVERSAL_PROTOCOLS
117+
sketch-names: MinimalReceiver.ino,IRremoteInfo.ino,SimpleReceiver.ino,ReceiveDemo.ino,ControlRelay.ino,SimpleSender.ino,SendDemo.ino,SendRawDemo.ino,SendAndReceive.ino
122118

123-
- arduino-boards-fqbn: ATTinyCore:avr:attinyx5:chip=85,clock=1internal
119+
- arduino-boards-fqbn: ATTinyCore:avr:attinyx5micr:LTO=enable,sketchclock=16pll
124120
platform-url: http://drazzy.com/package_drazzy.com_index.json
125121
required-libraries: ATtinySerialOut
126-
sketches-exclude: UnitTest,ReceiveAndSend,ReceiveDump,SendProntoDemo,SendBoseWaveDemo,MicroGirs,IRDispatcherDemo,SendLGAirConditionerDemo,ReceiverTimingAnalysis # Does not fit in FLASH or RAM
127-
build-properties: # the flags were put in compiler.cpp.extra_flags
128-
All: -DEXCLUDE_EXOTIC_PROTOCOLS -DEXCLUDE_UNIVERSAL_PROTOCOLS
122+
sketch-names: MinimalReceiver.ino,IRremoteInfo.ino,SimpleReceiver.ino,ReceiveDemo.ino,ControlRelay.ino,SimpleSender.ino,SendDemo.ino,SendRawDemo.ino,SendAndReceive.ino
129123

130124
- arduino-boards-fqbn: TinyCore:avr:tiny32
131125
platform-url: https://raw.githubusercontent.com/xukangmin/TinyCore/master/avr/package/package_tinycore_index.json
@@ -177,5 +171,6 @@ jobs:
177171
arduino-platform: ${{ matrix.arduino-platform }}
178172
platform-url: ${{ matrix.platform-url }}
179173
required-libraries: ${{ matrix.required-libraries }}
174+
sketch-names: ${{ matrix.sketch-names }}
180175
sketches-exclude: ${{ matrix.sketches-exclude }}
181176
build-properties: ${{ toJson(matrix.build-properties) }}

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
# IRremote Arduino Library
22
Available as Arduino library "IRremote"
33

4-
### [Version 3.3.0](https://github.com/Arduino-IRremote/Arduino-IRremote/archive/master.zip) - work in progress
4+
### [Version 3.3.1](https://github.com/Arduino-IRremote/Arduino-IRremote/archive/master.zip) - work in progress
55

66
[![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT)
77
[![Commits since latest](https://img.shields.io/github/commits-since/Arduino-IRremote/Arduino-IRremote/latest)](https://github.com/Arduino-IRremote/Arduino-IRremote/commits/master)
@@ -180,7 +180,7 @@ Modify it by commenting them out or in, or change the values if applicable. Or d
180180
| `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`. |
181181
| `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. |
182182
| `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. |
183-
| `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. |
183+
| `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 650 bytes program space. |
184184
| `EXCLUDE_UNIVERSAL_PROTOCOLS` | Before `#include <IRremote.h>` | disabled | If activated, the universal decoder for pulse width or pulse distance protocols and decodeHash (special decoder for all protocols) are excluded in `decode()`. Saves up to 1000 bytes program space. |
185185
| `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. |
186186
| `RECORD_GAP_MICROS` | Before `#include <IRremote.h>` | 5000 | Minimum gap between IR transmissions, to detect the end of a protocol.<br/>Must be greater than any space of a protocol e.g. the NEC header space of 4500 us.<br/>Must be smaller than any gap between a command and a repeat; e.g. the retransmission gap for Sony is around 24 ms.<br/>Keep in mind, that this is the delay between the end of the received command and the start of decoding. |

changelog.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
# Changelog
22
The latest version may not be released!
3+
## 3.3.1
4+
35
## 3.3.0
46
- Fix errors if LED_BUILTIN is not defined.
57
- Fixed error for AVR timer1. Thanks to alexbarcelo.

examples/ControlRelay/ControlRelay.ino

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,10 @@
3333
*/
3434
#include <Arduino.h>
3535

36+
#if FLASHEND <= 0x1FFF // For 8k flash or less, like ATtiny85. Exclude exotic protocols.
37+
#define EXCLUDE_UNIVERSAL_PROTOCOLS // Saves up to 1000 bytes program space.
38+
#define EXCLUDE_EXOTIC_PROTOCOLS
39+
#endif
3640
/*
3741
* Define macros for input and output pin etc.
3842
*/
@@ -81,12 +85,18 @@ void loop() {
8185
Serial.println(F("off"));
8286
}
8387

88+
#if FLASHEND >= 0x3FFF // For 16k flash or more, like ATtiny1604
8489
IrReceiver.printIRResultShort(&Serial);
8590
Serial.println();
8691
if (IrReceiver.decodedIRData.protocol == UNKNOWN) {
8792
// We have an unknown protocol, print more info
8893
IrReceiver.printIRResultRawFormatted(&Serial, true);
8994
}
95+
#else
96+
// Print a minimal summary of received data
97+
IrReceiver.printIRResultMinimal(&Serial);
98+
Serial.println();
99+
#endif // FLASHEND
90100
}
91101
last = millis();
92102
IrReceiver.resume(); // Enable receiving of the next value

examples/ReceiveDemo/ReceiveDemo.ino

Lines changed: 15 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -38,16 +38,19 @@
3838
* If no protocol is defined, all protocols are active.
3939
* This must be done before the #include <IRremote.h>
4040
*/
41-
//#define DECODE_LG 1
42-
//#define DECODE_NEC 1
41+
//#define DECODE_LG
42+
//#define DECODE_NEC
4343
// etc. see IRremote.h
4444
//
4545
//#define DISABLE_LED_FEEDBACK_FOR_RECEIVE // saves 108 bytes program space
46-
#if FLASHEND <= 0x1FFF
46+
#if FLASHEND <= 0x1FFF // For 8k flash or less, like ATtiny85. Exclude exotic protocols.
4747
#define EXCLUDE_EXOTIC_PROTOCOLS
48-
#define EXCLUDE_UNIVERSAL_PROTOCOLS
48+
# if !defined(DIGISTUMPCORE) // ATTinyCore is bigger than Digispark core
49+
#define EXCLUDE_UNIVERSAL_PROTOCOLS // Saves up to 1000 bytes program space.
50+
# endif
4951
#endif
50-
//#define EXCLUDE_EXOTIC_PROTOCOLS // saves around 670 bytes program space if all other protocols are active
52+
//#define EXCLUDE_UNIVERSAL_PROTOCOLS // Saves up to 1000 bytes program space.
53+
//#define EXCLUDE_EXOTIC_PROTOCOLS // saves around 650 bytes program space if all other protocols are active
5154
//#define IR_MEASURE_TIMING
5255

5356
// MARK_EXCESS_MICROS is subtracted from all marks and added to all spaces before decoding,
@@ -78,7 +81,7 @@ void setup() {
7881
#if defined(IR_MEASURE_TIMING) && defined(IR_TIMING_TEST_PIN)
7982
pinMode(IR_TIMING_TEST_PIN, OUTPUT);
8083
#endif
81-
#if FLASHEND > 0x1FFF // For more than 8k flash. Code does not fit in program space of ATtiny85 etc.
84+
#if FLASHEND >= 0x3FFF // For 16k flash or more, like ATtiny1604. Code does not fit in program space of ATtiny85 etc.
8285
pinMode(DEBUG_BUTTON_PIN, INPUT_PULLUP);
8386
#endif
8487

@@ -105,7 +108,7 @@ void setup() {
105108
Serial.println(IR_RECEIVE_PIN);
106109
#endif
107110

108-
#if FLASHEND > 0x1FFF // For more than 8k flash. Code does not fit in program space of ATtiny85 etc.
111+
#if FLASHEND >= 0x3FFF // For 16k flash or more, like ATtiny1604. Code does not fit in program space of ATtiny85 etc.
109112
Serial.print(F("Debug button pin is "));
110113
Serial.println(DEBUG_BUTTON_PIN);
111114
#endif
@@ -128,10 +131,7 @@ void loop() {
128131
*/
129132
if (IrReceiver.decode()) {
130133
Serial.println();
131-
#if FLASHEND <= 0x1FFF // For less equal than 8k flash, like ATtiny85
132-
// Print a minimal summary of received data
133-
IrReceiver.printIRResultMinimal(&Serial);
134-
#else
134+
#if FLASHEND >= 0x3FFF // For 16k flash or more, like ATtiny1604
135135
if (IrReceiver.decodedIRData.flags & IRDATA_FLAGS_WAS_OVERFLOW) {
136136
IrReceiver.decodedIRData.flags = false; // yes we have recognized the flag :-)
137137
Serial.println(F("Overflow detected"));
@@ -167,7 +167,10 @@ void loop() {
167167
IrReceiver.start(8000); // to compensate for 8 ms stop of receiver. This enables a correct gap measurement.
168168
}
169169
# endif
170-
#endif // FLASHEND > 0x1FFF
170+
#else
171+
// Print a minimal summary of received data
172+
IrReceiver.printIRResultMinimal(&Serial);
173+
#endif // FLASHEND
171174

172175
/*
173176
* !!!Important!!! Enable receiving of the next value,

examples/SendAndReceive/SendAndReceive.ino

Lines changed: 16 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -32,12 +32,21 @@
3232

3333
#include <Arduino.h>
3434

35+
// select only NEC and the universal decoder for pulse width or pulse distance protocols
36+
#define DECODE_NEC // Includes Apple and Onkyo
37+
#define DECODE_DISTANCE
38+
3539
/*
3640
* Define macros for input and output pin etc.
3741
*/
3842
#include "PinDefinitionsAndMore.h"
3943

40-
//#define EXCLUDE_EXOTIC_PROTOCOLS // saves around 240 bytes program space if IrSender.write is used
44+
#if FLASHEND <= 0x1FFF // For 8k flash or less, like ATtiny85. Exclude exotic protocols.
45+
#define EXCLUDE_UNIVERSAL_PROTOCOLS // Saves up to 1000 bytes program space.
46+
#define EXCLUDE_EXOTIC_PROTOCOLS
47+
#endif
48+
//#define EXCLUDE_UNIVERSAL_PROTOCOLS // Saves up to 1000 bytes program space.
49+
//#define EXCLUDE_EXOTIC_PROTOCOLS
4150
//#define SEND_PWM_BY_TIMER
4251
//#define USE_NO_SEND_PWM
4352

@@ -77,19 +86,21 @@ void setup() {
7786
Serial.println(IR_SEND_PIN);
7887
#endif
7988

80-
#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
89+
#if FLASHEND >= 0x3FFF // For 16k flash or more, like ATtiny1604
90+
// For esp32 we use PWM generation by ledcWrite() for each pin.
91+
# if !defined(SEND_PWM_BY_TIMER) && !defined(USE_NO_SEND_PWM) && !defined(ESP32)
8192
/*
82-
* Print internal signal generation info
93+
* Print internal software PWM generation info
8394
*/
84-
IrSender.enableIROut(38);
85-
95+
IrSender.enableIROut(38); // Call it with 38 kHz to initialize the values printed below
8696
Serial.print(F("Send signal mark duration is "));
8797
Serial.print(IrSender.periodOnTimeMicros);
8898
Serial.print(F(" us, pulse correction is "));
8999
Serial.print(IrSender.getPulseCorrectionNanos());
90100
Serial.print(F(" ns, total period is "));
91101
Serial.print(IrSender.periodTimeMicros);
92102
Serial.println(F(" us"));
103+
# endif
93104

94105
// infos for receive
95106
Serial.print(RECORD_GAP_MICROS);

examples/SendDemo/SendDemo.ino

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -67,8 +67,7 @@ void setup() {
6767
/*
6868
* Print internal signal generation info
6969
*/
70-
IrSender.enableIROut(38);
71-
70+
IrSender.enableIROut(38); // Call it with 38 kHz to initialize the values printed below
7271
Serial.print(F("Send signal mark duration is "));
7372
Serial.print(IrSender.periodOnTimeMicros);
7473
Serial.print(F(" us, pulse correction is "));
@@ -115,7 +114,7 @@ void loop() {
115114
delay(DELAY_AFTER_SEND);
116115

117116
if (sRepeats == 0) {
118-
#if FLASHEND > 0x1FFF // For more than 8k flash. Code does not fit in program space of ATtiny85 etc.
117+
#if FLASHEND >= 0x3FFF // For 16k flash or more, like ATtiny1604. Code does not fit in program space of ATtiny85 etc.
119118
/*
120119
* Send constant values only once in this demo
121120
*/
@@ -211,7 +210,7 @@ void loop() {
211210
IrSender.sendRC6(sAddress, sCommand, sRepeats, true);
212211
delay(DELAY_AFTER_SEND);
213212

214-
#if FLASHEND > 0x1FFF // For more than 8k flash. Code does not fit in program space of ATtiny85 etc.
213+
#if FLASHEND >= 0x3FFF // For 16k flash or more, like ATtiny1604. Code does not fit in program space of ATtiny85 etc.
215214
/*
216215
* Next example how to use the IrSender.write function
217216
*/
@@ -255,7 +254,7 @@ void loop() {
255254
IrSender.sendLegoPowerFunctions(sAddress, sCommand, LEGO_MODE_COMBO, true);
256255
delay(DELAY_AFTER_SEND);
257256

258-
#endif // FLASHEND > 0x1FFF
257+
#endif // FLASHEND
259258
/*
260259
* Force buffer overflow
261260
*/

0 commit comments

Comments
 (0)