IRremote
IRremote.hpp File Reference

Public API to the library. More...

#include "IRVersion.h"
#include "IRremoteInt.h"
#include "digitalWriteFast.h"
#include "private/IRTimer.hpp"
#include "IRFeedbackLED.hpp"
#include "LongUnion.h"
#include "IRProtocol.hpp"
#include "IRReceive.hpp"
#include "IRSend.hpp"
#include "ir_BangOlufsen.hpp"
#include "ir_BoseWave.hpp"
#include "ir_Denon.hpp"
#include "ir_JVC.hpp"
#include "ir_Kaseikyo.hpp"
#include "ir_Lego.hpp"
#include "ir_LG.hpp"
#include "ir_MagiQuest.hpp"
#include "ir_NEC.hpp"
#include "ir_RC5_RC6.hpp"
#include "ir_Samsung.hpp"
#include "ir_Sony.hpp"
#include "ir_FAST.hpp"
#include "ir_Others.hpp"
#include "ir_Pronto.hpp"
#include <ir_DistanceWidthProtocol.hpp>
Include dependency graph for IRremote.hpp:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Macros

#define DECODE_DENON
 
#define DECODE_JVC
 
#define DECODE_KASEIKYO
 
#define DECODE_PANASONIC
 
#define DECODE_LG
 
#define DECODE_NEC
 
#define DECODE_SAMSUNG
 
#define DECODE_SONY
 
#define DECODE_RC5
 
#define DECODE_RC6
 
#define DECODE_BOSEWAVE
 
#define DECODE_LEGO_PF
 
#define DECODE_MAGIQUEST
 
#define DECODE_WHYNTER
 
#define DECODE_FAST
 
#define DECODE_DISTANCE_WIDTH
 
#define DECODE_HASH
 
#define MARK_EXCESS_MICROS   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 For Vishay TSOP*, marks tend to be too long and spaces tend to be too short. More...
 
#define RECORD_GAP_MICROS   8000
 Minimum gap between IR transmissions, to detect the end of a protocol. More...
 
#define RECORD_GAP_MICROS_WARNING_THRESHOLD   15000
 Threshold for warnings at printIRResult*() to report about changing the RECORD_GAP_MICROS value to a higher value. More...
 
#define RECORD_GAP_TICKS   (RECORD_GAP_MICROS / MICROS_PER_TICK)
 Minimum gap between IR transmissions, in MICROS_PER_TICK. More...
 
#define INPUT_MARK   0
 Sensor output for a mark ("flash") More...
 
#define PULSE_CORRECTION_NANOS   600
 Define to disable carrier PWM generation in software and use (restricted) hardware PWM. More...
 
#define IR_SEND_DUTY_CYCLE_PERCENT   30
 Duty cycle in percent for sent signals. More...
 
#define MICROS_PER_TICK   50L
 microseconds per clock interrupt tick More...
 
#define MILLIS_IN_ONE_SECOND   1000L
 
#define MICROS_IN_ONE_SECOND   1000000L
 
#define MICROS_IN_ONE_MILLI   1000L
 
#define RAWBUF   101
 Macros for legacy compatibility. More...
 
#define REPEAT   0xFFFFFFFF
 
#define USECPERTICK   MICROS_PER_TICK
 
#define MARK_EXCESS   MARK_EXCESS_MICROS
 

Detailed Description

Public API to the library.

!!! All the macro values defined here can be overwritten with values, !!!
!!! the user defines in its source code BEFORE the #include <IRremote.hpp> !!!

This file is part of Arduino-IRremote https://github.com/Arduino-IRremote/Arduino-IRremote.

MIT License

Copyright (c) 2015-2023 Ken Shirriff http://www.righto.com, Rafi Khan, Armin Joachimsmeyer

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

For Ken Shiriffs original blog entry, see http://www.righto.com/2009/08/multi-protocol-infrared-remote-library.html Initially influenced by: http://www.arduino.cc/cgi-bin/yabb2/YaBB.pl?num=1210243556 and http://zovirl.com/2008/11/12/building-a-universal-remote-with-an-arduino/

Definition in file IRremote.hpp.

Macro Definition Documentation

◆ DECODE_BOSEWAVE

#define DECODE_BOSEWAVE

Definition at line 109 of file IRremote.hpp.

◆ DECODE_DENON

#define DECODE_DENON

Definition at line 97 of file IRremote.hpp.

◆ DECODE_DISTANCE_WIDTH

#define DECODE_DISTANCE_WIDTH

Definition at line 117 of file IRremote.hpp.

◆ DECODE_FAST

#define DECODE_FAST

Definition at line 113 of file IRremote.hpp.

◆ DECODE_HASH

#define DECODE_HASH

Definition at line 118 of file IRremote.hpp.

◆ DECODE_JVC

#define DECODE_JVC

Definition at line 98 of file IRremote.hpp.

◆ DECODE_KASEIKYO

#define DECODE_KASEIKYO

Definition at line 99 of file IRremote.hpp.

◆ DECODE_LEGO_PF

#define DECODE_LEGO_PF

Definition at line 110 of file IRremote.hpp.

