IRremote
IRsend Class Reference

Main class for sending IR signals. More...

#include <IRremoteInt.h>

Public Member Functions

 IRsend ()
 
 IRsend (uint_fast8_t aSendPin)
 
void begin (uint_fast8_t aSendPin)
 Initializes the send pin and enable LED feedback with board specific FEEDBACK_LED_ON() and FEEDBACK_LED_OFF() functions. More...
 
void setSendPin (uint_fast8_t aSendPin)
 
void begin (uint_fast8_t aSendPin, bool aEnableLEDFeedback, uint_fast8_t aFeedbackLEDPin)
 Initializes the send and feedback pin. More...
 
size_t write (IRData *aIRSendData, int_fast8_t aNumberOfRepeats=NO_REPEATS)
 Interprets and sends a IRData structure. More...
 
size_t write (decode_type_t aProtocol, uint16_t aAddress, uint16_t aCommand, int_fast8_t aNumberOfRepeats=NO_REPEATS)
 Simple version of write without support for MAGIQUEST and numberOfBits for SONY protocol. More...
 
void enableIROut (uint_fast8_t aFrequencyKHz)
 Enables IR output. More...
 
void sendPulseDistanceWidthFromArray (uint_fast8_t aFrequencyKHz, uint16_t aHeaderMarkMicros, uint16_t aHeaderSpaceMicros, uint16_t aOneMarkMicros, uint16_t aOneSpaceMicros, uint16_t aZeroMarkMicros, uint16_t aZeroSpaceMicros, IRRawDataType *aDecodedRawDataArray, uint16_t aNumberOfBits, uint8_t aFlags, uint16_t aRepeatPeriodMillis, int_fast8_t aNumberOfRepeats)
 
void sendPulseDistanceWidthFromArray (uint_fast8_t aFrequencyKHz, uint16_t aHeaderMarkMicros, uint16_t aHeaderSpaceMicros, uint16_t aOneMarkMicros, uint16_t aOneSpaceMicros, uint16_t aZeroMarkMicros, uint16_t aZeroSpaceMicros, IRRawDataType *aDecodedRawDataArray, uint16_t aNumberOfBits, bool aMSBFirst, bool aSendStopBit, uint16_t aRepeatPeriodMillis, int_fast8_t aNumberOfRepeats) __attribute__((deprecated("Since version 4.1.0 parameter aSendStopBit is not longer required.")))
 Sends PulseDistance data from array For LSB First the LSB of array[0] is sent first then all bits until MSB of array[0]. More...
 
void sendPulseDistanceWidthFromArray (PulseDistanceWidthProtocolConstants *aProtocolConstants, IRRawDataType *aDecodedRawDataArray, uint16_t aNumberOfBits, int_fast8_t aNumberOfRepeats)
 Sends PulseDistance data from array using PulseDistanceWidthProtocolConstants For LSB First the LSB of array[0] is sent first then all bits until MSB of array[0]. More...
 
void sendPulseDistanceWidthFromArray (uint_fast8_t aFrequencyKHz, DistanceWidthTimingInfoStruct *aDistanceWidthTimingInfo, IRRawDataType *aDecodedRawDataArray, uint16_t aNumberOfBits, uint8_t aFlags, uint16_t aRepeatPeriodMillis, int_fast8_t aNumberOfRepeats)
 
void sendPulseDistanceWidth (PulseDistanceWidthProtocolConstants *aProtocolConstants, IRRawDataType aData, uint_fast8_t aNumberOfBits, int_fast8_t aNumberOfRepeats)
 Sends PulseDistance frames and repeats and enables receiver again. More...
 
void sendPulseDistanceWidthData (PulseDistanceWidthProtocolConstants *aProtocolConstants, IRRawDataType aData, uint_fast8_t aNumberOfBits)
 Sends PulseDistance data The output always ends with a space Each additional call costs 16 bytes program memory. More...
 
void sendPulseDistanceWidth (uint_fast8_t aFrequencyKHz, uint16_t aHeaderMarkMicros, uint16_t aHeaderSpaceMicros, uint16_t aOneMarkMicros, uint16_t aOneSpaceMicros, uint16_t aZeroMarkMicros, uint16_t aZeroSpaceMicros, IRRawDataType aData, uint_fast8_t aNumberOfBits, uint8_t aFlags, uint16_t aRepeatPeriodMillis, int_fast8_t aNumberOfRepeats, void(*aSpecialSendRepeatFunction)()=NULL)
 
