Skip to content

Commit ac60e45

Browse files
committed
Documentation
1 parent f7e949f commit ac60e45

File tree

7 files changed

+14
-44
lines changed

7 files changed

+14
-44
lines changed

README.md

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ Available as Arduino library "IRremote"
44
### [Version 2.7.0](https://github.com/z3t0/Arduino-IRremote/releases)
55

66
[![License: GPL v2](https://img.shields.io/badge/License-GPLv2-blue.svg)](https://www.gnu.org/licenses/gpl-2.0)
7+
[![Commits since latest](https://img.shields.io/github.amrom.workers.devmits-since/z3t0/Arduino-IRremote/latest)](https://github.com/z3t0/Arduino-IRremote/commits/master)
78
[![Installation instructions](https://www.ardu-badge.com/badge/IRremote.svg?)](https://www.ardu-badge.com/IRremote)
89
[![Join the chat at https://gitter.im/z3t0/Arduino-IRremote](https://badges.gitter.im/Join%20Chat.svg)](https://gitter.im/z3t0/Arduino-IRremote?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge)
910
[![LibraryBuild](https://github.com/z3t0/Arduino-IRremote/workflows/LibraryBuild/badge.svg)](https://github.com/z3t0/Arduino-IRremote/actions)
@@ -30,8 +31,10 @@ Protocols can be switched off and on by changing the lines in *IRremote.h*:
3031
#define SEND_<PROTOCOL_NAME> 1
3132
```
3233

33-
# Useful defines
34-
You may modify the behavior of the library by changing this values in the source code or just defining a new value for compile (the latter is not possible with the Arduino IDE, so consider to use [sloeber](https://eclipse.baeyens.it).
34+
# Compile options / macros for this library
35+
To customize the library to different requirements, there are some compile options / makros available.<br/>
36+
Modify it by commenting them out or in, or change the values if applicable. Or define the macro with the -D compiler option for gobal compile (the latter is not possible with the Arduino IDE, so consider to use [sloeber](https://eclipse.baeyens.it).
37+
3538
| Name | File | Default value | Description |
3639
|-|-|-|-|
3740
| `DEBUG` | IRremote.h | disabled | Enables lots of lovely debug output. |
@@ -53,12 +56,12 @@ The main reason is, that it was designed to fit inside MCUs with relatively low
5356
## Hints
5457
If you do not know which protocol your IR transmitter uses, you have several choices.
5558
- Use the [IRreceiveDumpV2 example](examples/IRreceiveDumpV2) to dump out the IR timing. You can then reproduce/send this timing with the [IRsendRawDemo example](examples/IRsendRawDemo). For **long codes** like from air conditioners, you can **change the length of the input buffer** in [IRremoteInt.h](src/private/IRremoteInt.h#L30).
56-
- If you have a bigger Arduino board at hand (> 100 kByte program space) you can try the [IRremoteDecode example](https://github.com/bengtmartensson/Arduino-DecodeIR/blob/master/examples/IRremoteDecode/IRremoteDecode.ino) of the Arduino library DecodeIR.
59+
- If you have a bigger Arduino board at hand (> 100 kByte program space) you can try the [IRremoteDecode example](https://github.com/bengtmartensson/Arduino-DecodeIR/blob/master/examples/IRremoteDecode/IRremoteDecode.ino) of the Arduino library [DecodeIR](https://github.com/bengtmartensson/Arduino-DecodeIR).
5760
- Use [IrScrutinizer](http://www.harctoolbox.org/IrScrutinizer.html). It can automatically generate a send sketch for your protocol by exporting as "Arduino Raw". It supports IRremote, the old [IRLib](https://github.com/cyborg5/IRLib) and [Infrared4Arduino](https://github.com/bengtmartensson/Infrared4Arduino).
58-
- Use the [IRMP AllProtocol example](https://github.com/ukw100/IRMP#allprotocol-example) and check the serial output if the protocol is one of the 40 supported protocols.
61+
- Use the [IRMP AllProtocol example](https://github.com/ukw100/IRMP#allprotocol-example) and you will see some serial output if the protocol is one of the 40 supported protocols.
5962

6063
## Other IR libraries
61-
[Here](https://github.com/ukw100/IRMP#quick-comparison-of-4-arduino-ir-receiving-libraries) you find a short comparison matrix of 4 popular Arduino IR libraries.<br/>
64+
[Here](https://github.com/ukw100/IRMP#quick-comparison-of-4-arduino-ir-receiving-libraries) you find a **short comparison matrix** of 4 popular Arduino IR libraries.<br/>
6265
[Here](https://github.com/crankyoldgit/IRremoteESP8266) you find an **ESP8266/ESP32** version of IRremote with an **[impressive list of supported protocols](https://github.com/crankyoldgit/IRremoteESP8266/blob/master/SupportedProtocols.md)**.
6366

6467
# Supported Boards

changelog.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
## 2.7.0 2020/09
22
- Added ATmega328PB support.
33
- Renamed hardware specific macro and function names.
4-
- Renamed `USE_SOFT_CARRIER` and `USE_NO_CARRIER` macros to `USE_SOFT_SEND_PWM` and `USE_NO_SEND_PWM`.
4+
- Renamed `USE_SOFT_CARRIER`, `USE_NO_CARRIER`, `DUTY_CYCLE` macros to `USE_SOFT_SEND_PWM`, `USE_NO_SEND_PWM`, `IR_SEND_DUTY_CYCLE`.
55
- Removed blocking wait for ATmega32U4 Serial in examples.
66
- Deactivated default debug output.
77
- Optimized types in sendRC5ext and sendSharpAlt.

src/IRremote.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -181,10 +181,10 @@ struct decode_results {
181181
unsigned int magnitude; ///< Used by MagiQuest [16-bits]
182182
bool isRepeat; ///< True if repeat of value is detected
183183

184-
// next 3 values are copies of irparams values
184+
// next 3 values are copies of irparams values - see IRremoteint.h
185185
unsigned int *rawbuf; ///< Raw intervals in 50uS ticks
186186
unsigned int rawlen; ///< Number of records in rawbuf
187-
bool overflow; ///< true if IR raw code too long
187+
bool overflow; ///< true if IR raw code too long
188188
};
189189

190190
/**

src/ir_Denon.cpp

Lines changed: 0 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -81,24 +81,6 @@ bool IRrecv::decodeDenon() {
8181

8282
// Read the bits in
8383
data = decodePulseDistanceData(DENON_BITS, offset, DENON_BIT_MARK, DENON_ONE_SPACE, DENON_ZERO_SPACE);
84-
// for (int i = 0; i < DENON_BITS; i++) {
85-
// // Each bit looks like: MARK + SPACE_1 -> 1
86-
// // or : MARK + SPACE_0 -> 0
87-
// if (!MATCH_MARK(results.rawbuf[offset], DENON_BIT_MARK)) {
88-
// return false;
89-
// }
90-
// offset++;
91-
//
92-
// // IR data is big-endian, so we shuffle it in from the right:
93-
// if (MATCH_SPACE(results.rawbuf[offset], DENON_ONE_SPACE)) {
94-
// data = (data << 1) | 1;
95-
// } else if (MATCH_SPACE(results.rawbuf[offset], DENON_ZERO_SPACE)) {
96-
// data = (data << 1) | 0;
97-
// } else {
98-
// return false;
99-
// }
100-
// offset++;
101-
// }
10284

10385
// Success
10486
results.bits = DENON_BITS;

src/ir_LG.cpp

Lines changed: 0 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -38,21 +38,6 @@ bool IRrecv::decodeLG() {
3838
offset++;
3939

4040
data = decodePulseDistanceData(LG_BITS, offset, LG_BIT_MARK, LG_ONE_SPACE, LG_ZERO_SPACE);
41-
// for (int i = 0; i < LG_BITS; i++) {
42-
// if (!MATCH_MARK(results.rawbuf[offset], LG_BIT_MARK)) {
43-
// return false;
44-
// }
45-
// offset++;
46-
//
47-
// if (MATCH_SPACE(results.rawbuf[offset], LG_ONE_SPACE)) {
48-
// data = (data << 1) | 1;
49-
// } else if (MATCH_SPACE(results.rawbuf[offset], LG_ZERO_SPACE)) {
50-
// data = (data << 1) | 0;
51-
// } else {
52-
// return false;
53-
// }
54-
// offset++;
55-
// }
5641

5742
// Stop bit
5843
if (!MATCH_MARK(results.rawbuf[offset], LG_BIT_MARK)) {

src/ir_NEC.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -113,7 +113,7 @@ void IRsend::sendNECStandard(uint16_t aAddress, uint8_t aCommand, uint8_t aNumbe
113113
#if DECODE_NEC
114114
bool IRrecv::decodeNEC() {
115115
long data = 0; // We decode in to here; Start with nothing
116-
int offset = 1; // Index in to results; Skip first entry!?
116+
int offset = 1; // Index in to results; Skip first space.
117117

118118
// Check header "mark"
119119
if (!MATCH_MARK(results.rawbuf[offset], NEC_HEADER_MARK)) {
@@ -163,7 +163,7 @@ bool IRrecv::decodeNEC(decode_results *aResults) {
163163
#if DECODE_NEC_STANDARD
164164
bool IRrecv::decodeNECStandard() {
165165
long data = 0; // We decode in to here; Start with nothing
166-
int offset = 1; // Index in to results; Skip first entry!?
166+
int offset = 1; // Index in to results; Skip first space.
167167

168168
// Check header "mark"
169169
if (!MATCH_MARK(results.rawbuf[offset], NEC_HEADER_MARK)) {

src/private/IRremoteInt.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ struct irparams_struct {
5151
uint8_t blinkflag; ///< true -> enable blinking of pin on IR processing
5252
unsigned int rawlen; ///< counter of entries in rawbuf
5353
unsigned int timer; ///< State timer, counts 50uS ticks.
54-
unsigned int rawbuf[RAW_BUFFER_LENGTH]; ///< raw data
54+
unsigned int rawbuf[RAW_BUFFER_LENGTH]; ///< raw data, first entry is the length of the gap between previous and current command
5555
uint8_t overflow; ///< Raw buffer overflow occurred
5656
};
5757

0 commit comments

Comments
 (0)