◆ DECODE_LG

#define DECODE_LG

Definition at line 101 of file IRremote.hpp.

◆ DECODE_MAGIQUEST

#define DECODE_MAGIQUEST

Definition at line 111 of file IRremote.hpp.

◆ DECODE_NEC

#define DECODE_NEC

Definition at line 102 of file IRremote.hpp.

◆ DECODE_PANASONIC

#define DECODE_PANASONIC

Definition at line 100 of file IRremote.hpp.

◆ DECODE_RC5

#define DECODE_RC5

Definition at line 105 of file IRremote.hpp.

◆ DECODE_RC6

#define DECODE_RC6

Definition at line 106 of file IRremote.hpp.

◆ DECODE_SAMSUNG

#define DECODE_SAMSUNG

Definition at line 103 of file IRremote.hpp.

◆ DECODE_SONY

#define DECODE_SONY

Definition at line 104 of file IRremote.hpp.

◆ DECODE_WHYNTER

#define DECODE_WHYNTER

Definition at line 112 of file IRremote.hpp.

◆ INPUT_MARK

#define INPUT_MARK   0

Sensor output for a mark ("flash")

Definition at line 185 of file IRremote.hpp.

◆ IR_SEND_DUTY_CYCLE_PERCENT

#define IR_SEND_DUTY_CYCLE_PERCENT   30

Duty cycle in percent for sent signals.

Definition at line 244 of file IRremote.hpp.

◆ MARK_EXCESS

#define MARK_EXCESS   MARK_EXCESS_MICROS

Definition at line 320 of file IRremote.hpp.

◆ MARK_EXCESS_MICROS

#define MARK_EXCESS_MICROS   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 For Vishay TSOP*, marks tend to be too long and spaces tend to be too short.

If you set MARK_EXCESS_MICROS to approx. 50us then the TSOP4838 works best. At 100us it also worked, but not as well. Set MARK_EXCESS to 100us and the VS1838 doesn't work at all.

The right value is critical for IR codes using short pulses like Denon / Sharp / Lego

Observed values: Delta of each signal type is around 50 up to 100 and at low signals up to 200. TSOP is better, especially at low IR signal level. VS1838 Mark Excess -50 at low intensity to +50 us at high intensity TSOP31238 Mark Excess 0 to +50

Definition at line 151 of file IRremote.hpp.

◆ MICROS_IN_ONE_MILLI

#define MICROS_IN_ONE_MILLI   1000L

Definition at line 256 of file IRremote.hpp.

◆ MICROS_IN_ONE_SECOND

#define MICROS_IN_ONE_SECOND   1000000L

Definition at line 255 of file IRremote.hpp.

◆ MICROS_PER_TICK

#define MICROS_PER_TICK   50L

microseconds per clock interrupt tick

Definition at line 251 of file IRremote.hpp.

◆ MILLIS_IN_ONE_SECOND

#define MILLIS_IN_ONE_SECOND   1000L

Definition at line 254 of file IRremote.hpp.

◆ PULSE_CORRECTION_NANOS

#define PULSE_CORRECTION_NANOS   600

Define to disable carrier PWM generation in software and use (restricted) hardware PWM.

Define to use no carrier PWM, just simulate an active low receiver signal. Define to use or simulate open drain output mode at send pin. Attention, active state of open drain is LOW, so connect the send LED between positive supply and send pin! This amount is subtracted from the on-time of the pulses generated for software PWM generation. It should be the time used for digitalWrite(sendPin, LOW) and the call to delayMicros() Measured value for Nano @16MHz is around 3000, for Bluepill @72MHz is around 700, for Zero 3600

Definition at line 236 of file IRremote.hpp.

◆ RAWBUF

#define RAWBUF   101

Macros for legacy compatibility.

Definition at line 317 of file IRremote.hpp.

◆ RECORD_GAP_MICROS

#define RECORD_GAP_MICROS   8000

Minimum gap between IR transmissions, to detect the end of a protocol.

Must be greater than any space of a protocol e.g. the NEC header space of 4500 us. Must be smaller than any gap between a command and a repeat; e.g. the retransmission gap for Sony is around 15 ms for Sony20 protocol. Keep in mind, that this is the delay between the end of the received command and the start of decoding.

Definition at line 163 of file IRremote.hpp.

◆ RECORD_GAP_MICROS_WARNING_THRESHOLD

#define RECORD_GAP_MICROS_WARNING_THRESHOLD   15000

Threshold for warnings at printIRResult*() to report about changing the RECORD_GAP_MICROS value to a higher value.

Definition at line 170 of file IRremote.hpp.

◆ RECORD_GAP_TICKS

#define RECORD_GAP_TICKS   (RECORD_GAP_MICROS / MICROS_PER_TICK)

Minimum gap between IR transmissions, in MICROS_PER_TICK.

Definition at line 174 of file IRremote.hpp.

◆ REPEAT

#define REPEAT   0xFFFFFFFF

Definition at line 318 of file IRremote.hpp.

◆ USECPERTICK

#define USECPERTICK   MICROS_PER_TICK

Definition at line 319 of file IRremote.hpp.