void sendPulseDistanceWidth (uint_fast8_t aFrequencyKHz, uint16_t aHeaderMarkMicros, uint16_t aHeaderSpaceMicros, uint16_t aOneMarkMicros, uint16_t aOneSpaceMicros, uint16_t aZeroMarkMicros, uint16_t aZeroSpaceMicros, IRRawDataType aData, uint_fast8_t aNumberOfBits, bool aMSBFirst, bool aSendStopBit, uint16_t aRepeatPeriodMillis, int_fast8_t aNumberOfRepeats, void(*aSpecialSendRepeatFunction)()=NULL) __attribute__((deprecated("Since version 4.1.0 parameter aSendStopBit is not longer required.")))
 Sends PulseDistance frames and repeats. More...
 
void sendPulseDistanceWidthData (uint16_t aOneMarkMicros, uint16_t aOneSpaceMicros, uint16_t aZeroMarkMicros, uint16_t aZeroSpaceMicros, IRRawDataType aData, uint_fast8_t aNumberOfBits, uint8_t aFlags)
 
void sendPulseDistanceWidthData (uint16_t aOneMarkMicros, uint16_t aOneSpaceMicros, uint16_t aZeroMarkMicros, uint16_t aZeroSpaceMicros, IRRawDataType aData, uint_fast8_t aNumberOfBits, bool aMSBFirst, bool aSendStopBit) __attribute__((deprecated("Since version 4.1.0 last parameter aSendStopBit is not longer required.")))
 Sends PulseDistance data The output always ends with a space. More...
 
void sendBiphaseData (uint16_t aBiphaseTimeUnit, uint32_t aData, uint_fast8_t aNumberOfBits)
 Sends Biphase data MSB first Always send start bit, do not send the trailing space of the start bit 0 -> mark+space 1 -> space+mark The output always ends with a space can only send 31 bit data, since we put the start bit as 32th bit on front. More...
 
void mark (uint16_t aMarkMicros)
 Sends an IR mark for the specified number of microseconds. More...
 
void IRLedOff ()
 Just switch the IR sending LED off to send an IR space A space is "no output", so the PWM output is disabled. More...
 
void sendRaw (const uint8_t aBufferWithTicks[], uint_fast16_t aLengthOfBuffer, uint_fast8_t aIRFrequencyKilohertz)
 Function using an 8 byte tick timing array to save program memory Raw data starts with a Mark. More...
 
void sendRaw_P (const uint8_t aBufferWithTicks[], uint_fast16_t aLengthOfBuffer, uint_fast8_t aIRFrequencyKilohertz)
 New function using an 8 byte tick (50 us) timing array in FLASH to save program memory Raw data starts with a Mark. More...
 
void sendRaw (const uint16_t aBufferWithMicroseconds[], uint_fast16_t aLengthOfBuffer, uint_fast8_t aIRFrequencyKilohertz)
 Function using an 16 byte microsecond timing array for every purpose. More...
 
void sendRaw_P (const uint16_t aBufferWithMicroseconds[], uint_fast16_t aLengthOfBuffer, uint_fast8_t aIRFrequencyKilohertz)
 Function using an 16 byte microsecond timing array in FLASH for every purpose. More...
 
void sendBangOlufsen (uint16_t aHeader, uint8_t aData, int_fast8_t aNumberOfRepeats=NO_REPEATS, int8_t aNumberOfHeaderBits=8)
 
void sendBangOlufsenDataLink (uint32_t aHeader, uint8_t aData, int_fast8_t aNumberOfRepeats=NO_REPEATS, int8_t aNumberOfHeaderBits=8)
 
void sendBangOlufsenRaw (uint32_t aRawData, int_fast8_t aBits, bool aBackToBack=false)
 
void sendBangOlufsenRawDataLink (uint64_t aRawData, int_fast8_t aBits, bool aBackToBack=false, bool aUseDatalinkTiming=false)
 
void sendBoseWave (uint8_t aCommand, int_fast8_t aNumberOfRepeats=NO_REPEATS)
 
void sendDenon (uint8_t aAddress, uint8_t aCommand, int_fast8_t aNumberOfRepeats, bool aSendSharp=false)
 
void sendDenonRaw (uint16_t aRawData, int_fast8_t aNumberOfRepeats=NO_REPEATS) void sendFAST(uint8_t aCommand
 
void sendJVC (uint8_t aAddress, uint8_t aCommand, int_fast8_t aNumberOfRepeats)
 The JVC protocol repeats by skipping the header mark and space -> this leads to a poor repeat detection for JVC protocol. More...
 
void sendLG2Repeat ()
 
uint32_t computeLGRawDataAndChecksum (uint8_t aAddress, uint16_t aCommand)
 
void sendLG (uint8_t aAddress, uint16_t aCommand, int_fast8_t aNumberOfRepeats)
 LG uses the NEC repeat. More...
 
void sendLG2 (uint8_t aAddress, uint16_t aCommand, int_fast8_t aNumberOfRepeats)
 LG2 uses a special repeat. More...
 
void sendLGRaw (uint32_t aRawData, int_fast8_t aNumberOfRepeats=NO_REPEATS)
 Here you can put your raw data, even one with "wrong" checksum. More...
 
void sendNECRepeat ()
 Send special NEC repeat frame Repeat commands should be sent in a 110 ms raster. More...
 
uint32_t computeNECRawDataAndChecksum (uint16_t aAddress, uint16_t aCommand)
 
void sendNEC (uint16_t aAddress, uint8_t aCommand, int_fast8_t aNumberOfRepeats)
 NEC Send frame and special repeats There is NO delay after the last sent repeat! More...
 
void sendNEC2 (uint16_t aAddress, uint8_t aCommand, int_fast8_t aNumberOfRepeats)
 
void sendNECRaw (uint32_t aRawData, int_fast8_t aNumberOfRepeats=NO_REPEATS)
 
void sendOnkyo (uint16_t aAddress, uint16_t aCommand, int_fast8_t aNumberOfRepeats)
 
void sendApple (uint8_t aAddress, uint8_t aCommand, int_fast8_t aNumberOfRepeats)
 
void sendKaseikyo (uint16_t aAddress, uint8_t aData, int_fast8_t aNumberOfRepeats, uint16_t aVendorCode)
 Address can be interpreted as sub-device << 4 + 4 bit device. More...
 
void sendPanasonic (uint16_t aAddress, uint8_t aData, int_fast8_t aNumberOfRepeats)
 Stub using Kaseikyo with PANASONIC_VENDOR_ID_CODE. More...
 
void sendKaseikyo_Denon (uint16_t aAddress, uint8_t aData, int_fast8_t aNumberOfRepeats)
 Stub using Kaseikyo with DENON_VENDOR_ID_CODE. More...
 
void sendKaseikyo_Mitsubishi (uint16_t aAddress, uint8_t aData, int_fast8_t aNumberOfRepeats)
 Stub using Kaseikyo with MITSUBISHI_VENDOR_ID_CODE. More...
 
void sendKaseikyo_Sharp (uint16_t aAddress, uint8_t aData, int_fast8_t aNumberOfRepeats)
 Stub using Kaseikyo with SHARP_VENDOR_ID_CODE. More...
 
void sendKaseikyo_JVC (uint16_t aAddress, uint8_t aData, int_fast8_t aNumberOfRepeats)
 Stub using Kaseikyo with JVC_VENDOR_ID_CODE. More...
 
void sendRC5 (uint8_t aAddress, uint8_t aCommand, int_fast8_t aNumberOfRepeats, bool aEnableAutomaticToggle=true)
 
void sendRC6 (uint8_t aAddress, uint8_t aCommand, int_fast8_t aNumberOfRepeats, bool aEnableAutomaticToggle=true)
 Assemble raw data for RC6 from parameters and toggle state and send We do not wait for the minimal trailing space of 2666 us. More...
 
void sendSamsungLGRepeat ()
 Send repeat Repeat commands should be sent in a 110 ms raster. More...
 
void sendSamsung (uint16_t aAddress, uint16_t aCommand, int_fast8_t aNumberOfRepeats)
 Here we send Samsung32 If we get a command < 0x100, we send command and then ~command If we get an address < 0x100, we send address and then address again, this makes it flipper IRDB compatible !!! Be aware, that this is flexible, but makes it impossible to send e.g. More...
 
void sendSamsung16BitAddressAndCommand (uint16_t aAddress, uint16_t aCommand, int_fast8_t aNumberOfRepeats)
 Maybe no one needs it in the wild... More...
 
void sendSamsung48 (uint16_t aAddress, uint32_t aCommand, int_fast8_t aNumberOfRepeats)
 Here we send Samsung48 We send 2 x (8 bit command and then ~command) More...
 
void sendSamsungLG (uint16_t aAddress, uint16_t aCommand, int_fast8_t aNumberOfRepeats)
 
void sendSharp (uint8_t aAddress, uint8_t aCommand, int_fast8_t aNumberOfRepeats)
 
void sendSony (uint16_t aAddress, uint8_t aCommand, int_fast8_t aNumberOfRepeats, uint8_t numberOfBits=12)
 
void sendLegoPowerFunctions (uint8_t aChannel, uint8_t tCommand, uint8_t aMode, bool aDoSend5Times=true)
 
void sendLegoPowerFunctions (uint16_t aRawData, bool aDoSend5Times=true)
 
void sendLegoPowerFunctions (uint16_t aRawData, uint8_t aChannel, bool aDoSend5Times=true)
 
void sendMagiQuest (uint32_t aWandId, uint16_t aMagnitude)
 
void sendPronto (const __FlashStringHelper *str, int_fast8_t aNumberOfRepeats=NO_REPEATS)
 
void sendPronto (const char *prontoHexString, int_fast8_t aNumberOfRepeats=NO_REPEATS)
 Parse the string given as Pronto Hex, and send it a number of times given as the second argument. More...
 
void sendPronto (const uint16_t *data, uint16_t length, int_fast8_t aNumberOfRepeats=NO_REPEATS)
 
void sendShuzu (uint16_t aAddress, uint8_t aCommand, int_fast8_t aNumberOfRepeats)
 
void sendDenon (unsigned long data, int nbits) __attribute__((deprecated("The function sendDenon(data
 
void nbits is deprecated and may not work as expected ! Use sendDenonRaw (data, NumberOfRepeats) or better sendDenon(Address
 
void sendDish (uint16_t aData)
 
void sendJVC (unsigned long data, int nbits, bool repeat) __attribute__((deprecated("This old function sends MSB first! Please use sendJVC(aAddress
 
void sendJVCMSB (unsigned long data, int nbits, bool repeat=false)
 With Send sendJVCMSB() you can send your old 32 bit codes. More...
 
void sendLG (unsigned long data, int nbits) __attribute__((deprecated("The function sendLG(data
 
void nbits is deprecated and may not work as expected ! Use sendLGRaw (data, NumberOfRepeats) or better sendLG(Address
 
void sendNEC (uint32_t aRawData, uint8_t nbits) __attribute__((deprecated("This old function sends MSB first! Please use sendNECMSB() or sendNEC(aAddress
 
void sendNECMSB (uint32_t data, uint8_t nbits, bool repeat=false)
 With Send sendNECMSB() you can send your old 32 bit codes. More...
 
void sendRC5 (uint32_t data, uint8_t nbits)
 Old version with 32 bit data. More...
 
void sendRC5ext (uint8_t addr, uint8_t cmd, bool toggle)
 
void sendRC6Raw (uint32_t data, uint8_t nbits)
 
void sendRC6 (uint32_t data, uint8_t nbits) __attribute__((deprecated("Please use sendRC6Raw().")))
 Main RC6 send function. More...
 
void sendRC6Raw (uint64_t data, uint8_t nbits)
 
void sendRC6 (uint64_t data, uint8_t nbits) __attribute__((deprecated("Please use sendRC6Raw().")))
 Send RC6 64 bit raw data Can be used to send RC6A with ?31? data bits. More...
 
void sendSharpRaw (unsigned long data, int nbits)
 
void sendSharp (uint16_t address, uint16_t command)
 
void sendSAMSUNG (unsigned long data, int nbits)
 
 __attribute__ ((deprecated("This old function sends MSB first! Please use sendSamsung().")))
 
void sendSony (unsigned long data, int nbits) __attribute__((deprecated("This old function sends MSB first! Please use sendSony(aAddress
 Old version with MSB first data. More...
 
void sendWhynter (uint32_t aData, uint8_t aNumberOfBitsToSend)
 
uint16_t getPulseCorrectionNanos ()
 

Static Public Member Functions

static void space (uint16_t aSpaceMicros)
 Sends an IR space for the specified number of microseconds. More...
 
static void customDelayMicroseconds (unsigned long aMicroseconds)
 Custom delay function that circumvents Arduino's delayMicroseconds 16 bit limit and is (mostly) not extended by the duration of interrupt codes like the millis() interrupt. More...
 

Public Attributes

void int_fast8_t aNumberOfRepeats
 
void nbits is deprecated and may not work as expected ! Use Command
 
void nbits is deprecated and may not work as expected ! Use NumberOfRepeats
 
void aCommand
 
void aNumberOfRepeats
 
uint8_t sendPin
 
uint16_t periodTimeMicros
 
uint16_t periodOnTimeMicros
 

Detailed Description

Main class for sending IR signals.

Definition at line 419 of file IRremoteInt.h.

Member Function Documentation

◆ __attribute__()

IRsend::__attribute__ ( (deprecated("This old function sends MSB first! Please use sendSamsung()."))  )

◆ sendBangOlufsen()

void IRsend::sendBangOlufsen ( uint16_t  aHeader,
uint8_t  aData,
int_fast8_t  aNumberOfRepeats = NO_REPEATS,
int8_t  aNumberOfHeaderBits = 8 
)

Definition at line 148 of file ir_BangOlufsen.hpp.

◆ sendBangOlufsenDataLink()

void IRsend::sendBangOlufsenDataLink ( uint32_t  aHeader,
uint8_t  aData,
int_fast8_t  aNumberOfRepeats = NO_REPEATS,
int8_t  aNumberOfHeaderBits = 8 
)

Definition at line 154 of file ir_BangOlufsen.hpp.

◆ sendBangOlufsenRaw()

void IRsend::sendBangOlufsenRaw ( uint32_t  aRawData,
int_fast8_t  aBits,
bool  aBackToBack = false 
)

Definition at line 163 of file ir_BangOlufsen.hpp.

◆ sendBangOlufsenRawDataLink()

void IRsend::sendBangOlufsenRawDataLink ( uint64_t  aRawData,
int_fast8_t  aBits,
bool  aBackToBack = false,
bool  aUseDatalinkTiming = false 
)

Definition at line 227 of file ir_BangOlufsen.hpp.

◆ sendDenonRaw()

void nbits is deprecated and may not work as expected ! Use IRsend::sendDenonRaw ( data  ,
NumberOfRepeats   
)

◆ sendJVC()

void IRsend::sendJVC ( unsigned long  data,
int  nbits,
bool  repeat 
)

◆ sendLGRaw()

void nbits is deprecated and may not work as expected ! Use IRsend::sendLGRaw ( data  ,
NumberOfRepeats   
)

◆ sendMagiQuest()

void IRsend::sendMagiQuest ( uint32_t  aWandId,
uint16_t  aMagnitude 
)
Parameters
aWandId31 bit ID
aMagnitude9 bit Magnitude

Definition at line 118 of file ir_MagiQuest.hpp.

◆ sendNEC()

void IRsend::sendNEC ( uint32_t  aRawData,
uint8_t  nbits 
)

◆ sendSharpRaw()

void IRsend::sendSharpRaw ( unsigned long  data,
int  nbits 
)

◆ sendShuzu()

void IRsend::sendShuzu ( uint16_t  aAddress,
uint8_t  aCommand,
int_fast8_t  aNumberOfRepeats 
)

Definition at line 134 of file ir_Template.hpp.

Member Data Documentation

◆ aCommand

void IRsend::aCommand

Definition at line 582 of file IRremoteInt.h.

◆ aNumberOfRepeats [1/2]

void IRsend::aNumberOfRepeats
Initial value:
{
sendNECMSB(aRawData, nbits)

Definition at line 520 of file IRremoteInt.h.

◆ aNumberOfRepeats [2/2]

void IRsend::aNumberOfRepeats
Initial value:
{
sendJVCMSB(data, nbits, repeat)

Definition at line 582 of file IRremoteInt.h.

◆ Command

void nbits is deprecated and may not work as expected ! Use IRsend::Command

Definition at line 578 of file IRremoteInt.h.

◆ NumberOfRepeats

void nbits is deprecated and may not work as expected ! Use IRsend::NumberOfRepeats

Definition at line 578 of file IRremoteInt.h.

◆ periodOnTimeMicros

uint16_t IRsend::periodOnTimeMicros

Definition at line 618 of file IRremoteInt.h.

◆ periodTimeMicros

uint16_t IRsend::periodTimeMicros

Definition at line 617 of file IRremoteInt.h.

◆ sendPin

uint8_t IRsend::sendPin

Definition at line 615 of file IRremoteInt.h.


The documentation for this class was generated from the following files:
IRsend::sendNECMSB
void sendNECMSB(uint32_t data, uint8_t nbits, bool repeat=false)
With Send sendNECMSB() you can send your old 32 bit codes.
Definition: ir_NEC.hpp:414
IRsend::sendJVCMSB
void sendJVCMSB(unsigned long data, int nbits, bool repeat=false)
With Send sendJVCMSB() you can send your old 32 bit codes.
Definition: ir_JVC.hpp:242