to activate or cancel the filter
+# option.
+# The default value is: YES.
+# This tag requires that the tag GENERATE_HTML is set to YES.
+
+SEARCHENGINE = YES
+
+# When the SERVER_BASED_SEARCH tag is enabled the search engine will be
+# implemented using a web server instead of a web client using JavaScript. There
+# are two flavors of web server based searching depending on the EXTERNAL_SEARCH
+# setting. When disabled, doxygen will generate a PHP script for searching and
+# an index file used by the script. When EXTERNAL_SEARCH is enabled the indexing
+# and searching needs to be provided by external tools. See the section
+# "External Indexing and Searching" for details.
+# The default value is: NO.
+# This tag requires that the tag SEARCHENGINE is set to YES.
+
+SERVER_BASED_SEARCH = NO
+
+# When EXTERNAL_SEARCH tag is enabled doxygen will no longer generate the PHP
+# script for searching. Instead the search results are written to an XML file
+# which needs to be processed by an external indexer. Doxygen will invoke an
+# external search engine pointed to by the SEARCHENGINE_URL option to obtain the
+# search results.
+#
+# Doxygen ships with an example indexer (doxyindexer) and search engine
+# (doxysearch.cgi) which are based on the open source search engine library
+# Xapian (see: https://xapian.org/).
+#
+# See the section "External Indexing and Searching" for details.
+# The default value is: NO.
+# This tag requires that the tag SEARCHENGINE is set to YES.
+
+EXTERNAL_SEARCH = NO
+
+# The SEARCHENGINE_URL should point to a search engine hosted by a web server
+# which will return the search results when EXTERNAL_SEARCH is enabled.
+#
+# Doxygen ships with an example indexer (doxyindexer) and search engine
+# (doxysearch.cgi) which are based on the open source search engine library
+# Xapian (see: https://xapian.org/). See the section "External Indexing and
+# Searching" for details.
+# This tag requires that the tag SEARCHENGINE is set to YES.
+
+SEARCHENGINE_URL =
+
+# When SERVER_BASED_SEARCH and EXTERNAL_SEARCH are both enabled the unindexed
+# search data is written to a file for indexing by an external tool. With the
+# SEARCHDATA_FILE tag the name of this file can be specified.
+# The default file is: searchdata.xml.
+# This tag requires that the tag SEARCHENGINE is set to YES.
+
+SEARCHDATA_FILE = searchdata.xml
+
+# When SERVER_BASED_SEARCH and EXTERNAL_SEARCH are both enabled the
+# EXTERNAL_SEARCH_ID tag can be used as an identifier for the project. This is
+# useful in combination with EXTRA_SEARCH_MAPPINGS to search through multiple
+# projects and redirect the results back to the right project.
+# This tag requires that the tag SEARCHENGINE is set to YES.
+
+EXTERNAL_SEARCH_ID =
+
+# The EXTRA_SEARCH_MAPPINGS tag can be used to enable searching through doxygen
+# projects other than the one defined by this configuration file, but that are
+# all added to the same external search index. Each project needs to have a
+# unique id set via EXTERNAL_SEARCH_ID. The search mapping then maps the id of
+# to a relative location where the documentation can be found. The format is:
+# EXTRA_SEARCH_MAPPINGS = tagname1=loc1 tagname2=loc2 ...
+# This tag requires that the tag SEARCHENGINE is set to YES.
+
+EXTRA_SEARCH_MAPPINGS =
+
+#---------------------------------------------------------------------------
+# Configuration options related to the LaTeX output
+#---------------------------------------------------------------------------
+
+# If the GENERATE_LATEX tag is set to YES, doxygen will generate LaTeX output.
+# The default value is: YES.
+
+GENERATE_LATEX = NO
+
+# The LATEX_OUTPUT tag is used to specify where the LaTeX docs will be put. If a
+# relative path is entered the value of OUTPUT_DIRECTORY will be put in front of
+# it.
+# The default directory is: latex.
+# This tag requires that the tag GENERATE_LATEX is set to YES.
+
+LATEX_OUTPUT = latex
+
+# The LATEX_CMD_NAME tag can be used to specify the LaTeX command name to be
+# invoked.
+#
+# Note that when not enabling USE_PDFLATEX the default is latex when enabling
+# USE_PDFLATEX the default is pdflatex and when in the later case latex is
+# chosen this is overwritten by pdflatex. For specific output languages the
+# default can have been set differently, this depends on the implementation of
+# the output language.
+# This tag requires that the tag GENERATE_LATEX is set to YES.
+
+LATEX_CMD_NAME = latex
+
+# The MAKEINDEX_CMD_NAME tag can be used to specify the command name to generate
+# index for LaTeX.
+# Note: This tag is used in the Makefile / make.bat.
+# See also: LATEX_MAKEINDEX_CMD for the part in the generated output file
+# (.tex).
+# The default file is: makeindex.
+# This tag requires that the tag GENERATE_LATEX is set to YES.
+
+MAKEINDEX_CMD_NAME = makeindex
+
+# The LATEX_MAKEINDEX_CMD tag can be used to specify the command name to
+# generate index for LaTeX. In case there is no backslash (\) as first character
+# it will be automatically added in the LaTeX code.
+# Note: This tag is used in the generated output file (.tex).
+# See also: MAKEINDEX_CMD_NAME for the part in the Makefile / make.bat.
+# The default value is: makeindex.
+# This tag requires that the tag GENERATE_LATEX is set to YES.
+
+LATEX_MAKEINDEX_CMD = makeindex
+
+# If the COMPACT_LATEX tag is set to YES, doxygen generates more compact LaTeX
+# documents. This may be useful for small projects and may help to save some
+# trees in general.
+# The default value is: NO.
+# This tag requires that the tag GENERATE_LATEX is set to YES.
+
+COMPACT_LATEX = NO
+
+# The PAPER_TYPE tag can be used to set the paper type that is used by the
+# printer.
+# Possible values are: a4 (210 x 297 mm), letter (8.5 x 11 inches), legal (8.5 x
+# 14 inches) and executive (7.25 x 10.5 inches).
+# The default value is: a4.
+# This tag requires that the tag GENERATE_LATEX is set to YES.
+
+PAPER_TYPE = a4
+
+# The EXTRA_PACKAGES tag can be used to specify one or more LaTeX package names
+# that should be included in the LaTeX output. The package can be specified just
+# by its name or with the correct syntax as to be used with the LaTeX
+# \usepackage command. To get the times font for instance you can specify :
+# EXTRA_PACKAGES=times or EXTRA_PACKAGES={times}
+# To use the option intlimits with the amsmath package you can specify:
+# EXTRA_PACKAGES=[intlimits]{amsmath}
+# If left blank no extra packages will be included.
+# This tag requires that the tag GENERATE_LATEX is set to YES.
+
+EXTRA_PACKAGES =
+
+# The LATEX_HEADER tag can be used to specify a personal LaTeX header for the
+# generated LaTeX document. The header should contain everything until the first
+# chapter. If it is left blank doxygen will generate a standard header. See
+# section "Doxygen usage" for information on how to let doxygen write the
+# default header to a separate file.
+#
+# Note: Only use a user-defined header if you know what you are doing! The
+# following commands have a special meaning inside the header: $title,
+# $datetime, $date, $doxygenversion, $projectname, $projectnumber,
+# $projectbrief, $projectlogo. Doxygen will replace $title with the empty
+# string, for the replacement values of the other commands the user is referred
+# to HTML_HEADER.
+# This tag requires that the tag GENERATE_LATEX is set to YES.
+
+LATEX_HEADER =
+
+# The LATEX_FOOTER tag can be used to specify a personal LaTeX footer for the
+# generated LaTeX document. The footer should contain everything after the last
+# chapter. If it is left blank doxygen will generate a standard footer. See
+# LATEX_HEADER for more information on how to generate a default footer and what
+# special commands can be used inside the footer.
+#
+# Note: Only use a user-defined footer if you know what you are doing!
+# This tag requires that the tag GENERATE_LATEX is set to YES.
+
+LATEX_FOOTER =
+
+# The LATEX_EXTRA_STYLESHEET tag can be used to specify additional user-defined
+# LaTeX style sheets that are included after the standard style sheets created
+# by doxygen. Using this option one can overrule certain style aspects. Doxygen
+# will copy the style sheet files to the output directory.
+# Note: The order of the extra style sheet files is of importance (e.g. the last
+# style sheet in the list overrules the setting of the previous ones in the
+# list).
+# This tag requires that the tag GENERATE_LATEX is set to YES.
+
+LATEX_EXTRA_STYLESHEET =
+
+# The LATEX_EXTRA_FILES tag can be used to specify one or more extra images or
+# other source files which should be copied to the LATEX_OUTPUT output
+# directory. Note that the files will be copied as-is; there are no commands or
+# markers available.
+# This tag requires that the tag GENERATE_LATEX is set to YES.
+
+LATEX_EXTRA_FILES =
+
+# If the PDF_HYPERLINKS tag is set to YES, the LaTeX that is generated is
+# prepared for conversion to PDF (using ps2pdf or pdflatex). The PDF file will
+# contain links (just like the HTML output) instead of page references. This
+# makes the output suitable for online browsing using a PDF viewer.
+# The default value is: YES.
+# This tag requires that the tag GENERATE_LATEX is set to YES.
+
+PDF_HYPERLINKS = YES
+
+# If the USE_PDFLATEX tag is set to YES, doxygen will use pdflatex to generate
+# the PDF file directly from the LaTeX files. Set this option to YES, to get a
+# higher quality PDF documentation.
+# The default value is: YES.
+# This tag requires that the tag GENERATE_LATEX is set to YES.
+
+USE_PDFLATEX = YES
+
+# If the LATEX_BATCHMODE tag is set to YES, doxygen will add the \batchmode
+# command to the generated LaTeX files. This will instruct LaTeX to keep running
+# if errors occur, instead of asking the user for help. This option is also used
+# when generating formulas in HTML.
+# The default value is: NO.
+# This tag requires that the tag GENERATE_LATEX is set to YES.
+
+LATEX_BATCHMODE = NO
+
+# If the LATEX_HIDE_INDICES tag is set to YES then doxygen will not include the
+# index chapters (such as File Index, Compound Index, etc.) in the output.
+# The default value is: NO.
+# This tag requires that the tag GENERATE_LATEX is set to YES.
+
+LATEX_HIDE_INDICES = NO
+
+# If the LATEX_SOURCE_CODE tag is set to YES then doxygen will include source
+# code with syntax highlighting in the LaTeX output.
+#
+# Note that which sources are shown also depends on other settings such as
+# SOURCE_BROWSER.
+# The default value is: NO.
+# This tag requires that the tag GENERATE_LATEX is set to YES.
+
+LATEX_SOURCE_CODE = NO
+
+# The LATEX_BIB_STYLE tag can be used to specify the style to use for the
+# bibliography, e.g. plainnat, or ieeetr. See
+# https://en.wikipedia.org/wiki/BibTeX and \cite for more info.
+# The default value is: plain.
+# This tag requires that the tag GENERATE_LATEX is set to YES.
+
+LATEX_BIB_STYLE = plain
+
+# If the LATEX_TIMESTAMP tag is set to YES then the footer of each generated
+# page will contain the date and time when the page was generated. Setting this
+# to NO can help when comparing the output of multiple runs.
+# The default value is: NO.
+# This tag requires that the tag GENERATE_LATEX is set to YES.
+
+LATEX_TIMESTAMP = NO
+
+# The LATEX_EMOJI_DIRECTORY tag is used to specify the (relative or absolute)
+# path from which the emoji images will be read. If a relative path is entered,
+# it will be relative to the LATEX_OUTPUT directory. If left blank the
+# LATEX_OUTPUT directory will be used.
+# This tag requires that the tag GENERATE_LATEX is set to YES.
+
+LATEX_EMOJI_DIRECTORY =
+
+#---------------------------------------------------------------------------
+# Configuration options related to the RTF output
+#---------------------------------------------------------------------------
+
+# If the GENERATE_RTF tag is set to YES, doxygen will generate RTF output. The
+# RTF output is optimized for Word 97 and may not look too pretty with other RTF
+# readers/editors.
+# The default value is: NO.
+
+GENERATE_RTF = NO
+
+# The RTF_OUTPUT tag is used to specify where the RTF docs will be put. If a
+# relative path is entered the value of OUTPUT_DIRECTORY will be put in front of
+# it.
+# The default directory is: rtf.
+# This tag requires that the tag GENERATE_RTF is set to YES.
+
+RTF_OUTPUT = rtf
+
+# If the COMPACT_RTF tag is set to YES, doxygen generates more compact RTF
+# documents. This may be useful for small projects and may help to save some
+# trees in general.
+# The default value is: NO.
+# This tag requires that the tag GENERATE_RTF is set to YES.
+
+COMPACT_RTF = NO
+
+# If the RTF_HYPERLINKS tag is set to YES, the RTF that is generated will
+# contain hyperlink fields. The RTF file will contain links (just like the HTML
+# output) instead of page references. This makes the output suitable for online
+# browsing using Word or some other Word compatible readers that support those
+# fields.
+#
+# Note: WordPad (write) and others do not support links.
+# The default value is: NO.
+# This tag requires that the tag GENERATE_RTF is set to YES.
+
+RTF_HYPERLINKS = NO
+
+# Load stylesheet definitions from file. Syntax is similar to doxygen's
+# configuration file, i.e. a series of assignments. You only have to provide
+# replacements, missing definitions are set to their default value.
+#
+# See also section "Doxygen usage" for information on how to generate the
+# default style sheet that doxygen normally uses.
+# This tag requires that the tag GENERATE_RTF is set to YES.
+
+RTF_STYLESHEET_FILE =
+
+# Set optional variables used in the generation of an RTF document. Syntax is
+# similar to doxygen's configuration file. A template extensions file can be
+# generated using doxygen -e rtf extensionFile.
+# This tag requires that the tag GENERATE_RTF is set to YES.
+
+RTF_EXTENSIONS_FILE =
+
+# If the RTF_SOURCE_CODE tag is set to YES then doxygen will include source code
+# with syntax highlighting in the RTF output.
+#
+# Note that which sources are shown also depends on other settings such as
+# SOURCE_BROWSER.
+# The default value is: NO.
+# This tag requires that the tag GENERATE_RTF is set to YES.
+
+RTF_SOURCE_CODE = NO
+
+#---------------------------------------------------------------------------
+# Configuration options related to the man page output
+#---------------------------------------------------------------------------
+
+# If the GENERATE_MAN tag is set to YES, doxygen will generate man pages for
+# classes and files.
+# The default value is: NO.
+
+GENERATE_MAN = NO
+
+# The MAN_OUTPUT tag is used to specify where the man pages will be put. If a
+# relative path is entered the value of OUTPUT_DIRECTORY will be put in front of
+# it. A directory man3 will be created inside the directory specified by
+# MAN_OUTPUT.
+# The default directory is: man.
+# This tag requires that the tag GENERATE_MAN is set to YES.
+
+MAN_OUTPUT = man
+
+# The MAN_EXTENSION tag determines the extension that is added to the generated
+# man pages. In case the manual section does not start with a number, the number
+# 3 is prepended. The dot (.) at the beginning of the MAN_EXTENSION tag is
+# optional.
+# The default value is: .3.
+# This tag requires that the tag GENERATE_MAN is set to YES.
+
+MAN_EXTENSION = .3
+
+# The MAN_SUBDIR tag determines the name of the directory created within
+# MAN_OUTPUT in which the man pages are placed. If defaults to man followed by
+# MAN_EXTENSION with the initial . removed.
+# This tag requires that the tag GENERATE_MAN is set to YES.
+
+MAN_SUBDIR =
+
+# If the MAN_LINKS tag is set to YES and doxygen generates man output, then it
+# will generate one additional man file for each entity documented in the real
+# man page(s). These additional files only source the real man page, but without
+# them the man command would be unable to find the correct page.
+# The default value is: NO.
+# This tag requires that the tag GENERATE_MAN is set to YES.
+
+MAN_LINKS = NO
+
+#---------------------------------------------------------------------------
+# Configuration options related to the XML output
+#---------------------------------------------------------------------------
+
+# If the GENERATE_XML tag is set to YES, doxygen will generate an XML file that
+# captures the structure of the code including all documentation.
+# The default value is: NO.
+
+GENERATE_XML = NO
+
+# The XML_OUTPUT tag is used to specify where the XML pages will be put. If a
+# relative path is entered the value of OUTPUT_DIRECTORY will be put in front of
+# it.
+# The default directory is: xml.
+# This tag requires that the tag GENERATE_XML is set to YES.
+
+XML_OUTPUT = xml
+
+# If the XML_PROGRAMLISTING tag is set to YES, doxygen will dump the program
+# listings (including syntax highlighting and cross-referencing information) to
+# the XML output. Note that enabling this will significantly increase the size
+# of the XML output.
+# The default value is: YES.
+# This tag requires that the tag GENERATE_XML is set to YES.
+
+XML_PROGRAMLISTING = YES
+
+# If the XML_NS_MEMB_FILE_SCOPE tag is set to YES, doxygen will include
+# namespace members in file scope as well, matching the HTML output.
+# The default value is: NO.
+# This tag requires that the tag GENERATE_XML is set to YES.
+
+XML_NS_MEMB_FILE_SCOPE = NO
+
+#---------------------------------------------------------------------------
+# Configuration options related to the DOCBOOK output
+#---------------------------------------------------------------------------
+
+# If the GENERATE_DOCBOOK tag is set to YES, doxygen will generate Docbook files
+# that can be used to generate PDF.
+# The default value is: NO.
+
+GENERATE_DOCBOOK = NO
+
+# The DOCBOOK_OUTPUT tag is used to specify where the Docbook pages will be put.
+# If a relative path is entered the value of OUTPUT_DIRECTORY will be put in
+# front of it.
+# The default directory is: docbook.
+# This tag requires that the tag GENERATE_DOCBOOK is set to YES.
+
+DOCBOOK_OUTPUT = docbook
+
+# If the DOCBOOK_PROGRAMLISTING tag is set to YES, doxygen will include the
+# program listings (including syntax highlighting and cross-referencing
+# information) to the DOCBOOK output. Note that enabling this will significantly
+# increase the size of the DOCBOOK output.
+# The default value is: NO.
+# This tag requires that the tag GENERATE_DOCBOOK is set to YES.
+
+DOCBOOK_PROGRAMLISTING = NO
+
+#---------------------------------------------------------------------------
+# Configuration options for the AutoGen Definitions output
+#---------------------------------------------------------------------------
+
+# If the GENERATE_AUTOGEN_DEF tag is set to YES, doxygen will generate an
+# AutoGen Definitions (see http://autogen.sourceforge.net/) file that captures
+# the structure of the code including all documentation. Note that this feature
+# is still experimental and incomplete at the moment.
+# The default value is: NO.
+
+GENERATE_AUTOGEN_DEF = NO
+
+#---------------------------------------------------------------------------
+# Configuration options related to the Perl module output
+#---------------------------------------------------------------------------
+
+# If the GENERATE_PERLMOD tag is set to YES, doxygen will generate a Perl module
+# file that captures the structure of the code including all documentation.
+#
+# Note that this feature is still experimental and incomplete at the moment.
+# The default value is: NO.
+
+GENERATE_PERLMOD = NO
+
+# If the PERLMOD_LATEX tag is set to YES, doxygen will generate the necessary
+# Makefile rules, Perl scripts and LaTeX code to be able to generate PDF and DVI
+# output from the Perl module output.
+# The default value is: NO.
+# This tag requires that the tag GENERATE_PERLMOD is set to YES.
+
+PERLMOD_LATEX = NO
+
+# If the PERLMOD_PRETTY tag is set to YES, the Perl module output will be nicely
+# formatted so it can be parsed by a human reader. This is useful if you want to
+# understand what is going on. On the other hand, if this tag is set to NO, the
+# size of the Perl module output will be much smaller and Perl will parse it
+# just the same.
+# The default value is: YES.
+# This tag requires that the tag GENERATE_PERLMOD is set to YES.
+
+PERLMOD_PRETTY = YES
+
+# The names of the make variables in the generated doxyrules.make file are
+# prefixed with the string contained in PERLMOD_MAKEVAR_PREFIX. This is useful
+# so different doxyrules.make files included by the same Makefile don't
+# overwrite each other's variables.
+# This tag requires that the tag GENERATE_PERLMOD is set to YES.
+
+PERLMOD_MAKEVAR_PREFIX =
+
+#---------------------------------------------------------------------------
+# Configuration options related to the preprocessor
+#---------------------------------------------------------------------------
+
+# If the ENABLE_PREPROCESSING tag is set to YES, doxygen will evaluate all
+# C-preprocessor directives found in the sources and include files.
+# The default value is: YES.
+
+ENABLE_PREPROCESSING = YES
+
+# If the MACRO_EXPANSION tag is set to YES, doxygen will expand all macro names
+# in the source code. If set to NO, only conditional compilation will be
+# performed. Macro expansion can be done in a controlled way by setting
+# EXPAND_ONLY_PREDEF to YES.
+# The default value is: NO.
+# This tag requires that the tag ENABLE_PREPROCESSING is set to YES.
+
+MACRO_EXPANSION = NO
+
+# If the EXPAND_ONLY_PREDEF and MACRO_EXPANSION tags are both set to YES then
+# the macro expansion is limited to the macros specified with the PREDEFINED and
+# EXPAND_AS_DEFINED tags.
+# The default value is: NO.
+# This tag requires that the tag ENABLE_PREPROCESSING is set to YES.
+
+EXPAND_ONLY_PREDEF = NO
+
+# If the SEARCH_INCLUDES tag is set to YES, the include files in the
+# INCLUDE_PATH will be searched if a #include is found.
+# The default value is: YES.
+# This tag requires that the tag ENABLE_PREPROCESSING is set to YES.
+
+SEARCH_INCLUDES = YES
+
+# The INCLUDE_PATH tag can be used to specify one or more directories that
+# contain include files that are not input files but should be processed by the
+# preprocessor.
+# This tag requires that the tag SEARCH_INCLUDES is set to YES.
+
+INCLUDE_PATH =
+
+# You can use the INCLUDE_FILE_PATTERNS tag to specify one or more wildcard
+# patterns (like *.h and *.hpp) to filter out the header-files in the
+# directories. If left blank, the patterns specified with FILE_PATTERNS will be
+# used.
+# This tag requires that the tag ENABLE_PREPROCESSING is set to YES.
+
+INCLUDE_FILE_PATTERNS =
+
+# The PREDEFINED tag can be used to specify one or more macro names that are
+# defined before the preprocessor is started (similar to the -D option of e.g.
+# gcc). The argument of the tag is a list of macros of the form: name or
+# name=definition (no spaces). If the definition and the "=" are omitted, "=1"
+# is assumed. To prevent a macro definition from being undefined via #undef or
+# recursively expanded use the := operator instead of the = operator.
+# This tag requires that the tag ENABLE_PREPROCESSING is set to YES.
+
+PREDEFINED = ARDUINO \
+ DOXYGEN
+
+# If the MACRO_EXPANSION and EXPAND_ONLY_PREDEF tags are set to YES then this
+# tag can be used to specify a list of macro names that should be expanded. The
+# macro definition that is found in the sources will be used. Use the PREDEFINED
+# tag if you want to use a different macro definition that overrules the
+# definition found in the source code.
+# This tag requires that the tag ENABLE_PREPROCESSING is set to YES.
+
+EXPAND_AS_DEFINED =
+
+# If the SKIP_FUNCTION_MACROS tag is set to YES then doxygen's preprocessor will
+# remove all references to function-like macros that are alone on a line, have
+# an all uppercase name, and do not end with a semicolon. Such function macros
+# are typically used for boiler-plate code, and will confuse the parser if not
+# removed.
+# The default value is: YES.
+# This tag requires that the tag ENABLE_PREPROCESSING is set to YES.
+
+SKIP_FUNCTION_MACROS = YES
+
+#---------------------------------------------------------------------------
+# Configuration options related to external references
+#---------------------------------------------------------------------------
+
+# The TAGFILES tag can be used to specify one or more tag files. For each tag
+# file the location of the external documentation should be added. The format of
+# a tag file without this location is as follows:
+# TAGFILES = file1 file2 ...
+# Adding location for the tag files is done as follows:
+# TAGFILES = file1=loc1 "file2 = loc2" ...
+# where loc1 and loc2 can be relative or absolute paths or URLs. See the
+# section "Linking to external documentation" for more information about the use
+# of tag files.
+# Note: Each tag file must have a unique name (where the name does NOT include
+# the path). If a tag file is not located in the directory in which doxygen is
+# run, you must also specify the path to the tagfile here.
+
+TAGFILES =
+
+# When a file name is specified after GENERATE_TAGFILE, doxygen will create a
+# tag file that is based on the input files it reads. See section "Linking to
+# external documentation" for more information about the usage of tag files.
+
+GENERATE_TAGFILE =
+
+# If the ALLEXTERNALS tag is set to YES, all external class will be listed in
+# the class index. If set to NO, only the inherited external classes will be
+# listed.
+# The default value is: NO.
+
+ALLEXTERNALS = NO
+
+# If the EXTERNAL_GROUPS tag is set to YES, all external groups will be listed
+# in the modules index. If set to NO, only the current project's groups will be
+# listed.
+# The default value is: YES.
+
+EXTERNAL_GROUPS = YES
+
+# If the EXTERNAL_PAGES tag is set to YES, all external pages will be listed in
+# the related pages index. If set to NO, only the current project's pages will
+# be listed.
+# The default value is: YES.
+
+EXTERNAL_PAGES = YES
+
+#---------------------------------------------------------------------------
+# Configuration options related to the dot tool
+#---------------------------------------------------------------------------
+
+# If the CLASS_DIAGRAMS tag is set to YES, doxygen will generate a class diagram
+# (in HTML and LaTeX) for classes with base or super classes. Setting the tag to
+# NO turns the diagrams off. Note that this option also works with HAVE_DOT
+# disabled, but it is recommended to install and use dot, since it yields more
+# powerful graphs.
+# The default value is: YES.
+
+CLASS_DIAGRAMS = YES
+
+# You can include diagrams made with dia in doxygen documentation. Doxygen will
+# then run dia to produce the diagram and insert it in the documentation. The
+# DIA_PATH tag allows you to specify the directory where the dia binary resides.
+# If left empty dia is assumed to be found in the default search path.
+
+DIA_PATH =
+
+# If set to YES the inheritance and collaboration graphs will hide inheritance
+# and usage relations if the target is undocumented or is not a class.
+# The default value is: YES.
+
+HIDE_UNDOC_RELATIONS = YES
+
+# If you set the HAVE_DOT tag to YES then doxygen will assume the dot tool is
+# available from the path. This tool is part of Graphviz (see:
+# http://www.graphviz.org/), a graph visualization toolkit from AT&T and Lucent
+# Bell Labs. The other options in this section have no effect if this option is
+# set to NO
+# The default value is: NO.
+
+HAVE_DOT = YES
+
+# The DOT_NUM_THREADS specifies the number of dot invocations doxygen is allowed
+# to run in parallel. When set to 0 doxygen will base this on the number of
+# processors available in the system. You can set it explicitly to a value
+# larger than 0 to get control over the balance between CPU load and processing
+# speed.
+# Minimum value: 0, maximum value: 32, default value: 0.
+# This tag requires that the tag HAVE_DOT is set to YES.
+
+DOT_NUM_THREADS = 0
+
+# When you want a differently looking font in the dot files that doxygen
+# generates you can specify the font name using DOT_FONTNAME. You need to make
+# sure dot is able to find the font, which can be done by putting it in a
+# standard location or by setting the DOTFONTPATH environment variable or by
+# setting DOT_FONTPATH to the directory containing the font.
+# The default value is: Helvetica.
+# This tag requires that the tag HAVE_DOT is set to YES.
+
+DOT_FONTNAME = Helvetica
+
+# The DOT_FONTSIZE tag can be used to set the size (in points) of the font of
+# dot graphs.
+# Minimum value: 4, maximum value: 24, default value: 10.
+# This tag requires that the tag HAVE_DOT is set to YES.
+
+DOT_FONTSIZE = 10
+
+# By default doxygen will tell dot to use the default font as specified with
+# DOT_FONTNAME. If you specify a different font using DOT_FONTNAME you can set
+# the path where dot can find it using this tag.
+# This tag requires that the tag HAVE_DOT is set to YES.
+
+DOT_FONTPATH =
+
+# If the CLASS_GRAPH tag is set to YES then doxygen will generate a graph for
+# each documented class showing the direct and indirect inheritance relations.
+# Setting this tag to YES will force the CLASS_DIAGRAMS tag to NO.
+# The default value is: YES.
+# This tag requires that the tag HAVE_DOT is set to YES.
+
+CLASS_GRAPH = YES
+
+# If the COLLABORATION_GRAPH tag is set to YES then doxygen will generate a
+# graph for each documented class showing the direct and indirect implementation
+# dependencies (inheritance, containment, and class references variables) of the
+# class with other documented classes.
+# The default value is: YES.
+# This tag requires that the tag HAVE_DOT is set to YES.
+
+COLLABORATION_GRAPH = YES
+
+# If the GROUP_GRAPHS tag is set to YES then doxygen will generate a graph for
+# groups, showing the direct groups dependencies.
+# The default value is: YES.
+# This tag requires that the tag HAVE_DOT is set to YES.
+
+GROUP_GRAPHS = YES
+
+# If the UML_LOOK tag is set to YES, doxygen will generate inheritance and
+# collaboration diagrams in a style similar to the OMG's Unified Modeling
+# Language.
+# The default value is: NO.
+# This tag requires that the tag HAVE_DOT is set to YES.
+
+UML_LOOK = NO
+
+# If the UML_LOOK tag is enabled, the fields and methods are shown inside the
+# class node. If there are many fields or methods and many nodes the graph may
+# become too big to be useful. The UML_LIMIT_NUM_FIELDS threshold limits the
+# number of items for each type to make the size more manageable. Set this to 0
+# for no limit. Note that the threshold may be exceeded by 50% before the limit
+# is enforced. So when you set the threshold to 10, up to 15 fields may appear,
+# but if the number exceeds 15, the total amount of fields shown is limited to
+# 10.
+# Minimum value: 0, maximum value: 100, default value: 10.
+# This tag requires that the tag HAVE_DOT is set to YES.
+
+UML_LIMIT_NUM_FIELDS = 10
+
+# If the TEMPLATE_RELATIONS tag is set to YES then the inheritance and
+# collaboration graphs will show the relations between templates and their
+# instances.
+# The default value is: NO.
+# This tag requires that the tag HAVE_DOT is set to YES.
+
+TEMPLATE_RELATIONS = NO
+
+# If the INCLUDE_GRAPH, ENABLE_PREPROCESSING and SEARCH_INCLUDES tags are set to
+# YES then doxygen will generate a graph for each documented file showing the
+# direct and indirect include dependencies of the file with other documented
+# files.
+# The default value is: YES.
+# This tag requires that the tag HAVE_DOT is set to YES.
+
+INCLUDE_GRAPH = YES
+
+# If the INCLUDED_BY_GRAPH, ENABLE_PREPROCESSING and SEARCH_INCLUDES tags are
+# set to YES then doxygen will generate a graph for each documented file showing
+# the direct and indirect include dependencies of the file with other documented
+# files.
+# The default value is: YES.
+# This tag requires that the tag HAVE_DOT is set to YES.
+
+INCLUDED_BY_GRAPH = YES
+
+# If the CALL_GRAPH tag is set to YES then doxygen will generate a call
+# dependency graph for every global function or class method.
+#
+# Note that enabling this option will significantly increase the time of a run.
+# So in most cases it will be better to enable call graphs for selected
+# functions only using the \callgraph command. Disabling a call graph can be
+# accomplished by means of the command \hidecallgraph.
+# The default value is: NO.
+# This tag requires that the tag HAVE_DOT is set to YES.
+
+CALL_GRAPH = NO
+
+# If the CALLER_GRAPH tag is set to YES then doxygen will generate a caller
+# dependency graph for every global function or class method.
+#
+# Note that enabling this option will significantly increase the time of a run.
+# So in most cases it will be better to enable caller graphs for selected
+# functions only using the \callergraph command. Disabling a caller graph can be
+# accomplished by means of the command \hidecallergraph.
+# The default value is: NO.
+# This tag requires that the tag HAVE_DOT is set to YES.
+
+CALLER_GRAPH = NO
+
+# If the GRAPHICAL_HIERARCHY tag is set to YES then doxygen will graphical
+# hierarchy of all classes instead of a textual one.
+# The default value is: YES.
+# This tag requires that the tag HAVE_DOT is set to YES.
+
+GRAPHICAL_HIERARCHY = YES
+
+# If the DIRECTORY_GRAPH tag is set to YES then doxygen will show the
+# dependencies a directory has on other directories in a graphical way. The
+# dependency relations are determined by the #include relations between the
+# files in the directories.
+# The default value is: YES.
+# This tag requires that the tag HAVE_DOT is set to YES.
+
+DIRECTORY_GRAPH = YES
+
+# The DOT_IMAGE_FORMAT tag can be used to set the image format of the images
+# generated by dot. For an explanation of the image formats see the section
+# output formats in the documentation of the dot tool (Graphviz (see:
+# http://www.graphviz.org/)).
+# Note: If you choose svg you need to set HTML_FILE_EXTENSION to xhtml in order
+# to make the SVG files visible in IE 9+ (other browsers do not have this
+# requirement).
+# Possible values are: png, jpg, gif, svg, png:gd, png:gd:gd, png:cairo,
+# png:cairo:gd, png:cairo:cairo, png:cairo:gdiplus, png:gdiplus and
+# png:gdiplus:gdiplus.
+# The default value is: png.
+# This tag requires that the tag HAVE_DOT is set to YES.
+
+DOT_IMAGE_FORMAT = png
+
+# If DOT_IMAGE_FORMAT is set to svg, then this option can be set to YES to
+# enable generation of interactive SVG images that allow zooming and panning.
+#
+# Note that this requires a modern browser other than Internet Explorer. Tested
+# and working are Firefox, Chrome, Safari, and Opera.
+# Note: For IE 9+ you need to set HTML_FILE_EXTENSION to xhtml in order to make
+# the SVG files visible. Older versions of IE do not have SVG support.
+# The default value is: NO.
+# This tag requires that the tag HAVE_DOT is set to YES.
+
+INTERACTIVE_SVG = NO
+
+# The DOT_PATH tag can be used to specify the path where the dot tool can be
+# found. If left blank, it is assumed the dot tool can be found in the path.
+# This tag requires that the tag HAVE_DOT is set to YES.
+
+DOT_PATH =
+
+# The DOTFILE_DIRS tag can be used to specify one or more directories that
+# contain dot files that are included in the documentation (see the \dotfile
+# command).
+# This tag requires that the tag HAVE_DOT is set to YES.
+
+DOTFILE_DIRS =
+
+# The MSCFILE_DIRS tag can be used to specify one or more directories that
+# contain msc files that are included in the documentation (see the \mscfile
+# command).
+
+MSCFILE_DIRS =
+
+# The DIAFILE_DIRS tag can be used to specify one or more directories that
+# contain dia files that are included in the documentation (see the \diafile
+# command).
+
+DIAFILE_DIRS =
+
+# When using plantuml, the PLANTUML_JAR_PATH tag should be used to specify the
+# path where java can find the plantuml.jar file. If left blank, it is assumed
+# PlantUML is not used or called during a preprocessing step. Doxygen will
+# generate a warning when it encounters a \startuml command in this case and
+# will not generate output for the diagram.
+
+PLANTUML_JAR_PATH =
+
+# When using plantuml, the PLANTUML_CFG_FILE tag can be used to specify a
+# configuration file for plantuml.
+
+PLANTUML_CFG_FILE =
+
+# When using plantuml, the specified paths are searched for files specified by
+# the !include statement in a plantuml block.
+
+PLANTUML_INCLUDE_PATH =
+
+# The DOT_GRAPH_MAX_NODES tag can be used to set the maximum number of nodes
+# that will be shown in the graph. If the number of nodes in a graph becomes
+# larger than this value, doxygen will truncate the graph, which is visualized
+# by representing a node as a red box. Note that doxygen if the number of direct
+# children of the root node in a graph is already larger than
+# DOT_GRAPH_MAX_NODES then the graph will not be shown at all. Also note that
+# the size of a graph can be further restricted by MAX_DOT_GRAPH_DEPTH.
+# Minimum value: 0, maximum value: 10000, default value: 50.
+# This tag requires that the tag HAVE_DOT is set to YES.
+
+DOT_GRAPH_MAX_NODES = 50
+
+# The MAX_DOT_GRAPH_DEPTH tag can be used to set the maximum depth of the graphs
+# generated by dot. A depth value of 3 means that only nodes reachable from the
+# root by following a path via at most 3 edges will be shown. Nodes that lay
+# further from the root node will be omitted. Note that setting this option to 1
+# or 2 may greatly reduce the computation time needed for large code bases. Also
+# note that the size of a graph can be further restricted by
+# DOT_GRAPH_MAX_NODES. Using a depth of 0 means no depth restriction.
+# Minimum value: 0, maximum value: 1000, default value: 0.
+# This tag requires that the tag HAVE_DOT is set to YES.
+
+MAX_DOT_GRAPH_DEPTH = 0
+
+# Set the DOT_TRANSPARENT tag to YES to generate images with a transparent
+# background. This is disabled by default, because dot on Windows does not seem
+# to support this out of the box.
+#
+# Warning: Depending on the platform used, enabling this option may lead to
+# badly anti-aliased labels on the edges of a graph (i.e. they become hard to
+# read).
+# The default value is: NO.
+# This tag requires that the tag HAVE_DOT is set to YES.
+
+DOT_TRANSPARENT = NO
+
+# Set the DOT_MULTI_TARGETS tag to YES to allow dot to generate multiple output
+# files in one run (i.e. multiple -o and -T options on the command line). This
+# makes dot run faster, but since only newer versions of dot (>1.8.10) support
+# this, this feature is disabled by default.
+# The default value is: NO.
+# This tag requires that the tag HAVE_DOT is set to YES.
+
+DOT_MULTI_TARGETS = NO
+
+# If the GENERATE_LEGEND tag is set to YES doxygen will generate a legend page
+# explaining the meaning of the various boxes and arrows in the dot generated
+# graphs.
+# The default value is: YES.
+# This tag requires that the tag HAVE_DOT is set to YES.
+
+GENERATE_LEGEND = YES
+
+# If the DOT_CLEANUP tag is set to YES, doxygen will remove the intermediate dot
+# files that are used to generate the various graphs.
+# The default value is: YES.
+# This tag requires that the tag HAVE_DOT is set to YES.
+
+DOT_CLEANUP = YES
diff --git a/libraries/IRremote/LICENSE b/libraries/IRremote/LICENSE
new file mode 100644
index 0000000..184ff74
--- /dev/null
+++ b/libraries/IRremote/LICENSE
@@ -0,0 +1,25 @@
+MIT License
+
+(c) Copyright 2009 Ken Shirriff http://www.righto.com
+(c) Copyright 2016 Rafi Khan
+(c) Copyright 2020-2022 Armin Joachimsmeyer et al.
+
+ http://www.opensource.org/licenses/mit-license.php
+
+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.
diff --git a/libraries/IRremote/README.md b/libraries/IRremote/README.md
new file mode 100644
index 0000000..1694220
--- /dev/null
+++ b/libraries/IRremote/README.md
@@ -0,0 +1,1097 @@
+
+
+# Arduino IRremote
+A library enabling the sending & receiving of infra-red signals.
+
+[](https://opensource.org/licenses/MIT)
+
+[](https://github.com/Arduino-IRremote/Arduino-IRremote/releases/latest)
+
+[](https://github.com/Arduino-IRremote/Arduino-IRremote/commits/master)
+
+[](https://github.com/Arduino-IRremote/Arduino-IRremote/actions)
+
+
+[](https://stand-with-ukraine.pp.ua)
+
+Available as [Arduino library "IRremote"](https://www.arduinolibraries.info/libraries/i-rremote).
+
+[](https://www.ardu-badge.com/IRremote)
+
+[](https://arduino-irremote.github.io/Arduino-IRremote/classIRrecv.html)
+
+[](https://github.com/Arduino-IRremote/Arduino-IRremote/blob/master/changelog.md)
+
+[](https://github.com/Arduino-IRremote/Arduino-IRremote/blob/master/Contributing.md)
+
+#### If you find this program useful, please give it a star.
+
+🌎 [Google Translate](https://translate.google.com/translate?sl=en&u=https://github.com/Arduino-IRremote/Arduino-IRremote)
+
+
+
+# Table of content
+- [Supported IR Protocols](https://github.com/Arduino-IRremote/Arduino-IRremote?tab=readme-ov-file#supported-ir-protocols)
+- [Features](https://github.com/Arduino-IRremote/Arduino-IRremote?tab=readme-ov-file#features)
+ * [New features with version 4.x](https://github.com/Arduino-IRremote/Arduino-IRremote?tab=readme-ov-file#new-features-with-version-4x)
+ * [New features with version 3.x](https://github.com/Arduino-IRremote/Arduino-IRremote?tab=readme-ov-file#new-features-with-version-3x)
+- [Converting your 2.x program to the 4.x version](https://github.com/Arduino-IRremote/Arduino-IRremote?tab=readme-ov-file#converting-your-2x-program-to-the-4x-version)
+ * [How to convert old MSB first 32 bit IR data codes to new LSB first 32 bit IR data codes](https://github.com/Arduino-IRremote/Arduino-IRremote?tab=readme-ov-file#how-to-convert-old-msb-first-32-bit-ir-data-codes-to-new-lsb-first-32-bit-ir-data-codes)
+- [Errors with using the 3.x versions for old tutorials](https://github.com/Arduino-IRremote/Arduino-IRremote?tab=readme-ov-file#errors-with-using-the-3x-versions-for-old-tutorials)
+ * [Staying on 2.x](https://github.com/Arduino-IRremote/Arduino-IRremote?tab=readme-ov-file#staying-on-2x)
+- [Why *.hpp instead of *.cpp](https://github.com/Arduino-IRremote/Arduino-IRremote?tab=readme-ov-file#why-hpp-instead-of-cpp)
+- [Using the new *.hpp files](https://github.com/Arduino-IRremote/Arduino-IRremote?tab=readme-ov-file#using-the-new-hpp-files)
+- [3 ways to specify an IR code](https://github.com/Arduino-IRremote/Arduino-IRremote?tab=readme-ov-file#3-ways-to-specify-an-ir-code)
+- [IRReceiver pinouts](https://github.com/Arduino-IRremote/Arduino-IRremote?tab=readme-ov-file#irreceiver-pinouts)
+- [Receiving IR codes](https://github.com/Arduino-IRremote/Arduino-IRremote?tab=readme-ov-file#receiving-ir-codes)
+ * [decodedIRData structure](https://github.com/Arduino-IRremote/Arduino-IRremote?tab=readme-ov-file#decodedirdata-structure)
+ * [Ambiguous protocols](https://github.com/Arduino-IRremote/Arduino-IRremote?tab=readme-ov-file#ambiguous-protocols)
+ * [RAM usage of different protocolsl](https://github.com/Arduino-IRremote/Arduino-IRremote?tab=readme-ov-file#ram-usage-of-different-protocols)
+ * [Handling unknown Protocols](https://github.com/Arduino-IRremote/Arduino-IRremote?tab=readme-ov-file#handling-unknown-protocols)
+ * [Disclaimer](https://github.com/Arduino-IRremote/Arduino-IRremote?tab=readme-ov-file#disclaimer)
+ * [Other libraries](https://github.com/Arduino-IRremote/Arduino-IRremote?tab=readme-ov-file#other-libraries)
+ * [Protocol=PULSE_DISTANCE](https://github.com/Arduino-IRremote/Arduino-IRremote?tab=readme-ov-file#protocolpulse_distance)
+ * [Protocol=UNKNOWN](https://github.com/Arduino-IRremote/Arduino-IRremote?tab=readme-ov-file#protocolunknown)
+ * [How to deal with protocols not supported by IRremote](https://github.com/Arduino-IRremote/Arduino-IRremote?tab=readme-ov-file#how-to-deal-with-protocols-not-supported-by-irremote)
+- [Sending IR codes](https://github.com/Arduino-IRremote/Arduino-IRremote?tab=readme-ov-file#sending-ir-codes)
+ * [Sending IRDB IR codes](https://github.com/Arduino-IRremote/Arduino-IRremote?tab=readme-ov-file#sending-irdb-ir-codes)
+ * [Send pin](https://github.com/Arduino-IRremote/Arduino-IRremote?tab=readme-ov-file#send-pin)
+ + [List of public IR code databases](https://github.com/Arduino-IRremote/Arduino-IRremote?tab=readme-ov-file#list-of-public-ir-code-databases)
+- [Tiny NEC receiver and sender](https://github.com/Arduino-IRremote/Arduino-IRremote?tab=readme-ov-file#tiny-nec-receiver-and-sender)
+- [The FAST protocol](https://github.com/Arduino-IRremote/Arduino-IRremote?tab=readme-ov-file#the-fast-protocol)
+- [FAQ and hints](https://github.com/Arduino-IRremote/Arduino-IRremote?tab=readme-ov-file#faq-and-hints)
+ * [Receiving stops after analogWrite() or tone() or after running a motor](https://github.com/Arduino-IRremote/Arduino-IRremote?tab=readme-ov-file#receiving-stops-after-analogwrite-or-tone-or-after-running-a-motor)
+ * [Receiving sets overflow flag](https://github.com/Arduino-IRremote/Arduino-IRremote?tab=readme-ov-file#receiving-sets-overflow-flag)
+ * [Problems with Neopixels, FastLed etc.](https://github.com/Arduino-IRremote/Arduino-IRremote?tab=readme-ov-file#problems-with-neopixels-fastled-etc)
+ * [Does not work/compile with another library](https://github.com/Arduino-IRremote/Arduino-IRremote?tab=readme-ov-file#does-not-workcompile-with-another-library)
+ * [Multiple IR receiver](https://github.com/Arduino-IRremote/Arduino-IRremote?tab=readme-ov-file#multiple-ir-receiver)
+ * [Increase strength of sent output signal](https://github.com/Arduino-IRremote/Arduino-IRremote?tab=readme-ov-file#increase-strength-of-sent-output-signal)
+ * [Minimal CPU clock frequency](https://github.com/Arduino-IRremote/Arduino-IRremote?tab=readme-ov-file#minimal-cpu-clock-frequency)
+ * [Bang & Olufsen protocol](https://github.com/Arduino-IRremote/Arduino-IRremote?tab=readme-ov-file#bang--olufsen-protocol)
+- [Examples for this library](https://github.com/Arduino-IRremote/Arduino-IRremote?tab=readme-ov-file#examples-for-this-library)
+- [WOKWI online examples](https://github.com/Arduino-IRremote/Arduino-IRremote?tab=readme-ov-file#wokwi-online-examples)
+- [IR control of a robot car](https://github.com/Arduino-IRremote/Arduino-IRremote?tab=readme-ov-file#ir-control-of-a-robot-car)
+- [Issues and discussions](https://github.com/Arduino-IRremote/Arduino-IRremote?tab=readme-ov-file#issues-and-discussions)
+- [Compile options / macros for this library](https://github.com/Arduino-IRremote/Arduino-IRremote?tab=readme-ov-file#compile-options--macros-for-this-library)
+ + [Changing include (*.h) files with Arduino IDE](https://github.com/Arduino-IRremote/Arduino-IRremote?tab=readme-ov-file#changing-include-h-files-with-arduino-ide)
+ + [Modifying compile options with Sloeber IDE](https://github.com/Arduino-IRremote/Arduino-IRremote?tab=readme-ov-file#modifying-compile-options--macros-with-sloeber-ide)
+- [Supported Boards](https://github.com/Arduino-IRremote/Arduino-IRremote?tab=readme-ov-file#supported-boards)
+- [Timer and pin usage](https://github.com/Arduino-IRremote/Arduino-IRremote?tab=readme-ov-file#timer-and-pin-usage)
+ * [Incompatibilities to other libraries and Arduino commands like tone() and analogWrite()](https://github.com/Arduino-IRremote/Arduino-IRremote?tab=readme-ov-file#incompatibilities-to-other-libraries-and-arduino-commands-like-tone-and-analogwrite)
+ * [Hardware-PWM signal generation for sending](https://github.com/Arduino-IRremote/Arduino-IRremote?tab=readme-ov-file#hardware-pwm-signal-generation-for-sending)
+ * [Why do we use 30% duty cycle for sending](https://github.com/Arduino-IRremote/Arduino-IRremote?tab=readme-ov-file#why-do-we-use-30-duty-cycle-for-sending)
+- [How we decode signals](https://github.com/Arduino-IRremote/Arduino-IRremote?tab=readme-ov-file#how-we-decode-signals)
+- [NEC encoding diagrams](https://github.com/Arduino-IRremote/Arduino-IRremote?tab=readme-ov-file#nec-encoding-diagrams)
+- [Quick comparison of 5 Arduino IR receiving libraries](https://github.com/Arduino-IRremote/Arduino-IRremote?tab=readme-ov-file#quick-comparison-of-5-arduino-ir-receiving-libraries)
+- [History](https://github.com/Arduino-IRremote/Arduino-IRremote/blob/master/changelog.md)
+- [Useful links](https://github.com/Arduino-IRremote/Arduino-IRremote?tab=readme-ov-file#useful-links)
+- [Contributors](https://github.com/Arduino-IRremote/Arduino-IRremote/blob/master/Contributors.md)
+- [License](https://github.com/Arduino-IRremote/Arduino-IRremote?tab=readme-ov-file#license)
+- [Copyright](https://github.com/Arduino-IRremote/Arduino-IRremote?tab=readme-ov-file#copyright)
+
+
+
+# Supported IR Protocols
+` NEC / Onkyo / Apple ` ` Denon / Sharp ` ` Panasonic / Kaseikyo `
+
+` JVC ` ` LG ` ` RC5 ` ` RC6 ` ` Samsung ` ` Sony `
+
+` Universal Pulse Distance ` ` Universal Pulse Width ` ` Universal Pulse Distance Width`
+
+` Hash ` ` Pronto `
+
+` BoseWave ` ` Bang & Olufsen ` ` Lego ` ` FAST ` ` Whynter ` ` MagiQuest `
+
+Protocols can be switched off and on by defining macros before the line `#include ` like [here](https://github.com/Arduino-IRremote/Arduino-IRremote/blob/master/examples/SimpleReceiver/SimpleReceiver.ino#L33):
+
+```c++
+#define DECODE_NEC
+//#define DECODE_DENON
+#include
+```
+
+
+# Features
+- Lots of tutorials and examples.
+- Actively maintained.
+- Allows receiving and sending of **raw timing data**.
+
+## New features with version 4.x
+- **Since 4.3 `IrSender.begin(DISABLE_LED_FEEDBACK)` will no longer work**, use `IrSender.begin(DISABLE_LED_FEEDBACK, 0)` instead.
+- New universal **Pulse Distance / Pulse Width / Pulse Distance Width decoder** added, which covers many previous unknown protocols.
+- Printout of code how to send received command by `IrReceiver.printIRSendUsage(&Serial)`.
+- RawData type is now 64 bit for 32 bit platforms and therefore `decodedIRData.decodedRawData` can contain complete frame information for more protocols than with 32 bit as before.
+- **Callback** after receiving a command - It calls your code as soon as a message was received.
+- Improved handling of `PULSE_DISTANCE` + `PULSE_WIDTH` protocols.
+- New FAST protocol.
+- Automatic printout of the **corresponding send function** with `printIRSendUsage()`.
+
+#### Converting your 3.x program to the 4.x version
+- You must replace `#define DECODE_DISTANCE` by `#define DECODE_DISTANCE_WIDTH` (only if you explicitly enabled this decoder).
+- The parameter `bool hasStopBit` is not longer required and removed e.g. for function `sendPulseDistanceWidth()`.
+
+## New features with version 3.x
+- **Any pin** can be used for receiving and if `SEND_PWM_BY_TIMER` is not defined also for sending.
+- Feedback LED can be activated for sending / receiving.
+- An 8/16 bit ****command** value as well as an 16 bit **address** and a protocol number is provided for decoding (instead of the old 32 bit value).
+- Protocol values comply to **protocol standards**.
+ NEC, Panasonic, Sony, Samsung and JVC decode & send LSB first.
+- Supports **Universal Distance protocol**, which covers a lot of previous unknown protocols.
+- Compatible with **tone()** library. See the [ReceiveDemo](https://github.com/Arduino-IRremote/Arduino-IRremote/blob/21b5747a58e9d47c9e3f1beb056d58c875a92b47/examples/ReceiveDemo/ReceiveDemo.ino#L159-L169) example.
+- Simultaneous sending and receiving. See the [SendAndReceive](https://github.com/Arduino-IRremote/Arduino-IRremote/blob/master/examples/SendAndReceive/SendAndReceive.ino#L167-L170) example.
+- Supports **more platforms**.
+- Allows for the generation of non PWM signal to just **simulate an active low receiver signal** for direct connect to existent receiving devices without using IR.
+- Easy protocol configuration, **directly in your [source code](https://github.com/Arduino-IRremote/Arduino-IRremote/blob/master/examples/SimpleReceiver/SimpleReceiver.ino#L33-L57)**.
+ Reduces memory footprint and decreases decoding time.
+- Contains a [very small NEC only decoder](https://github.com/Arduino-IRremote/Arduino-IRremote?tab=readme-ov-file#minimal-nec-receiver), which **does not require any timer resource**.
+
+[-> Feature comparison of 5 Arduino IR libraries](https://github.com/Arduino-IRremote/Arduino-IRremote?tab=readme-ov-file#quick-comparison-of-5-arduino-ir-receiving-libraries).
+
+
+
+# Converting your 2.x program to the 4.x version
+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**.
+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.
+
+- **IRreceiver** and **IRsender** object have been added and can be used without defining them, like the well known Arduino **Serial** object.
+- Just remove the line `IRrecv IrReceiver(IR_RECEIVE_PIN);` and/or `IRsend IrSender;` in your program, and replace all occurrences of `IRrecv.` or `irrecv.` with `IrReceiver` and replace all `IRsend` or `irsend` with `IrSender`.
+- Since the decoded values are now in `IrReceiver.decodedIRData` and not in `results` any more, remove the line `decode_results results` or similar.
+- Like for the Serial object, call [`IrReceiver.begin(IR_RECEIVE_PIN, ENABLE_LED_FEEDBACK)`](https://github.com/Arduino-IRremote/Arduino-IRremote/blob/master/examples/ReceiveDemo/ReceiveDemo.ino#L106)
+ or `IrReceiver.begin(IR_RECEIVE_PIN, DISABLE_LED_FEEDBACK)` instead of the `IrReceiver.enableIRIn()` or `irrecv.enableIRIn()` in setup().
+For sending, call `IrSender.begin();` in setup().
+If IR_SEND_PIN is not defined (before the line `#include `) you must use e.g. `IrSender.begin(3, ENABLE_LED_FEEDBACK, USE_DEFAULT_FEEDBACK_LED_PIN);`
+- Old `decode(decode_results *aResults)` function is replaced by simple `decode()`. So if you have a statement `if(irrecv.decode(&results))` replace it with `if (IrReceiver.decode())`.
+- The decoded result is now in in `IrReceiver.decodedIRData` and not in `results` any more, therefore replace any occurrences of `results.value` and `results.decode_type` (and similar) to
+ `IrReceiver.decodedIRData.decodedRawData` and `IrReceiver.decodedIRData.protocol`.
+- Overflow, Repeat and other flags are now in [`IrReceiver.receivedIRData.flags`](https://github.com/Arduino-IRremote/Arduino-IRremote/blob/master/src/IRProtocol.h#L90-L101).
+- Seldom used: `results.rawbuf` and `results.rawlen` must be replaced by `IrReceiver.decodedIRData.rawDataPtr->rawbuf` and `IrReceiver.decodedIRData.rawDataPtr->rawlen`.
+
+- The 5 protocols **NEC, Panasonic, Sony, Samsung and JVC** have been converted to LSB first. Send functions for sending old MSB data were renamed to `sendNECMSB`, `sendSamsungMSB()`, `sendSonyMSB()` and `sendJVCMSB()`. The old `sendSAMSUNG()` and `sendSony()` MSB functions are still available. The old MSB version of `sendPanasonic()` function was deleted, since it had bugs nobody recognized and therfore was assumed to be never used.
+For converting MSB codes to LSB see [below](https://github.com/Arduino-IRremote/Arduino-IRremote?tab=readme-ov-file#how-to-convert-old-msb-first-32-bit-ir-data-codes-to-new-lsb-first-32-bit-ir-data-codes).
+
+### Example
+#### Old 2.x program:
+
+```c++
+#include
+#define RECV_PIN 2
+
+IRrecv irrecv(RECV_PIN);
+decode_results results;
+
+void setup()
+{
+...
+ Serial.begin(115200); // Establish serial communication
+ irrecv.enableIRIn(); // Start the receiver
+}
+
+void loop() {
+ if (irrecv.decode(&results)) {
+ Serial.println(results.value, HEX);
+ ...
+ irrecv.resume(); // Receive the next value
+ }
+ ...
+}
+```
+
+#### New 4.x program:
+
+```c++
+#include
+#define IR_RECEIVE_PIN 2
+
+void setup()
+{
+...
+ Serial.begin(115200); // // Establish serial communication
+ IrReceiver.begin(IR_RECEIVE_PIN, ENABLE_LED_FEEDBACK); // Start the receiver
+}
+
+void loop() {
+ if (IrReceiver.decode()) {
+ Serial.println(IrReceiver.decodedIRData.decodedRawData, HEX); // Print "old" raw data
+ IrReceiver.printIRResultShort(&Serial); // Print complete received data in one line
+ IrReceiver.printIRSendUsage(&Serial); // Print the statement required to send this data
+ ...
+ IrReceiver.resume(); // Enable receiving of the next value
+ }
+ ...
+}
+```
+
+## How to convert old MSB first 32 bit IR data codes to new LSB first 32 bit IR data codes
+For the new decoders for **NEC, Panasonic, Sony, Samsung and JVC**, the result `IrReceiver.decodedIRData.decodedRawData` is now **LSB-first**, as the definition of these protocols suggests!
+
+To convert one into the other, you must reverse the byte/nibble positions and then reverse all bit positions of each byte/nibble or write it as one binary string and reverse/mirror it.
+Example:
+`0xCB 34 01 02`
+`0x20 10 43 BC` after nibble reverse
+`0x40 80 2C D3` after bit reverse of each nibble
+### Nibble reverse map:
+```
+ 0->0 1->8 2->4 3->C
+ 4->2 5->A 6->6 7->E
+ 8->1 9->9 A->5 B->D
+ C->3 D->B E->7 F->F
+```
+`0xCB340102` is binary `1100 1011 0011 0100 0000 0001 0000 0010`.
+`0x40802CD3` is binary `0100 0000 1000 0000 0010 1100 1101 0011`.
+If you **read the first binary sequence backwards** (right to left), you get the second sequence.
+You may use `bitreverseOneByte()` or `bitreverse32Bit()` for this.
+
+Sending old MSB codes without conversion can be done by using `sendNECMSB()`, `sendSonyMSB()`, `sendSamsungMSB()`, `sendJVCMSB()`.
+
+
+
+# Errors with using the 4.x versions for old tutorials
+If you suffer from errors with old tutorial code including `IRremote.h` instead of `IRremote.hpp`, just try to rollback to [Version 2.4.0](https://github.com/Arduino-IRremote/Arduino-IRremote/releases/tag/v2.4.0).
+Most likely your code will run and you will not miss the new features.
+
+
+
+## Staying on 2.x
+Consider using the [original 2.4 release form 2017](https://github.com/Arduino-IRremote/Arduino-IRremote/releases/tag/v2.4.0)
+or the last backwards compatible [2.8 version](https://github.com/Arduino-IRremote/Arduino-IRremote/releases/tag/2.8.0) for you project.
+It may be sufficient and deals flawlessly with 32 bit IR codes.
+If this doesn't fit your case, be assured that 4.x is at least trying to be backwards compatible, so your old examples should still work fine.
+
+### Drawbacks of using 2.x
+- Only the following decoders are available:
+ ` NEC ` ` Denon ` ` Panasonic ` ` JVC ` ` LG `
+ ` RC5 ` ` RC6 ` ` Samsung ` ` Sony `
+- The call of `irrecv.decode(&results)` uses the old MSB first decoders like in 2.x and sets the 32 bit codes in `results.value`.
+- No decoding to a more meaningful (constant) 8/16 bit address and 8 bit command.
+
+
+
+# Why *.hpp instead of *.cpp?
+**Every \*.cpp file is compiled separately** by a call of the compiler exclusively for this cpp file. These calls are managed by the IDE / make system.
+In the Arduino IDE the calls are executed when you click on *Verify* or *Upload*.
+
+And now our problem with Arduino is:
+**How to set [compile options](#compile-options--macros-for-this-library) for all *.cpp files, especially for libraries used?**
+IDE's like [Sloeber](https://github.com/ArminJo/ServoEasing#modifying-compile-options--macros-with-sloeber-ide) or [PlatformIO](https://github.com/ArminJo/ServoEasing#modifying-compile-options--macros-with-platformio) support this by allowing to specify a set of options per project.
+They add these options at each compiler call e.g. `-DTRACE`.
+
+But Arduino lacks this feature.
+So the **workaround** is not to compile all sources separately, but to concatenate them to one huge source file by including them in your source.
+This is done by e.g. `#include "IRremote.hpp"`.
+
+But why not `#include "IRremote.cpp"`?
+Try it and you will see tons of errors, because each function of the *.cpp file is now compiled twice,
+first by compiling the huge file and second by compiling the *.cpp file separately, like described above.
+So using the extension *cpp* is not longer possible, and one solution is to use *hpp* as extension, to show that it is an included *.cpp file.
+Every other extension e.g. *cinclude* would do, but *hpp* seems to be common sense.
+
+# Using the new *.hpp files
+In order to support [compile options](#compile-options--macros-for-this-library) more easily,
+you must use the statement `#include ` instead of `#include ` in your main program (aka *.ino file with setup() and loop()).
+
+In **all other files** you must use the following, to **prevent `multiple definitions` linker errors**:
+
+```c++
+#define USE_IRREMOTE_HPP_AS_PLAIN_INCLUDE
+#include
+```
+
+**Ensure that all macros in your main program are defined before any** `#include `.
+The following macros will definitely be overridden with default values otherwise:
+- `RAW_BUFFER_LENGTH`
+- `IR_SEND_PIN`
+- `SEND_PWM_BY_TIMER`
+
+
+
+# 3 ways to specify an IR code
+There are 3 different ways of specifying a particular IR code.
+
+## 1. Timing
+The timing of each mark/pulse and space/distance_between_pulses is specified in a list or array.
+This enables specifying **all IR codes**, but requires a lot of memory and is **not readable at all**.
+One formal definition of such a timing array, including **specification of frequency and repeats** is the [**Pronto** format](http://www.harctoolbox.org/Glossary.html#ProntoSemantics).
+Memory can be saved by using a lower time resolution.
+For IRremote you can use a 50 µs resolution which halves the memory requirement by using byte values instead of int16 values.
+For receiving purposes you can use the **hash of the timing** provided by the `decodeHash()` decoder.
+
+## 2. Encoding schemes
+There are 3 main encoding schemes which encodes a binary bitstream / hex value:
+1. `PULSE_DISTANCE`. The distance between pulses determines the bit value. This requires always a stop bit!
+Examples are NEC and KASEIKYO protocols. The pulse width is constant for most protocols.
+2. `PULSE_WIDTH`. The width of a pulse determines the bit value, pulse distance is constant. This requires no stop bit!
+The only known example is the SONY protocol.
+3. [Phase / Manchester encoding](https://en.wikipedia.org/wiki/Manchester_code).
+The time of the pulse/pause transition (phase) relative to the clock determines the bit value. Examples are RC5 and RC6 protocols.
+
+Phase encoding has a **constant bit length**, `PULSE_DISTANCE` with constant pulse width and `PULSE_WIDTH` have **no constant bit length**!
+
+A well known example for `PULSE_DISTANCE` with non constant pulse width encoding is the **RS232 serial encoding**.
+Here the non constant pulse width is used to enable a **constant bit length**.
+
+Most IR signals have a **special header** to help in setting the automatic gain of the receiver circuit.
+This header is not part of the encoding, but is often significant for a special protocol and therefore must be reproducible.
+
+Be aware that there are codes using a `PULSE_DISTANCE` encoding where more than a binary 0/1 is put into a pulse/pause combination.
+This requires more than 2 different pulse or pause length combinations.
+The [HobToHood protocol](https://github.com/Arduino-IRremote/Arduino-IRremote/blob/master/examples/ReceiveAndSendHob2Hood/ReceiveAndSendHob2Hood.ino) uses such an encoding.
+
+Using encoding schemes reduces the specification of an IR code to a bitstream / hex value, which is LSB by default and pulse / pause timings of header, 0, and 1.
+The hex value is **quite readable**.
+These schemes can not put any semantics like address, command or checksum on this bitstream.
+
+## 3. Protocols
+There are a few common protocols that are implemented directly in IRremote.
+They specify the frequency, the timings of header, 0, and 1 as well as other values like checksum, repeat distance, repeat coding, bit toggling etc.
+The semantics of the hex value is also specified, allowing the usage of only 2 parameters **address** and **command** to specify an IR code.
+This saves memory and is **highly readable**.
+Often the address is also constant, which further reduces memory requirements.
+
+
+# IRReceiver pinouts
+
+
+[Adafruit IR Sensor tutorial](https://learn.adafruit.com/ir-sensor)
+
+
+# Receiving IR codes
+In your program you check for a **completely received IR frame** with:
+`if (IrReceiver.decode()) {}`
+This also decodes the received data.
+After successful decoding, the IR data is contained in the IRData structure, available as `IrReceiver.decodedIRData`.
+
+## decodedIRData structure
+```c++
+struct IRData {
+ decode_type_t protocol; // UNKNOWN, NEC, SONY, RC5, PULSE_DISTANCE, ...
+ uint16_t address; // Decoded address
+ uint16_t command; // Decoded command
+ uint16_t extra; // Used for Kaseikyo unknown vendor ID. Ticks used for decoding Distance protocol.
+ uint16_t numberOfBits; // Number of bits received for data (address + command + parity) - to determine protocol length if different length are possible.
+ uint8_t flags; // IRDATA_FLAGS_IS_REPEAT, IRDATA_FLAGS_WAS_OVERFLOW etc. See IRDATA_FLAGS_* definitions
+ IRRawDataType decodedRawData; // Up to 32 (64 bit for 32 bit CPU architectures) bit decoded raw data, used for sendRaw functions.
+ uint32_t decodedRawDataArray[RAW_DATA_ARRAY_SIZE]; // 32 bit decoded raw data, to be used for send function.
+ irparams_struct *rawDataPtr; // Pointer of the raw timing data to be decoded. Mainly the data buffer filled by receiving ISR.
+};
+```
+#### Flags
+This is the [list of flags](https://github.com/Arduino-IRremote/Arduino-IRremote/blob/master/src/IRProtocol.h#L88) contained in the flags field.
+Check it with e.g. `if(IrReceiver.decodedIRData.flags & IRDATA_FLAGS_IS_REPEAT)`.
+
+| Flag name | Description |
+|:---|----|
+| IRDATA_FLAGS_IS_REPEAT | The gap between the preceding frame is as smaller than the maximum gap expected for a repeat. !!!We do not check for changed command or address, because it is almost not possible to press 2 different buttons on the remote within around 100 ms!!!
+| IRDATA_FLAGS_IS_AUTO_REPEAT | The current repeat frame is a repeat, that is always sent after a regular frame and cannot be avoided. Only specified for protocols DENON, and LEGO. |
+| IRDATA_FLAGS_PARITY_FAILED | The current (autorepeat) frame violated parity check. |
+| IRDATA_FLAGS_TOGGLE_BIT | Is set if RC5 or RC6 toggle bit is set. |
+| IRDATA_FLAGS_EXTRA_INFO | There is extra info not contained in address and data (e.g. Kaseikyo unknown vendor ID, or in decodedRawDataArray). |
+| IRDATA_FLAGS_WAS_OVERFLOW | Too many marks and spaces for the specified `RAW_BUFFER_LENGTH`. To avoid endless flagging of overflow, irparams.rawlen is set to 0 in this case. |
+| IRDATA_FLAGS_IS_MSB_FIRST | This value is mainly determined by the (known) protocol. |
+
+#### To access the **RAW data**, use:
+```c++
+auto myRawdata= IrReceiver.decodedIRData.decodedRawData;
+```
+
+The definitions for the `IrReceiver.decodedIRData.flags` are described [here](https://github.com/Arduino-IRremote/Arduino-IRremote/blob/master/src/IRremoteInt.h#L128-L140).
+
+#### Print all fields:
+```c++
+IrReceiver.printIRResultShort(&Serial);
+```
+
+#### Print the raw timing data received:
+```c++
+IrReceiver.printIRResultRawFormatted(&Serial, true);`
+```
+The raw data depends on the internal state of the Arduino timer in relation to the received signal and might therefore be slightly different each time. (resolution problem). The decoded values are the interpreted ones which are tolerant to such slight differences!
+
+#### Print how to send the received data:
+```c++
+IrReceiver.printIRSendUsage(&Serial);
+```
+
+## Ambiguous protocols
+### NEC, Extended NEC, ONKYO
+The **NEC protocol** is defined as 8 bit address and 8 bit command. But the physical address and data fields are each 16 bit wide.
+The additional 8 bits are used to send the inverted address or command for parity checking.
+The **extended NEC protocol** uses the additional 8 parity bit of address for a 16 bit address, thus disabling the parity check for address.
+The **ONKYO protocol** in turn uses the additional 8 parity bit of address and command for a 16 bit address and command.
+
+The decoder reduces the 16 bit values to 8 bit ones if the parity is correct.
+If the parity is not correct, it assumes no parity error, but takes the values as 16 bit values without parity assuming extended NEC or extended NEC protocol protocol.
+
+But now we have a problem when we want to receive e.g. the **16 bit** address 0x00FF or 0x32CD!
+The decoder interprets this as a NEC 8 bit address 0x00 / 0x32 with correct parity of 0xFF / 0xCD and reduces it to 0x00 / 0x32.
+
+One way to handle this, is to force the library to **always** use the ONKYO protocol interpretation by using `#define DECODE_ONKYO`.
+Another way is to check if `IrReceiver.decodedIRData.protocol` is NEC and not ONKYO and to revert the parity reducing manually.
+
+### NEC, NEC2
+On a long press, the **NEC protocol** does not repeat its frame, it sends a special short repeat frame.
+This enables an easy distinction between long presses and repeated presses and saves a bit of battery energy.
+This behavior is quite unique for NEC and its derived protocols like LG and Samsung.
+
+But of course there are also remote control systems, that uses the NEC protocol but only repeat the first frame when a long press is made instead of sending the special short repeat frame. We named this the **NEC2** protocol and it is sent with `sendNEC2()`.
+But be careful, the NEC2 protocol can only be detected by the NEC library decoder **after** the first frame and if you do a long press!
+
+### Samsung, SamsungLG
+On a long press, the **SamsungLG protocol** does not repeat its frame, it sends a special short repeat frame.
+
+## RAM usage of different protocols
+The `RAW_BUFFER_LENGTH` determines the length of the **byte buffer** where the received IR timing data is stored before decoding.
+**100** is sufficient for standard protocols **up to 48 bits**, with 1 bit consisting of one mark and space.
+We always require additional 4 btes, 1 byte for initial gap, 2 bytes for header and 1 byte for stop bit.
+- **48** bit protocols are PANASONIC, KASEIKYO, SAMSUNG48, RC6.
+- **32** bit protocols like NEC, SAMSUNG, WHYNTER, SONY(20), LG(28) require a **buffer length of 68**.
+- **16** bit protocols like BOSEWAVE, DENON, FAST, JVC, LEGO_PF, RC5, SONY(12 or 15) require a **buffer length of 36**.
+- MAGIQUEST requires a buffer length of **112**.
+- Air conditioners often send a longer protocol data stream **up to 750 bits**.
+
+If the record gap determined by `RECORD_GAP_MICROS` is changed from the default 8 ms to more than 20 ms, the buffer is no longer a byte but a uint16_t buffer, requiring twice as much RAM.
+
+
+## Handling unknown Protocols
+### Disclaimer
+**This library was designed to fit inside MCUs with relatively low levels of resources and was intended to work as a library together with other applications which also require some resources of the MCU to operate.**
+
+Use the **ReceiveDemo example** to print out all informations about your IR protocol.
+The **ReceiveDump example** gives you more information but has bad repeat detection due to the time required for printing the information.
+
+### Other libraries
+#### IRMP
+If your protocol seems not to be supported by this library, you may try the [IRMP library](https://github.com/IRMP-org/IRMP), which especially supports manchester protocols much better.
+
+#### IRremoteESP8266
+For **air conditioners** , you may try the [IRremoteESP8266 library](https://github.com/crankyoldgit/IRremoteESP8266), which supports an impressive set of protocols and a lot of air conditioners and works also on ESP32.
+
+#### rawirdecode and HeatpumpIR
+[Raw-IR-decoder-for-Arduino](https://github.com/ToniA/Raw-IR-decoder-for-Arduino) is not a library, but an arduino example sketch, which provides many methods of decoding especially **air conditioner** protocols. Sending of these protocols can be done by the Arduino library [HeatpumpIR](https://github.com/ToniA/arduino-heatpumpir).
+
+
+### Protocol=PULSE_DISTANCE
+If you get something like this:
+```
+PULSE_DISTANCE: HeaderMarkMicros=8900 HeaderSpaceMicros=4450 MarkMicros=550 OneSpaceMicros=1700 ZeroSpaceMicros=600 NumberOfBits=56 0x43D8613C 0x3BC3BC
+```
+then you have a code consisting of **56 bits**, which is probably from an air conditioner remote.
+You can send it with `sendPulseDistanceWidth()`.
+```c++
+uint32_t tRawData[] = { 0xB02002, 0xA010 };
+IrSender.sendPulseDistance(38, 3450, 1700, 450, 1250, 450, 400, &tRawData[0], 48, false, 0, 0);
+```
+You can send it with calling `sendPulseDistanceWidthData()` twice, once for the first 32 bit and next for the remaining 24 bits.
+The `PULSE_DISTANCE` / `PULSE_WIDTH` decoder just decodes a timing stream to a bitstream stored as hex values.
+These decoders can not put any semantics like address, command or checksum on this bitstream.
+But the bitstream is way more readable, than a timing stream. This bitstream is read **LSB first by default**.
+If LSB does not suit for further research, you can change it [here](https://github.com/Arduino-IRremote/Arduino-IRremote/blob/master/src/ir_DistanceProtocol.hpp#L78).
+
+**If RAM is not more than 2k, the decoder only accepts mark or space durations up to 2500 microseconds to save RAM space, otherwise it accepts durations up to 10 ms.**
+
+### Protocol=UNKNOWN
+If you see something like `Protocol=UNKNOWN Hash=0x13BD886C 35 bits received` as output of e.g. the ReceiveDemo example, you either have a problem with decoding a protocol, or an unsupported protocol.
+
+- If you have an **odd number of bits** received, your receiver circuit probably has problems. Maybe because the IR signal is too weak.
+- If you see timings like `+ 600,- 600 + 550,- 150 + 200,- 100 + 750,- 550` then one 450 µs space was split into two 150 and 100 µs spaces with a spike / error signal of 200 µs between. Maybe because of a defective receiver or a weak signal in conjunction with another light emitting source nearby.
+- If you see timings like `+ 500,- 550 + 450,- 550 + 450,- 500 + 500,-1550`, then marks are generally shorter than spaces and therefore `MARK_EXCESS_MICROS` (specified in your ino file) should be **negative** to compensate for this at decoding.
+- If you see `Protocol=UNKNOWN Hash=0x0 1 bits received` it may be that the space after the initial mark is longer than [`RECORD_GAP_MICROS`](https://github.com/Arduino-IRremote/Arduino-IRremote/blob/master/src/IRremote.h#L124).
+ This was observed for some LG air conditioner protocols. Try again with a line e.g. `#define RECORD_GAP_MICROS 12000` before the line `#include ` in your .ino file.
+- To see more info supporting you to find the reason for your UNKNOWN protocol, you must enable the line `//#define DEBUG` in IRremoteInt.h.
+
+### How to deal with protocols not supported by IRremote
+If you do not know which protocol your IR transmitter uses, you have several choices.
+- Just use the hash value to decide which command was received. See the [SimpleReceiverForHashCodes example](https://github.com/Arduino-IRremote/Arduino-IRremote/blob/master/examples/SimpleReceiverForHashCodes/SimpleReceiverForHashCodes.ino).
+- Use the [IRreceiveDemo example](examples/ReceiveDemo) or [IRreceiveDump example](examples/ReceiveDump) to dump out the IR timing.
+ You can then reproduce/send this timing with the [SendRawDemo example](examples/SendRawDemo).
+- The [IRMP AllProtocol example](https://github.com/IRMP-org/IRMP#allprotocol-example) prints the protocol and data for one of the **[40 supported protocols](https://github.com/IRMP-org/IRMP?tab=readme-ov-file#list-of-protocols)**.
+ The same library can be used to send this codes.
+- If you have a bigger Arduino board at hand (> 100 kByte program memory) 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).
+- 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).
+
+
+
+# Sending IR codes
+If you have a device at hand which can generate the IR codes you want to work with (aka IR remote), **it is recommended** to receive the codes with the [ReceiveDemo example](https://github.com/Arduino-IRremote/Arduino-IRremote/blob/master/examples/ReceiveDemo/ReceiveDemo.ino), which will tell you on the serial output how to send them.
+
+```
+Protocol=LG Address=0x2 Command=0x3434 Raw-Data=0x23434E 28 bits MSB first
+Send with: IrSender.sendLG(0x2, 0x3434, );
+```
+You will discover that **the address is a constant** and the commands sometimes are sensibly grouped.
+If you are uncertain about the numbers of repeats to use for sending, **3** is a good starting point. If this works, you can check lower values afterwards.
+
+If you have enabled `DECODE_DISTANCE_WIDTH`, the code printed by `printIRSendUsage()` **differs between 8 and 32 bit platforms**, so it is best to run the receiving program on the same platform as the sending program.
+
+**All sending functions support the sending of repeats** if sensible.
+Repeat frames are sent at a fixed period determined by the protocol. e.g. 110 ms from start to start for NEC.
+Keep in mind, that **there is no delay after the last sent mark**.
+If you handle the sending of repeat frames by your own, you must insert sensible delays before the repeat frames to enable correct decoding.
+
+Sending old MSB codes without conversion can be done by using `sendNECMSB()`, `sendSonyMSB()`, `sendSamsungMSB()`, `sendJVCMSB()`.
+
+## Sending IRDB IR codes
+The codes found in the [Flipper-IRDB database](https://github.com/Lucaslhm/Flipper-IRDB) are quite straightforward to convert, because the also use the address / command scheme.
+Protocol matching is NECext -> NECext (or Onkyo), Samsung32 -> Samsung, SIRC20 -> Sony with 20 bits etc.
+
+The codes found in the [irdb database](https://github.com/probonopd/irdb/tree/master/codes) specify a **device**, a **subdevice** and a **function**.
+Most of the times, *device* and *subdevice* can be taken as upper and lower byte of the **address parameter** and *function* is the **command parameter** for the **new structured functions** with address, command and repeat-count parameters like e.g. `IrSender.sendNEC((device << 8) | subdevice, 0x19, 2)`.
+An **exact mapping** can be found in the [IRP definition files for IR protocols](https://github.com/probonopd/MakeHex/tree/master/protocols). "D" and "S" denotes device and subdevice and "F" denotes the function.
+
+## Send pin
+Any pin can be chosen as send pin, because the PWM signal is generated by default with software bit banging, since `SEND_PWM_BY_TIMER` is not active.
+On **ESP32** ledc channel 0 is used for generating the IR PWM.
+If `IR_SEND_PIN` is specified (as c macro), it reduces program size and improves send timing for AVR. If you want to use a variable to specify send pin e.g. with `setSendPin(uint8_t aSendPinNumber)`, you must disable this `IR_SEND_PIN` macro.
+Then you can change send pin at any time before sending an IR frame. See also [Compile options / macros for this library](https://github.com/Arduino-IRremote/Arduino-IRremote?tab=readme-ov-file#compile-options--macros-for-this-library).
+
+### List of public IR code databases
+http://www.harctoolbox.org/IR-resources.html
+
+## Flipper Zero
+[Flipper IRDB Database](https://github.com/Lucaslhm/Flipper-IRDB)
+
+| [Flipper decoding](https://github.com/flipperdevices/flipperzero-firmware/tree/release/lib/infrared/encoder_decoder) | [IRremote decoding](https://github.com/Arduino-IRremote/Arduino-IRremote/tree/master/src) |
+|-|-|
+| Samsung32 | Samsung |
+| NEC | NEC |
+| NECext | ONKYO |
+| [\\\\\\\\\](https://github.com/flipperdevices/flipperzero-firmware/blob/027ea9ea36da137144548295c016d99255af53c3/lib/infrared/encoder_decoder/kaseikyo/infrared_decoder_kaseikyo.c#L26)
and ID is MSB of address.
address: 8A 02 20 00
command: 56 03 00 00
-> **IRremote:**
Address 0x6A8, sendPanasonic (for 02 20) and Command 0x35 | \\\\\\\ |
+
+
+
+
+# Tiny NEC receiver and sender
+For applications only requiring NEC, NEC variants or FAST -see below- protocol, there is a special receiver / sender included,
+which has very **small code size of 500 bytes and does NOT require any timer**.
+
+Check out the [TinyReceiver](https://github.com/Arduino-IRremote/Arduino-IRremote?tab=readme-ov-file#tinyreceiver--tinysender) and [IRDispatcherDemo](https://github.com/Arduino-IRremote/Arduino-IRremote?tab=readme-ov-file#irdispatcherdemo) examples.
+Take care to include `TinyIRReceiver.hpp` or `TinyIRSender.hpp` instead of `IRremote.hpp`.
+
+### TinyIRReceiver usage
+```c++
+//#define USE_ONKYO_PROTOCOL // Like NEC, but take the 16 bit address and command each as one 16 bit value and not as 8 bit normal and 8 bit inverted value.
+//#define USE_FAST_PROTOCOL // Use FAST protocol instead of NEC / ONKYO
+#include "TinyIRReceiver.hpp"
+
+void setup() {
+ initPCIInterruptForTinyReceiver(); // Enables the interrupt generation on change of IR input signal
+}
+
+void loop() {
+ if (TinyReceiverDecode()) {
+ printTinyReceiverResultMinimal(&Serial);
+ }
+ // No resume() required :-)
+}
+```
+
+### TinyIRSender usage
+```c++
+#include "TinyIRSender.hpp"
+
+void setup() {
+ sendNEC(3, 0, 11, 2); // Send address 0 and command 11 on pin 3 with 2 repeats.
+}
+
+void loop() {}
+```
+
+Another tiny receiver and sender **supporting more protocols** can be found [here](https://github.com/LuisMiCa/IRsmallDecoder).
+
+# The FAST protocol
+The FAST protocol is a proprietary modified JVC protocol **without address, with parity and with a shorter header**.
+It is meant to have a quick response to the event which sent the protocol frame on another board.
+FAST takes **21 ms for sending** and is sent at a **50 ms period**.
+It has full 8 bit parity for error detection.
+
+### FAST protocol characteristics:
+- Bit timing is like JVC
+- The header is shorter, 3156 µs vs. 12500 µs
+- No address and 16 bit data, interpreted as 8 bit command and 8 bit inverted command, leading to a fixed protocol length of (6 + (16 * 3) + 1) * 526 = 55 * 526 = 28930 microseconds or 29 ms.
+- Repeats are sent as complete frames but in a 50 ms period / with a 21 ms distance.
+
+### Sending FAST protocol with IRremote
+```c++
+#define IR_SEND_PIN 3
+#include
+
+void setup() {
+ sendFAST(11, 2); // Send command 11 on pin 3 with 2 repeats.
+}
+
+void loop() {}
+```
+
+### Sending FAST protocol with TinyIRSender
+```c++
+#define USE_FAST_PROTOCOL // Use FAST protocol. No address and 16 bit data, interpreted as 8 bit command and 8 bit inverted command
+#include "TinyIRSender.hpp"
+
+void setup() {
+ sendFAST(3, 11, 2); // Send command 11 on pin 3 with 2 repeats.
+}
+
+void loop() {}
+```
+
+
+The FAST protocol can be received by IRremote and TinyIRReceiver.
+
+# FAQ and hints
+## Receiving stops after analogWrite() or tone() or after running a motor.
+The receiver sample interval of 50 µs is generated by a timer. On many boards this must be a [hardware timer](https://github.com/Arduino-IRremote/Arduino-IRremote?tab=readme-ov-file#timer-and-pin-usage).
+On some boards where a software timer is available, the software timer is used.
+Be aware that the hardware timer used for receiving should not be used for `analogWrite()`.
+Especially **motor** control often uses the `analogWrite()` function and will therefore stop the receiving if used on the pins indicated [here](https://github.com/Arduino-IRremote/Arduino-IRremote?tab=readme-ov-file#timer-and-pin-usage).
+On the Uno and other AVR boards the receiver timer ist the same as the tone timer. Thus receiving will stop after a `tone()` command.
+See [ReceiveDemo example](https://github.com/Arduino-IRremote/Arduino-IRremote/blob/b962db8f4e47408df01474a57f313f5a6bbe39a1/examples/ReceiveDemo/ReceiveDemo.ino#L257) how to deal with it, i.e. how to use `IrReceiver.restartTimer()`.
+
+## Receiving sets overflow flag.
+The flag `IRDATA_FLAGS_WAS_OVERFLOW` is set, if `RAW_BUFFER_LENGTH` is too small for all the marks and spaces of the protocol.
+This can happen on long protocol frames like the ones from air conditioner.
+It also can happen, if `RECORD_GAP_MICROS` is smaller than the real gap between a frame and thr repetition frame, thus interpreting both as one consecutive frame.
+Best is to dump the timing then, to see which reason holds.
+
+## Problems with Neopixels, FastLed etc.
+IRremote will not work right when you use **Neopixels** (aka WS2811/WS2812/WS2812B) or other libraries blocking interrupts for a longer time (> 50 µs).
+Whether you use the Adafruit Neopixel lib, or FastLED, interrupts get disabled on many lower end CPUs like the basic Arduinos for longer than 50 µs.
+In turn, this stops the IR interrupt handler from running when it needs to. See also this [video](https://www.youtube.com/watch?v=62-nEJtm070).
+
+One **workaround** is to wait for the IR receiver to be idle before you send the Neopixel data with `if (IrReceiver.isIdle()) { strip.show();}`.
+This **prevents at least breaking a running IR transmission** and -depending of the update rate of the Neopixel- may work quite well.
+There are some other solutions to this on more powerful processors,
+[see this page from Marc MERLIN](http://marc.merlins.org/perso/arduino/post_2017-04-03_Arduino-328P-Uno-Teensy3_1-ESP8266-ESP32-IR-and-Neopixels.html)
+
+## Does not work/compile with another library
+**Another library is only working/compiling** if you deactivate the line `IrReceiver.begin(IR_RECEIVE_PIN, ENABLE_LED_FEEDBACK);`.
+This is often due to **timer resource conflicts** with the other library. Please see [below](https://github.com/Arduino-IRremote/Arduino-IRremote?tab=readme-ov-file#timer-and-pin-usage).
+
+## Multiple IR receiver and sender
+**This library supports only one IR receiver and one IR sender object (IRrecv and IRsend) per CPU.**
+However since sending is a serial task, you can use `setSendPin()` to switch the pin to send, thus emulating multiple sender.
+The receiver uses a special **timer** triggered function, which reads the digital IR signal value from one pin every 50 µs.
+So **multiple IR receivers** can only be used by connecting the output pins of several IR receivers together.
+The IR receiver modules internally use an NPN transistor as output device with just a 30k resistor to VCC.
+This is basically an "open collector" and allows multiple output pins to be connected to one Arduino input pin.
+However, keep in mind that any weak / disturbed signal from one of the receivers will also interfere with a good signal from another receiver.
+
+## Increase strength of sent output signal
+**The best way to increase the IR power for free** is to use 2 or 3 IR diodes in series. One diode requires 1.2 volt at 20 mA or 1.5 volt at 100 mA so you can supply up to 3 diodes with a 5 volt output.
+To power **2 diodes** with 1.2 V and 20 mA and a 5 V supply, set the resistor to: (5 V - 2.4 V) -> 2.6 V / 20 mA = **130 Ω**.
+For **3 diodes** it requires 1.4 V / 20 mA = **70 Ω**.
+The actual current might be lower since of **loss at the AVR pin**. E.g. 0.3 V at 20 mA.
+If you do not require more current than 20 mA, there is no need to use an external transistor (at least for AVR chips).
+
+On my Arduino Nanos, I always use a 100 Ω series resistor and one IR LED :grinning:.
+
+## Minimal CPU clock frequency
+For receiving, the **minimal CPU clock frequency is 4 MHz**, since the 50 µs timer ISR (Interrupt Service Routine) takes around 12 µs on a 16 MHz ATmega.
+The TinyReceiver, which reqires no polling, runs with 1 MHz.
+For sending, the **default software generated PWM has problems on AVR running with 8 MHz**. The PWM frequency is around 30 instead of 38 kHz and RC6 is not reliable. You can switch to timer PWM generation by `#define SEND_PWM_BY_TIMER`.
+
+## Bang & Olufsen protocol
+The Bang & Olufsen protocol decoder is not enabled by default, i.e if no protocol is enabled explicitly by #define `DECODE_`. It must always be enabled explicitly by `#define DECODE_BEO`.
+This is because it has an **IR transmit frequency of 455 kHz** and therefore requires a different receiver hardware (TSOP7000).
+And because **generating a 455 kHz PWM signal is currently only implemented for `SEND_PWM_BY_TIMER`**, sending only works if `SEND_PWM_BY_TIMER` or `USE_NO_SEND_PWM` is defined.
+For more info, see [ir_BangOlufsen.hpp](https://github.com/Arduino-IRremote/Arduino-IRremote/blob/master/src/ir_BangOlufsen.hpp#L44).
+
+# Examples for this library
+The examples are available at File > Examples > Examples from Custom Libraries / IRremote.
+ In order to fit the examples to the 8K flash of ATtiny85 and ATtiny88, the [Arduino library ATtinySerialOut](https://github.com/ArminJo/ATtinySerialOut) is required for this CPU's.
+See also [DroneBot Workshop SimpleReceiver](https://dronebotworkshop.com/ir-remotes/#SimpleReceiver_Example_Code) and [SimpleSender](https://dronebotworkshop.com/ir-remotes/#SimpleSender_Example_Code).
+
+#### SimpleReceiver + SimpleSender
+The **[SimpleReceiver](https://github.com/Arduino-IRremote/Arduino-IRremote/blob/master/examples/SimpleReceiver/SimpleReceiver.ino)** and **[SimpleSender](https://github.com/Arduino-IRremote/Arduino-IRremote/blob/master/examples/SimpleSender/SimpleSender.ino)** examples are a good starting point.
+A simple example can be tested online with [WOKWI](https://wokwi.com/projects/338611596994544210).
+
+#### SimpleReceiverForHashCodes
+The **[SimpleReceiverForHashCodes](https://github.com/Arduino-IRremote/Arduino-IRremote/blob/master/examples/SimpleReceiver/SimpleReceiver.ino)** uses only the hash decoder.
+It converts all IR frames longer than 6 to a 32 bit hash code, thus enabling receiving of unknown protocols.
+See: http://www.righto.com/2010/01/using-arbitrary-remotes-with-arduino.html
+
+#### TinyReceiver + TinySender
+If **code size** or **timer usage** matters, look at these examples.
+The **[TinyReceiver](https://github.com/Arduino-IRremote/Arduino-IRremote/blob/master/examples/TinyReceiver/TinyReceiver.ino)** example uses the **TinyIRReceiver** library
+which can **only receive NEC, Extended NEC, ONKYO and FAST protocols, but does not require any timer**.
+They use pin change interrupt for on the fly decoding, which is the reason for the restricted protocol choice.
+TinyReceiver can be tested online with [WOKWI](https://wokwi.com/arduino/projects/339264565653013075).
+
+The **[TinySender](https://github.com/Arduino-IRremote/Arduino-IRremote/blob/master/examples/TinySender/TinySender.ino)** example uses the **TinyIRSender** library which can **only send NEC, ONKYO and FAST protocols**.
+It sends NEC protocol codes in standard format with 8 bit address and 8 bit command as in SimpleSender example. It has options to send using Extended NEC, ONKYO and FAST protocols.
+Saves 780 bytes program memory and 26 bytes RAM compared to SimpleSender, which does the same, but uses the IRRemote library (and is therefore much more flexible).
+
+#### SmallReceiver
+If the protocol is not NEC and code size matters, look at this [example](https://github.com/Arduino-IRremote/Arduino-IRremote/blob/master/examples/SmallReceiver/SmallReceiver.ino).
+
+#### ReceiveDemo + AllProtocolsOnLCD
+[ReceiveDemo](https://github.com/Arduino-IRremote/Arduino-IRremote/blob/master/examples/ReceiveDemo/ReceiveDemo.ino) receives all protocols and **generates a beep with the Arduino tone() function** on each packet received.
+Long press of one IR button (receiving of multiple repeats for one command) is detected.
+[AllProtocolsOnLCD](https://github.com/Arduino-IRremote/Arduino-IRremote/blob/master/examples/AllProtocolsOnLCD/AllProtocolsOnLCD.ino) additionally **displays the short result on a 1602 LCD**. The LCD can be connected parallel or serial (I2C).
+By connecting debug pin to ground, you can force printing of the raw values for each frame. The pin number of the debug pin is printed during setup, because it depends on board and LCD connection type.
+This example also serves as an **example how to use IRremote and tone() together**.
+
+#### ReceiveDump
+Receives all protocols and dumps the received signal in different flavors including Pronto format. Since the printing takes much time, repeat signals may be skipped or interpreted as UNKNOWN.
+
+#### SendDemo
+Sends all available protocols at least once.
+
+#### SendAndReceive
+Demonstrates **receiving while sending**.
+
+#### ReceiveAndSend
+Record and **play back last received IR signal** at button press. IR frames of known protocols are sent by the approriate protocol encoder. `UNKNOWN` protocol frames are stored as raw data and sent with `sendRaw()`.
+
+#### ReceiveAndSendDistanceWidth
+Try to decode each IR frame with the *universal* **DistanceWidth decoder**, store the data and send it on button press with `sendPulseDistanceWidthFromArray()`.
+If RAM is not more than 2k, the decoder only accepts mark or space durations up to 2500 microseconds to save RAM space, otherwise it accepts durations up to 10 ms.
+Storing data for distance width protocol requires 17 bytes.
+The ReceiveAndSend example requires 16 bytes for known protocol data and 37 bytes for raw data of e.g.NEC protocol.
+
+#### ReceiveOneAndSendMultiple
+Serves as a IR **remote macro expander**. Receives Samsung32 protocol and on receiving a specified input frame, it sends multiple Samsung32 frames with appropriate delays in between.
+This serves as a **Netflix-key emulation** for my old Samsung H5273 TV.
+
+#### IRDispatcherDemo
+Framework for **calling different functions of your program** for different IR codes.
+
+#### IRrelay
+**Control a relay** (connected to an output pin) with your remote.
+
+#### IRremoteExtensionTest
+[Example](https://github.com/Arduino-IRremote/Arduino-IRremote/blob/master/examples/IRremoteExtensionTest/IRremoteExtensionTest.ino) for a user defined class, which itself uses the IRrecv class from IRremote.
+
+#### SendLGAirConditionerDemo
+[Example](https://github.com/Arduino-IRremote/Arduino-IRremote/blob/master/examples/SendLGAirConditionerDemo/SendLGAirConditionerDemo.ino) for sending LG air conditioner IR codes controlled by Serial input.
+By just using the function `bool Aircondition_LG::sendCommandAndParameter(char aCommand, int aParameter)` you can control the air conditioner by any other command source.
+The file *acLG.h* contains the command documentation of the LG air conditioner IR protocol. Based on reverse engineering of the LG AKB73315611 remote.
+
+IReceiverTimingAnalysis can be tested online with [WOKWI](https://wokwi.com/projects/299033930562011656)
+Click on the receiver while simulation is running to specify individual IR codes.
+
+#### ReceiveAndSendHob2Hood
+[Example](https://github.com/Arduino-IRremote/Arduino-IRremote/blob/master/examples/SendLGAirConditionerDemo/ReceiveAndSendHobToHood.ino) for receiving and sending AEG / Elektrolux Hob2Hood protocol.
+
+#### ReceiverTimingAnalysis
+This [example](https://github.com/Arduino-IRremote/Arduino-IRremote/blob/master/examples/ReceiverTimingAnalysis/ReceiverTimingAnalysis.ino) analyzes the signal delivered by your IR receiver module.
+Values can be used to determine the stability of the received signal as well as a hint for determining the protocol.
+It also computes the `MARK_EXCESS_MICROS` value, which is the extension of the mark (pulse) duration introduced by the IR receiver module.
+It can be tested online with [WOKWI](https://wokwi.com/arduino/projects/299033930562011656).
+Click on the receiver while simulation is running to specify individual NEC IR codes.
+
+#### UnitTest
+ReceiveDemo + SendDemo in one program. Demonstrates **receiving while sending**.
+Here you see the delay of the receiver output (blue) from the IR diode input (yellow).
+
+
+# WOKWI online examples
+- [Simple receiver](https://wokwi.com/projects/338611596994544210)
+- [Simple toggle by IR key 5](https://wokwi.com/projects/338611596994544210)
+- [TinyReceiver](https://wokwi.com/arduino/projects/339264565653013075)
+- [ReceiverTimingAnalysis](https://wokwi.com/projects/299033930562011656)
+- [Receiver with LCD output and switch statement](https://wokwi.com/projects/298934082074575369)
+
+# IR control of a robot car
+This [example](https://github.com/ArminJo/PWMMotorControl?tab=readme-ov-file#basicircontrol) of the **Arduino PWMMotorControl library** controls the basic functions of a robot car using the IRremote library.
+It controls 2 PWM motor channels, 2 motors at each channel.
+[Here](https://www.instructables.com/Arduino-4WD-Car-Assembly-and-Code-With-Optional-In/) you can find the instructable for car assembly and code.
+
+IR_RobotCar with TL1838 IR receiver plugged into expansion board.
+
+
+
+
+# Issues and discussions
+- Do not open an issue without first testing some of the examples!
+- If you have a problem, please post the MCVE (Minimal Complete Verifiable Example) showing this problem. My experience is, that most of the times you will find the problem while creating this MCVE :smile:.
+- [Use code blocks](https://github.com/adam-p/markdown-here/wiki/Markdown-Cheatsheet#code); **it helps us to help you when we can read your code!**
+
+
+
+# Compile options / macros for this library
+To customize the library to different requirements, there are some compile options / macros available.
+These macros must be defined in your program **before** the line `#include ` to take effect.
+Modify them by enabling / disabling them, or change the values if applicable.
+
+| Name | Default value | Description |
+|-|-:|-|
+| `RAW_BUFFER_LENGTH` | 200 | Buffer size of raw input uint16_t buffer. Must be even! If it is too small, overflow flag will be set. 100 is sufficient for *regular* protocols of up to 48 bits, but for most air conditioner protocols a value of up to 750 is required. Use the ReceiveDump example to find smallest value for your requirements. A value of 200 requires 200 bytes RAM. |
+| `EXCLUDE_UNIVERSAL_PROTOCOLS` | disabled | Excludes the universal decoder for pulse distance width protocols and decodeHash (special decoder for all protocols) from `decode()`. Saves up to 1000 bytes program memory. |
+| `DECODE_` | all | Selection of individual protocol(s) to be decoded. You can specify multiple protocols. See [here](https://github.com/Arduino-IRremote/Arduino-IRremote/blob/master/src/IRremote.hpp#L98-L121) |
+| `DECODE_STRICT_CHECKS` | disabled | Check for additional required characteristics of protocol timing like length of mark for a constant mark protocol, where space length determines the bit value. Requires up to 194 additional bytes of program memory. |
+| `IR_REMOTE_DISABLE_RECEIVE_COMPLETE_CALLBACK` | disabled | Saves up to 60 bytes of program memory and 2 bytes RAM. |
+| `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. |
+| `RECORD_GAP_MICROS` | 5000 | 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 µs.
Must be smaller than any gap between a command and a repeat; e.g. the retransmission gap for Sony is around 24 ms.
Keep in mind, that this is the delay between the end of the received command and the start of decoding. |
+| `DISTANCE_WIDTH_DECODER_DURATION_ARRAY_SIZE` | 50 if RAM <= 2k, else 200 | A value of 200 allows to decode mark or space durations up to 10 ms. |
+| `IR_INPUT_IS_ACTIVE_HIGH` | disabled | Enable it if you use a RF receiver, which has an active HIGH output signal. |
+| `IR_SEND_PIN` | disabled | If specified, it reduces program size and improves send timing for AVR. If you want to use a variable to specify send pin e.g. with `setSendPin(uint8_t aSendPinNumber)`, you must not use / disable this macro in your source. |
+| `SEND_PWM_BY_TIMER` | disabled | Disables carrier PWM generation in software and use hardware PWM (by timer). Has the advantage of more exact PWM generation, especially the duty cycle (which is not very relevant for most IR receiver circuits), and the disadvantage of using a hardware timer, which in turn is not available for other libraries and to fix the send pin (but not the receive pin) at the [dedicated timer output pin(s)](https://github.com/Arduino-IRremote/Arduino-IRremote?tab=readme-ov-file#timer-and-pin-usage). Is enabled for ESP32 and RP2040 in all examples, since they support PWM gereration for each pin without using a shared resource (timer). |
+| `IR_SEND_DUTY_CYCLE_PERCENT` | 30 | Duty cycle of IR send signal. |
+| `USE_NO_SEND_PWM` | disabled | Uses no carrier PWM, just simulate an **active low** receiver signal. Used for transferring signal by cable instead of IR. Overrides `SEND_PWM_BY_TIMER` definition. |
+| `USE_OPEN_DRAIN_OUTPUT_FOR_SEND_PIN` | disabled | Uses or simulates 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! |
+| `USE_ACTIVE_HIGH_OUTPUT_FOR_SEND_PIN` | disabled | Only if `USE_NO_SEND_PWM` is enabled. Simulate an **active high** receiver signal instead of an active low signal. |
+| `DISABLE_CODE_FOR_RECEIVER` | disabled | Disables static receiver code like receive timer ISR handler and static IRReceiver and irparams data. Saves 450 bytes program memory and 269 bytes RAM if receiving functions are not required. |
+| `EXCLUDE_EXOTIC_PROTOCOLS` | disabled | Excludes BANG_OLUFSEN, BOSEWAVE, WHYNTER, FAST and LEGO_PF from `decode()` and from sending with `IrSender.write()`. Saves up to 650 bytes program memory. |
+| `FEEDBACK_LED_IS_ACTIVE_LOW` | disabled | Required on some boards (like my BluePill and my ESP8266 board), where the feedback LED is active low. |
+| `NO_LED_FEEDBACK_CODE` | disabled | Disables the LED feedback code for send and receive. Saves around 100 bytes program memory for receiving, around 500 bytes for sending and halving the receiver ISR (Interrupt Service Routine) processing time. |
+| `MICROS_PER_TICK` | 50 | Resolution of the raw input buffer data. Corresponds to 2 pulses of each 26.3 µs at 38 kHz. |
+| `TOLERANCE_FOR_DECODERS_MARK_OR_SPACE_MATCHING_PERCENT` | 25 | Relative tolerance for matchTicks(), matchMark() and matchSpace() functions used for protocol decoding. |
+| `DEBUG` | disabled | Enables lots of lovely debug output. |
+| `IR_USE_AVR_TIMER*` | | Selection of timer to be used for generating IR receiving sample interval. |
+
+These next macros for **TinyIRReceiver** must be defined in your program before the line `#include ` to take effect.
+| Name | Default value | Description |
+|-|-:|-|
+| `IR_RECEIVE_PIN` | 2 | The pin number for TinyIRReceiver IR input, which gets compiled in. |
+| `IR_FEEDBACK_LED_PIN` | `LED_BUILTIN` | The pin number for TinyIRReceiver feedback LED, which gets compiled in. |
+| `NO_LED_FEEDBACK_CODE` | disabled | Disables the feedback LED function. Saves 14 bytes program memory. |
+| `DISABLE_PARITY_CHECKS` | disabled | Disables the addres and command parity checks. Saves 48 bytes program memory. |
+| `USE_EXTENDED_NEC_PROTOCOL` | disabled | Like NEC, but take the 16 bit address as one 16 bit value and not as 8 bit normal and 8 bit inverted value. |
+| `USE_ONKYO_PROTOCOL` | disabled | Like NEC, but take the 16 bit address and command each as one 16 bit value and not as 8 bit normal and 8 bit inverted value. |
+| `USE_FAST_PROTOCOL` | disabled | Use FAST protocol (no address and 16 bit data, interpreted as 8 bit command and 8 bit inverted command) instead of NEC. |
+| `ENABLE_NEC2_REPEATS` | disabled | Instead of sending / receiving the NEC special repeat code, send / receive the original frame for repeat. |
+| `USE_CALLBACK_FOR_TINY_RECEIVER` | disabled | Call the fixed function `void handleReceivedTinyIRData()` each time a frame or repeat is received. |
+
+The next macro for **IRCommandDispatcher** must be defined in your program before the line `#include ` to take effect.
+| `USE_TINY_IR_RECEIVER` | disabled | Use [TinyReceiver](https://github.com/Arduino-IRremote/Arduino-IRremote?tab=readme-ov-file#tinyreceiver--tinysender) for receiving IR codes. |
+| `IR_COMMAND_HAS_MORE_THAN_8_BIT` | disabled | Enables mapping and dispatching of IR commands consisting of more than 8 bits. Saves up to 160 bytes program memory and 4 bytes RAM + 1 byte RAM per mapping entry. |
+| `BUZZER_PIN` | | If `USE_TINY_IR_RECEIVER` is enabled, the pin to be used for the optional 50 ms buzzer feedback before executing a command. Other IR libraries than Tiny are not compatible with tone() command. |
+
+### Changing include (*.h) files with Arduino IDE
+First, use *Sketch > Show Sketch Folder (Ctrl+K)*.
+If you have not yet saved the example as your own sketch, then you are instantly in the right library folder.
+Otherwise you have to navigate to the parallel `libraries` folder and select the library you want to access.
+In both cases the library source and include files are located in the libraries `src` directory.
+The modification must be renewed for each new library version!
+
+### Modifying compile options / macros with PlatformIO
+If you are using PlatformIO, you can define the macros in the *[platformio.ini](https://docs.platformio.org/en/latest/projectconf/section_env_build.html)* file with `build_flags = -D MACRO_NAME` or `build_flags = -D MACRO_NAME=macroValue`.
+
+### Modifying compile options / macros with Sloeber IDE
+If you are using [Sloeber](https://eclipse.baeyens.it) as your IDE, you can easily define global symbols with *Properties > Arduino > CompileOptions*.
+
+
+
+
+# Supported Boards
+**Issues and discussions with the content "Is it possible to use this library with the ATTinyXYZ? / board XYZ" without any reasonable explanations will be immediately closed without further notice.**
+For **ESP8266/ESP32**, [this library](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)
+
+Digispark boards are only tested with [ATTinyCore](https://github.com/SpenceKonde/ATTinyCore) using `New Style` pin mapping for the Digispark Pro board.
+ATtiny boards are only tested with [ATTinyCore](https://github.com/SpenceKonde/ATTinyCore#supported-devices) or [megaTinyCore](https://github.com/SpenceKonde/megaTinyCore).
+
+- Arduino Uno / Mega / Leonardo / Duemilanove / Diecimila / LilyPad / Mini / Fio / Nano etc.
+- Arduino Uno R4, but not yet tested, because of lack of a R4 board. **Sending does not work** on the `arduino:renesas_uno:unor4wifi`.
+- Teensy 1.0 / 1.0++ / 2.0 / 2++ / 3.0 / 3.1 / 3.2 / Teensy-LC - but [limited support](https://forum.pjrc.com/threads/65912-Enable-Continuous-Integration-with-arduino-cli-for-3-party-libraries); Credits: PaulStoffregen (Teensy Team)
+- Sanguino
+- ATmega8, 48, 88, 168, 328
+- ATmega8535, 16, 32, 164, 324, 644, 1284,
+- ATmega64, 128
+- ATmega4809 (Nano every)
+- ATtiny3217 (Tiny Core 32 Dev Board)
+- ATtiny84, 85, 167 (Digispark + Digispark Pro)
+- SAMD21 (Zero, MKR*, **but not SAMD51 and not DUE, the latter is SAM architecture**)
+- ESP8266
+- ESP32 (ESP32-C3 since board package 2.0.2 from Espressif)
+- Sparkfun Pro Micro
+- Nano Every, Uno WiFi Rev2, nRF5 BBC MicroBit, Nano33_BLE
+- BluePill with STM32
+- RP2040 based boards (Raspberry Pi Pico, Nano RP2040 Connect etc.)
+
+
+
+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.
+If you can provide **examples of using a periodic timer for interrupts** for the new board, and the board name for selection in the Arduino IDE, then you have way better chances to get your board supported by IRremote.
+
+
+
+# Timer and pin usage
+The **receiver sample interval of 50 µs is generated by a timer**. On many boards this must be a hardware timer. On some boards where a software timer is available, the software timer is used.
+On **ESP8266** `timer1` is used for receive interrupts, which makes it incompatible to the Servo and other libraries.
+On **ESP32** `hw_timer_t` is used for receive interrupts and `ledc` channel 0 is used for generating the IR PWM.
+
+Every pin can be used for receiving.
+If software PWM is selected, which is default, every pin can also be used for sending. Sending with software PWM does not require a timer!
+
+The TinyReceiver example uses the **TinyReceiver** library, which can **only receive NEC codes, but does not require any timer** and runs even on a 1 MHz ATtiny85.
+
+The code for the timer and the **timer selection** is located in [private/IRTimer.hpp](https://github.com/Arduino-IRremote/Arduino-IRremote/blob/master/src/private/IRTimer.hpp). The selected timer can be adjusted here.
+
+**Be aware that the hardware timer used for receiving should not be used for analogWrite()!**.
+
+| Board/CPU | Receive
& send PWM Timer
Default timer is **bold** | Hardware-Send-PWM Pin | analogWrite()
pins occupied by timer |
+|-|-|-|-|
+| [ATtiny84](https://github.com/SpenceKonde/ATTinyCore/blob/v2.0.0-devThis-is-the-head-submit-PRs-against-this/avr/extras/ATtiny_x4.md) | **1** | **6** | |
+| [ATtiny85 > 4 MHz](https://github.com/SpenceKonde/ATTinyCore/blob/v2.0.0-devThis-is-the-head-submit-PRs-against-this/avr/extras/ATtiny_x5.md) | **0**, 1 | **0**, 4 | **0**, 1 & 4 |
+| [ATtiny88 > 4 MHz](https://github.com/SpenceKonde/ATTinyCore/blob/v2.0.0-devThis-is-the-head-submit-PRs-against-this/avr/extras/ATtiny_x8.md) | **1** | **PB1 / 8** | **PB1 / 8 & PB2 / 9** |
+| [ATtiny167 > 4 MHz](https://github.com/SpenceKonde/ATTinyCore/blob/v2.0.0-devThis-is-the-head-submit-PRs-against-this/avr/extras/ATtiny_x7.md) | **1** | **9**, 8 - 15 | **8 - 15** |
+| [ATtiny1604](https://github.com/SpenceKonde/megaTinyCore/blob/master/megaavr/extras/ATtiny_x04.md) | **TCB0** | **PA05** |
+| [ATtiny1614, ATtiny816](https://github.com/SpenceKonde/megaTinyCore/blob/master/megaavr/extras/ATtiny_x14.md) | **TCA0** | **PA3** |
+| [ATtiny3217](https://github.com/SpenceKonde/megaTinyCore/blob/master/megaavr/extras/ATtiny_x17.md) | **TCA0**, TCD | % |
+| [ATmega8](https://github.com/MCUdude/MiniCore#supported-microcontrollers) | **1** | **9** |
+| [ATmega1284](https://github.com/MCUdude/MightyCore#supported-microcontrollers) | 1, **2**, 3 | 13, 14, 6 |
+| [ATmega164, ATmega324, ATmega644](https://github.com/MCUdude/MightyCore#supported-microcontrollers) | 1, **2** | 13, **14** |
+| [ATmega8535 ATmega16, ATmega32](https://github.com/MCUdude/MightyCore#supported-microcontrollers) | **1** | **13** |
+| [ATmega64, ATmega128, ATmega1281, ATmega2561](https://github.com/MCUdude/MegaCore#supported-microcontrollers) | **1** | **13** |
+| [ATmega8515, ATmega162](https://github.com/MCUdude/MajorCore#pinout ) | **1** | **13** |
+| ATmega168, **ATmega328** | 1, **2** | 9, **3** | 9 & 10, **3 & 11** |
+| ATmega1280, **ATmega2560** | 1, **2**, 3, 4, 5 | 5, 6, **9**, 11, 46 | 5, 6, **9**, 11, 46 |
+| ATmega4809 | **TCB0** | **A4** | |
+| Leonardo (Atmega32u4) | 1, 3, **4_HS** | 5, **9**, 13 | 5, **9**, 13 |
+| Zero (SAMD) | **TC3** | \*, **9** | |
+| [ESP8266](http://esp8266.net/) | **timer1** | % | |
+| [ESP32](http://esp32.net/) | **hw_timer_t**
**Ledc channel 0** | All pins | |
+| [Sparkfun Pro Micro](https://www.sparkfun.com/products/12640) | 1, **3** | **5**, 9 | |
+| [Teensy 1.0](https://www.pjrc.com/teensy/pinout.html) | **1** | **17** | 15, 18 |
+| [Teensy 2.0](https://www.pjrc.com/teensy/pinout.html) | 1, 3, **4_HS** | 9, **10**, 14 | 12 |
+| [Teensy++ 1.0 / 2.0](https://www.pjrc.com/teensy/pinout.html) | 1, **2**, 3 | **1**, 16, 25 | 0 |
+| [Teensy-LC](https://www.pjrc.com/teensy/pinout.html) | **TPM1** | **16** | 17 |
+| [Teensy 3.0 - 3.6](https://www.pjrc.com/teensy/pinout.html) | **CMT** | **5** | |
+| [Teensy 4.0 - 4.1](https://www.pjrc.com/teensy/pinout.html) | **FlexPWM1.3** | **8** | 7, 25 |
+| [BluePill / STM32F103C8T6](https://github.com/stm32duino/Arduino_Core_STM32) | **3** | % | **PA6 & PA7 & PB0 & PB1** |
+| [BluePill / STM32F103C8T6](https://stm32-base.org/boards/STM32F103C8T6-Blue-Pill) | **TIM4** | % | **PB6 & PB7 & PB8 & PB9** |
+| [RP2040 / Pi Pico](https://github.com/earlephilhower/arduino-pico) | [default alarm pool](https://raspberrypi.github.io/pico-sdk-doxygen/group__repeating__timer.html) | All pins | No pin |
+| [RP2040 / Mbed based](https://github.com/arduino/ArduinoCore-mbed) | Mbed Ticker | All pins | No pin |
+
+### No timer required for sending
+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 µs at 16 MHz, we always see a small jitter in the signal, which seems to be OK for the receivers.
+
+| Software generated PWM showing small jitter because of the limited resolution of 4 µs of the Arduino core `micros()` function for an ATmega328 | Detail (ATmega328 generated) showing 30% duty cycle |
+|-|-|
+|  |  |
+
+## Incompatibilities to other libraries and Arduino commands like tone() and analogWrite()
+If you use a library which requires the same timer as IRremote, you have a problem, since **the timer resource cannot be shared simultaneously** by both libraries.
+
+### Use NEC protocol and TinyReceiver
+[TinyReceiver](https://github.com/Arduino-IRremote/Arduino-IRremote?tab=readme-ov-file#tiny-nec-receiver-and-sender) does not require a timer, it relies on interrupts, thus avoiding any timer resource problems.
+
+### Change timer
+The best approach is to **change the timer** used for IRremote, which can be accomplished by specifying the timer before `#include `.
+The timer specifications available for your board can be found in [private/IRTimer.hpp](https://github.com/Arduino-IRremote/Arduino-IRremote/blob/master/src/private/IRTimer.hpp).
+
+```c++
+// Arduino Mega
+#elif defined(__AVR_ATmega1280__) || defined(__AVR_ATmega2560__)
+# if !defined(IR_USE_AVR_TIMER1) && !defined(IR_USE_AVR_TIMER2) && !defined(IR_USE_AVR_TIMER3) && !defined(IR_USE_AVR_TIMER4) && !defined(IR_USE_AVR_TIMER5)
+//#define IR_USE_AVR_TIMER1 // send pin = pin 11
+#define IR_USE_AVR_TIMER2 // send pin = pin 9
+//#define IR_USE_AVR_TIMER3 // send pin = pin 5
+//#define IR_USE_AVR_TIMER4 // send pin = pin 6
+//#define IR_USE_AVR_TIMER5 // send pin = pin 46
+# endif
+```
+Here you see the Arduino Mega board and the available specifications are `IR_USE_AVR_TIMER[1,2,3,4,5]`.
+You **just have to include a line** e.g. `#define IR_USE_AVR_TIMER3` before `#include ` to enable timer 3.
+
+But be aware that the new timer in turn might be again incompatible with other libraries or Arduino functions.
+For non AVR boards/platforms you must look for the appropriate section guarded by e.g. `#elif defined(ESP32)`.
+
+### Stop and start timer
+Another approach can be to share the timer **sequentially** if their functionality is used only for a short period of time like for the **Arduino tone() command**.
+An example can be seen [here](https://github.com/Arduino-IRremote/Arduino-IRremote/blob/21b5747a58e9d47c9e3f1beb056d58c875a92b47/examples/ReceiveDemo/ReceiveDemo.ino#L159-L169), where the IR timer is restarted after the tone has stopped.
+
+```c++
+IrReceiver.stopTimer(); // Stop timer consistently before calling tone() or other functions using the timer resource.
+tone(TONE_PIN, 2200, 8);
+delay(8);
+IrReceiver.restartTimer(); // Restart IR timer after timer resource is no longer blocked.
+```
+This works on AVR boards like Uno because each call to` tone()` completely initializes the timer 2 used by the `tone()` command.
+
+## Hardware-PWM signal generation for sending
+If you define `SEND_PWM_BY_TIMER`, the send PWM signal is forced to be generated by a hardware timer on most platforms.
+By default, the same timer as for the receiver is used.
+Since each hardware timer has its dedicated output pin(s), you must change timer or timer sub-specifications to change PWM output pin. See [private/IRTimer.hpp](https://github.com/Arduino-IRremote/Arduino-IRremote/blob/master/src/private/IRTimer.hpp)
+**Exeptions** are currently [ESP32, ARDUINO_ARCH_RP2040, PARTICLE and ARDUINO_ARCH_MBED](https://github.com/Arduino-IRremote/Arduino-IRremote/blob/39bdf8d7bf5b90dc221f8ae9fb3efed9f0a8a1db/examples/SimpleSender/PinDefinitionsAndMore.h#L273), where **PWM generation does not require a timer**.
+
+## Why do we use 30% duty cycle for sending
+We [do it](https://github.com/Arduino-IRremote/Arduino-IRremote/blob/master/src/IRSend.hpp#L1192) according to the statement in the [Vishay datasheet](https://www.vishay.com/docs/80069/circuit.pdf):
+- Carrier duty cycle 50 %, peak current of emitter IF = 200 mA, the resulting transmission distance is 25 m.
+- Carrier duty cycle 10 %, peak current of emitter IF = 800 mA, the resulting transmission distance is 29 m. - Factor 1.16
+The reason is, that it is not the pure energy of the fundamental which is responsible for the receiver to detect a signal.
+Due to automatic gain control and other bias effects, high intensity of the 38 kHz pulse counts more than medium intensity (e.g. 50% duty cycle) at the same total energy.
+
+
+
+# How we decode signals
+The IR signal is sampled at a **50 µs interval**. For a constant 525 µs pulse or pause we therefore get 10 or 11 samples, each with 50% probability.
+And believe me, if you send a 525 µs signal, your receiver will output something between around 400 and 700 µs!
+Therefore **we decode by default with a +/- 25% margin** using the formulas [here](https://github.com/Arduino-IRremote/Arduino-IRremote/blob/master/src/IRremoteInt.h#L376-L399).
+E.g. for the NEC protocol with its 560 µs unit length, we have TICKS_LOW = 8.358 and TICKS_HIGH = 15.0. This means, we accept any value between 8 ticks / 400 µs and 15 ticks / 750 µs (inclusive) as a mark or as a zero space. For a one space we have TICKS_LOW = 25.07 and TICKS_HIGH = 45.0.
+And since the receivers generated marks are longer or shorter than the spaces,
+we have introduced the [`MARK_EXCESS_MICROS`](https://github.com/Arduino-IRremote/Arduino-IRremote?tab=readme-ov-file#compile-options--macros-for-this-library) macro
+to compensate for this receiver (and signal strength as well as ambient light dependent :disappointed: ) specific deviation.
+Welcome to the world of **real world signal processing**.
+
+
+
+# NEC encoding diagrams
+Created with sigrok PulseView with IR_NEC decoder by DjordjeMandic.
+8 bit address NEC code
+
+16 bit address NEC code
+
+
+
+
+# Quick comparison of 5 Arduino IR receiving libraries
+**This is a short comparison and may not be complete or correct.**
+
+I created this comparison matrix for [myself](https://github.com/ArminJo) in order to choose a small IR lib for my project and to have a quick overview, when to choose which library.
+It is dated from **24.06.2022** and updated 10/2023. If you have complains about the data or request for extensions, please send a PM or open a discussion.
+
+[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)**.
+
+| Subject | [IRMP](https://github.com/IRMP-org/IRMP) | [IRLremote](https://github.com/NicoHood/IRLremote) | [IRLib2](https://github.com/cyborg5/IRLib2)
**mostly unmaintained** | [IRremote](https://github.com/Arduino-IRremote/Arduino-IRremote) | [TinyIR](https://github.com/Arduino-IRremote/Arduino-IRremote/tree/master/examples/TinyReceiver/TinyReceiver.ino) | [IRsmallDecoder](https://github.com/LuisMiCa/IRsmallDecoder)
+|-|-|-|-|-|-|-|
+| Number of protocols | **50** | Nec + Panasonic + Hash \* | 12 + Hash \* | 17 + PulseDistance + Hash \* | NEC + FAST | NEC + RC5 + Sony + Samsung |
+| Timing method receive | Timer2 or interrupt for pin 2 or 3 | **Interrupt** | Timer2 or interrupt for pin 2 or 3 | Timer2 | **Interrupt** | **Interrupt** |
+| Timing method send | PWM and timing with Timer2 interrupts | Timer2 interrupts | Timer2 and blocking wait | PWM with Timer2 and/or blocking wait with delay
Microseconds() | blocking wait with delay
Microseconds() | % |
+| Send pins| All | All | All ? | Timer dependent | All | % |
+| Decode method | OnTheFly | OnTheFly | RAM | RAM | OnTheFly | OnTheFly |
+| Encode method | OnTheFly | OnTheFly | OnTheFly | OnTheFly or RAM | OnTheFly | % |
+| Callback support | x | % | % | x | x | % |
+| Repeat handling | Receive + Send (partially) | % | ? | Receive + Send | Receive + Send | Receive |
+| LED feedback | x | % | x | x | Receive | % |
+| FLASH usage (simple NEC example with 5 prints) | 1820
(4300 for 15 main / 8000 for all 40 protocols)
(+200 for callback)
(+80 for interrupt at pin 2+3)| 1270
(1400 for pin 2+3) | 4830 | 1770 | **900** | ?1100? |
+| RAM usage | 52
(73 / 100 for 15 (main) / 40 protocols) | 62 | 334 | 227 | **19** | 29 |
+| Supported platforms | **avr, megaavr, attiny, Digispark (Pro), esp8266, ESP32, STM32, SAMD 21, Apollo3
(plus arm and pic for non Arduino IDE)** | avr, esp8266 | avr, SAMD 21, SAMD 51 | avr, attiny, [esp8266](https://github.com/crankyoldgit/IRremoteESP8266), esp32, SAM, SAMD | **All platforms with attach
Interrupt()** | **All platforms with attach
Interrupt()** |
+| Last library update | 5/2023 | 4/2018 | 11/2022 | 9/2023 | 5/2023 | 2/2022 |
+| Remarks | Decodes 40 protocols concurrently.
39 Protocols to send.
Work in progress. | Only one protocol at a time. | Consists of 5 libraries. **Project containing bugs - 63 issues, 10 pull requests.* | Universal decoder and encoder.
Supports **Pronto** codes and sending of raw timing values. | Requires no timer. | Requires no timer. |
+
+\* The Hash protocol gives you a hash as code, which may be sufficient to distinguish your keys on the remote, but may not work with some protocols like Mitsubishi
+
+
+
+# [History](https://github.com/Arduino-IRremote/Arduino-IRremote/blob/master/changelog.md)
+
+# Useful links
+- [List of public IR code databases](http://www.harctoolbox.org/IR-resources.html)
+- [LIRC database](http://lirc-remotes.sourceforge.net/remotes-table.html)
+- [IRMP list of IR protocols](https://www.mikrocontroller.net/articles/IRMP_-_english#IR_Protocols)
+- [IRDB database for IR codes](https://github.com/probonopd/irdb/tree/master/codes)
+- [IRP definition files for IR protocols](https://github.com/probonopd/MakeHex/tree/master/protocols)
+- [Good introduction to IR remotes by DroneBot Workshop](https://dronebotworkshop.com/ir-remotes/)
+- [IR Remote Control Theory and some protocols (upper right hamburger icon)](https://www.sbprojects.net/knowledge/ir/)
+- [Interpreting Decoded IR Signals (v2.45)](http://www.hifi-remote.com/johnsfine/DecodeIR.html)
+- ["Recording long Infrared Remote control signals with Arduino"](https://www.analysir.com/blog/2014/03/19/air-conditioners-problems-recording-long-infrared-remote-control-signals-arduino)
+- The original blog post of Ken Shirriff [A Multi-Protocol Infrared Remote Library for the Arduino](http://www.arcfn.com/2009/08/multi-protocol-infrared-remote-library.html)
+- [Vishay datasheet](https://www.vishay.com/docs/80069/circuit.pdf)
+
+# [Contributors](https://github.com/Arduino-IRremote/Arduino-IRremote/blob/master/Contributors.md)
+
+# License
+Up to the version 2.7.0, the License is GPLv2.
+From the version 2.8.0, the license is the MIT license.
+
+# Copyright
+Initially coded 2009 Ken Shirriff http://www.righto.com
+Copyright (c) 2016-2017 Rafi Khan https://rafikhan.io
+Copyright (c) 2020-2024 [Armin Joachimsmeyer](https://github.com/ArminJo)
diff --git a/libraries/IRremote/changelog.md b/libraries/IRremote/changelog.md
new file mode 100644
index 0000000..50d3d87
--- /dev/null
+++ b/libraries/IRremote/changelog.md
@@ -0,0 +1,401 @@
+# Changelog
+The latest version may not be released!
+See also the commit log at github: https://github.com/Arduino-IRremote/Arduino-IRremote/commits/master
+
+# 4.4.1
+- Support for ESP 3.0 by akellai.
+- restartTimer() now uses variable sMicrosAtLastStopTimer to keep track of uncounted ticks between stopTimer() and restartTimer().
+- Removed functions addTicksToInternalTickCounter() and addMicrosToInternalTickCounter(), which were added in 4.1.0.
+- Version 2.2.0 of TinyIR with new TinyReceiverDecode() function to be used as drop in for IrReceiver.decode().
+- Support of RC6A.
+
+# 4.4.0
+- Using 8 bit raw timing buffer for all timings except frame gap (former rawbuf[0]).
+- Renamed decodedIRData.initialGap to decodedIRData.initialGapTicks.
+- sendNEC() and sendNEC2() now accepts 16 bit command to better map to NECext protocol found in IRDB databases.
+- ir_DistanceWidthProtocol() now decodes up to 10 ms mark or spaces if RAM is bigger than 2 k.
+- Improved sensitivity and decoding of PULSE_DISTANCE + PULSE_WIDTH protocols.
+- Changed TOLERANCE_FOR_DECODERS_MARK_OR_SPACE_MATCHING to TOLERANCE_FOR_DECODERS_MARK_OR_SPACE_MATCHING_PERCENT.
+- Improved examples AllProtocolsOnLCD, UnitTest and SimpleReceiver.
+- New functions decodePulseDistanceWidthData() with 6 parameters and decodePulseDistanceWidthDataStrict() with 7 parameters.
+
+# 4.3.2
+- Added sendSonyMSB(unsigned long data, int nbits) as a clone of sendSony(unsigned long data, int nbits) to be more consistent.
+- Added sendSamsungMSB(unsigned long data, int nbits) as a clone of sendSAMSUNG(unsigned long data, int nbits) to be more consistent.
+- Added ESP32 core 3.x error message.
+
+# 4.3.1
+ - Fixed overflow bug for rawlen > 254.
+ - Removed deprecated sendPulseDistance... functions with parameter aSendStopBit.
+
+# 4.3.0
+- Removed default value USE_DEFAULT_FEEDBACK_LED_PIN for last parameter of IRsend::begin(bool aEnableLEDFeedback, uint_fast8_t aFeedbackLEDPin).
+ Therefore IrSender.begin(DISABLE_LED_FEEDBACK) will not longer work!
+- Added convenience function isIRReceiverAttachedForTinyReceiver().
+- Added Extended NEC Protocol macro to TinyIR by Buzzerb.
+- Fixed sendSamsung() / sendSamsungLG() bug.
+- Added functions stopTimer(), restartTimer() and restartTimerWithTicksToAdd().
+- Added rawlen and initialGap to IRData.
+- Added ReceiveAndSendHobToHood example.
+- Changed RECORD_GAP_MICROS default value from 5000 to 8000.
+
+# 4.2.1
+- Fix wrong type of tEnableLEDFeedback in IRSend.hpp and IRReceive.hpp.
+- TinyReceiver 2.0
+ - New TinyIRReceiverData which is filled with address, command and flags.
+ - Removed parameters address, command and flags from callback handleReceivedTinyIRData() and printTinyReceiverResultMinimal().
+ - Callback function now only enabled if USE_CALLBACK_FOR_TINY_RECEIVER is activated.
+- Fix changing IR_SEND_PIN dynamically for ESP32.
+- Fix wrong type of tEnableLEDFeedback.
+- Support for ESP32-C3.
+
+# 4.2.0
+- The old decode function is renamed to decode_old(decode_results *aResults). decode (decode_results *aResults) is only available in IRremote.h and prints a message.
+- Added DECODE_ONKYO, to force 16 bit command and data decoding.
+- Enable Bang&Olufsen 455 kHz if SEND_PWM_BY_TIMER is defined.
+- Fixed bug: TinyReceiver throwing ISR not in IRAM on ESP8266.
+- Usage of ATTinyCore pin numbering scheme e.g. PIN_PB2.
+- Added ARDUINO_ARCH_NRF52 to support Seeed XIAO nRF52840 Sense.
+- First untested support of Uno R4.
+- Extraced version macros to IRVersion.h.
+
+## 4.1.2
+- Workaround for ESP32 RTOS delay() timing bug influencing the mark() function.
+
+## 4.1.1
+- SAMD51 use timer3 if timer5 not available.
+- Disabled #define LOCAL_DEBUG in IRReceive.hpp, which was accidently enabled at 4.1.0.
+
+## 4.1.0
+- Fixed bug in printing durations > 64535 in printIRResultRawFormatted().
+- Narrowed constraints for RC5 RC6 number of bits.
+- Changed the first parameter of printTinyReceiverResultMinimal() to &Serial.
+- Removed 3 Serial prints for deprecation warnings to fix #1094.
+- Version 1.2.0 of TinyIR. Now FAST protocol with 40 ms period and shorter header space.
+- Removed field "bool hasStopBit" and parameter "bool aSendStopBit" from PulseDistanceWidthProtocolConstants structure and related functions.
+- Changed a lot of "unsigned int" types to "uint16_t" types.
+- Improved overflow handling.
+- Improved software PWM generation.
+- Added FAST protocol.
+- Improved handling of PULSE_DISTANCE + PULSE_WIDTH protocols.
+- New example ReceiveAndSendDistanceWidth.
+- Removed the automatic restarting of the receiver timer after sending with SEND_PWM_BY_TIMER enabled.
+- Split ISR into ISR and function IRPinChangeInterruptHandler().
+- Added functions addTicksToInternalTickCounter() and addMicrosToInternalTickCounter().
+
+## 4.0.0
+- Added decoding of PulseDistanceWidth protocols and therefore changed function decodeDistance() to decodeDistanceWidth() and filename ir_DistanceProtocol.hpp to ir_DistanceWidthProtocol.hpp.
+- Removed static function printIRSendUsage(), but kept class function printIRSendUsage().
+- Changed type of decodedRawData and decodedRawDataArray which is now 64 bit for 32 bit platforms.
+- Added receiver callback functionality and registerReceiveCompleteCallback() function.
+- Introduced common structure PulseDistanceWidthProtocolConstants.
+- Where possible, changed all send and decode functions to use PulseDistanceWidthProtocolConstants.
+- Improved MSB/LSB handling
+- New convenience fuctions bitreverse32Bit() and bitreverseOneByte().
+- Improved Magiquest protocol.
+- Fix for #1028 - Prevent long delay caused by overflow when frame duration < repeat period - Thanks to Stephen Humphries!
+- Support for ATtiny816 - Thanks to elockman.
+- Added Bang&Olufsen protocol. #1030.
+- Third parameter of function "void begin(uint_fast8_t aSendPin, bool aEnableLEDFeedback, uint_fast8_t aFeedbackLEDPin)" is not optional anymore and this function is now only available if IR_SEND_PIN is not defined. #1033.
+- Fixed bug in sendSony() for command parameter > 0x7F;
+- Fixed bug with swapped LG2 header mark and space.
+- Disabled strict checks while decoding. They can be enabled by defining DECODE_STRICT_CHECKS.
+- Merged the 2 decode pulse width and distance functions.
+- Changed macro names _REPEAT_SPACE to _REPEAT_DISTANCE.
+- Improved TinyIRReceiver,added FAST protocol for it and added TinyIRSender.hpp and TinySender example, renamed TinyReceiver.h to TinyIR.h.
+- Added DISABLE_CODE_FOR_RECEIVER to save program memory and RAM if receiving functionality is not required.
+- Extracted protocol functions used by receive and send to IRProtocol.hpp.
+- Analyzed Denon code table and therefore changed Denon from MSB to LSB first.
+- Renamed sendRC6(aRawData...) to sendRC6Raw( aRawData...).
+- Support for seeduino which lacks the print(unsigned long long...) method. Thanks to sklott https://stackoverflow.com/users/11680056/sklott
+- Added support for attiny1614 by Joe Ostrander.
+- Fixed SEND_PWM_BY_TIMER for ATtiny167 thanks to freskpe.
+- Improved SHARP repeat decoding.
+- Replaced macros TIMER_EN/DISABLE_RECEIVE_INTR and EN/DISABLE_SEND_PWM_BY_TIMER by functions.
+- Added SAMSUNG48 protocol and sendSamsung48() function.
+
+## 3.9.0
+- Improved documentation with the help of [ElectronicsArchiver}(https://github.com/ElectronicsArchiver).
+- Added NEC2 protocol.
+- Improved Magiquest protocol.
+- Renamed sendSamsungRepeat() to sendSamsungLGRepeat().
+- Added function sendPulseDistanceWidth().
+- Improved repeat detection for some protocols.
+
+## 3.8.0
+- Changed Samsung repeat handling. Old handling is available as SamsungLG.
+- Added function printIRSendUsage().
+- Reduced output size and improved format of printIRResultRawFormatted() to fasten up output (and getting repeats properly decoded).
+- Fixed Bug in sendDenonRaw() and improved decodeDenon().
+- Fixed potential bug in SendBiphase data for 1 bit.
+- Fixed bug in send for RP4020.
+- Fixed pin mapping problems especially for Teensy 2.0.
+- Added support for decoding of "special" NEC repeats.
+- Added SAMD51 support.
+- Improved pin mapping for TinyReceiver.
+
+## 3.7.1
+- SendRaw now supports bufferlenght > 255.
+- Improved DistanceProtocol decoder output.
+- Fixed ESP32 send bug for 2.x ESP32 cores.
+
+## 3.7.0
+- Changed TOLERANCE to TOLERANCE_FOR_DECODERS_MARK_OR_SPACE_MATCHING and documented it.
+- Changed last uint8_t to uint_fast8_t and uint16_t to unsigned integer.
+- Improved MagiQuest protocol.
+- Improved prints and documentation.
+- Added IrReceiver.restartAfterSend() and inserted it in every send(). Closes #989
+- Use IRAM_ATTR instead of deprecated ICACHE_RAM_ATTR for ESP8266.
+- Removed pulse width decoding from ir_DistanceProtocol.
+
+## 3.6.1
+- Switched Bose internal protocol timing for 0 and 1 -> old 1 timing is now 0 and vice versa.
+
+## 3.6.0
+- Separated enable flag of send and receive feedback LED. Inspired by PR#970 from luvaihassanali.
+- RP2040 support added.
+- Refactored IRTimer.hpp.
+- Refactored IR_SEND_PIN and IrSender.sendPin handling.
+- Renamed IR_SEND_DUTY_CYCLE to IR_SEND_DUTY_CYCLE_PERCENT.
+- Fixed bugs for SEND_PWM_BY_TIMER active.
+
+## 3.5.2
+- Improved support for Teensy boards by Paul Stoffregen.
+
+## 3.5.1
+- Renamed INFO_PRINT to IR_INFO_PRINT as well as for DEBUG and TRACE.
+- Fixed error with DEBUG in TinyIRReceiver.hpp.
+- Support for ATmega88 see issue #923. Thanks to Dolmant.
+- NO_LED_FEEDBACK_CODE replaces and extends DISABLE_LED_FEEDBACK_FOR_RECEIVE.
+- Removed NO_LEGACY_COMPATIBILITY macro, it was useless now.
+- Fix ESP32 send bug see issue #927.
+
+## 3.5.0
+- Improved ir_DistanceProtocol.
+- Tone for ESP32.
+- last phase renamed *.cpp.h to .hpp.
+- No deprecation print for ATtinies.
+- Renamed ac_LG.cpp to ac_LG.hpp.
+- Maintained MagiQuest by E. Stuart Hicks.
+- Improved print Pronto by Asuki Kono.
+- Added printActiveIRProtocols() function.
+- Used IR_SEND_PIN to reduce code size and improved send timing for AVR.
+
+## 3.4.0
+- Added LG2 protocol.
+- Added ATtiny167 (Digispark Pro) support.
+- Renamed *.cpp.h to .hpp.
+- organized carrier frequencies.
+- Compiler switch USE_OPEN_DRAIN_OUTPUT_FOR_SEND_PIN added.
+- Moved blink13() back to IRrecv class.
+- Added Kaseikyo convenience functions like sendKaseikyo_Denon().
+- Improved / adjusted LG protocol and added class Aircondition_LG based on real hardware supplied by makerspace 201 (https://wiki.hackerspaces.org/ZwoNullEins) from Cologne.
+- Improved universal decoder for pulse distance protocols to support more than 32 bits.
+- Added mbed support.
+
+## 3.3.0
+- Fix errors if LED_BUILTIN is not defined.
+- Fixed error for AVR timer1. Thanks to alexbarcelo.
+- New example IRremoteExtensionTest.
+- Enabled megaAVR 0-series devices.
+- Added universal decoder for pulse distance protocols.
+
+## 3.2.0
+- Fix for ESP32 send Error, removed `USE_SOFT_SEND_PWM` macro.
+- Added Onkyo protocol.
+- Support for old 2.x code by backwards compatible `decode(decode_results *aResults)` function.
+- Removed USE_OLD_DECODE macro and added NO_LEGACY_COMPATIBILITY macro.
+- Added ATtiny1604 support.
+- New SendAndReceive example.
+- Added ESP8266 support.
+- Extended DEBUG output.
+
+## 3.1.0
+- Generation of PWM by software is active by default.
+- Removed decode_results results.
+- Renamed most irparams_struct values.
+- Fixed LG send bug and added unit test.
+- Replaced `#define DECODE_NEC 1/0` by defining/not defining.
+- Use LED_BUILTIN instead of FEEDBACK_LED if FeedbackLEDPin is 0.
+- Use F_CPU instead of SYSCLOCK.
+- Removed SENDPIN_ON and SENDPIN_OFF macros.
+
+- Refactored board specific code for timer and feedback LED.
+- Extracted common LED feedback functions and implemented feedback for send.
+- MATCH_MARK() etc. now available as matchMark().
+- Added STM32F1 by (by Roger Clark) support.
+- Added stm32 (by ST) support. Thanks to Paolo Malaspina.
+- Added ATtiny88 support.
+
+## 3.0.2
+- Bug fix for USE_OLD_DECODE.
+- Increase RECORD_GAP_MICROS to 11000.
+- Fix overflow message. (#793).
+- Improved handling for HASH decoder.
+- Tested for ATtiny85.
+- Added `printIRResultMinimal()`.
+- Added missing IRAM_ATTR for ESP32.
+- Adapted to TinyCore 0.0.7.
+- Fixed decodeSony 20 bit bug #811.
+- Replaced delayMicroseconds with customDelayMicroseconds and removed NoInterrupt() for send functions, removed SPIN_WAIT macro, sleepMicros() and sleepUntilMicros().
+- Fixed LG checksum error.
+- Fixed JVC repeat error.
+
+## 3.0.0 + 3.0.1 2021/02
+- New LSB first decoders are default.
+- Added SendRaw with byte data.
+- Fixed resume bug if irparams.rawlen >= RAW_BUFFER_LENGTH. Thanks to Iosif Peterfi
+- Added `dumpPronto(String *aString, unsigned int frequency)` with String object as argument. Thanks to Iosif Peterfi
+- Removed Test2 example.
+- Fixed swapped cases in `getProtocolString()`. Thanks to Jim-2249
+- Added compile option `IR_INPUT_IS_ACTIVE_HIGH`. Thanks to Jim-2249
+- Corrected template. Thanks to Jim-2249
+- Introduced standard decode and send functions.
+- Added compatibility with tone for AVR's.
+- New TinyIRreceiver does not require a timer.
+- New MinimalReceiver and IRDispatcherDemo examples.
+- Added TinyCore 32 / ATtiny3217 support.
+- Added Apple protocol.
+
+## 2.8.1 2020/10
+- Fixed bug in Sony decode introduced in 2.8.0.
+
+## 2.8.0 2020/10
+- Changed License to MIT see https://github.com/Arduino-IRremote/Arduino-IRremote/issues/397.
+- Added ATtiny timer 1 support.
+- Changed wrong return code signature of decodePulseDistanceData() and its handling.
+- Removed Mitsubishi protocol, since the implementation is in contradiction with all documentation I found and therefore supposed to be wrong.
+- Removed AIWA implementation, since it is only for 1 device and at least the sending was implemented wrong.
+- Added Lego_PF decode.
+- Changed internal usage of custom_delay_usec.
+- Moved dump/print functions from example to irReceiver.
+- irPronto.cpp: Using Print instead of Stream saves 1020 bytes program memory. Changed from & to * parameter type to be more transparent and consistent with other code of IRremote.
+
+## 2.7.0 2020/09
+- Added ATmega328PB support.
+- Renamed hardware specific macro and function names.
+- Renamed `USE_SOFT_CARRIER`, `USE_NO_CARRIER`, `DUTY_CYCLE` macros to `USE_SOFT_SEND_PWM`, `USE_NO_SEND_PWM`, `IR_SEND_DUTY_CYCLE`.
+- Removed blocking wait for ATmega32U4 Serial in examples.
+- Deactivated default debug output.
+- Optimized types in sendRC5ext and sendSharpAlt.
+- Added `DECODE_NEC_STANDARD` and `SEND_NEC_STANDARD`.
+- Renamed all IRrecv* examples to IRreceive*.
+- Added functions `printIRResultShort(&Serial)` and `getProtocolString(decode_type_t aDecodeType)`.
+- Added flag `decodedIRData.isRepeat`.
+- Updated examples.
+
+## 2.6.1 2020/08
+- Adjusted JVC and LG timing.
+- Fixed 4809 bug.
+
+## 2.6.0 2020/08
+- Added support for MagiQuest IR wands.
+- Corrected Samsung timing.
+- NEC repeat implementation.
+- Formatting and changing `TIMER_CONFIG_KHZ` and `TIMER_CONFIG_NORMAL` macros to static functions.
+- Added `IRAM_ATTR` for ESP32 ISR.
+- Removed `#define HAS_AVR_INTERRUPT_H`.
+- Changed Receiver States. Now starting with 0.
+- Changed switch to if / else if in IRRemote.cpp because of ESP32 compiler bug.
+- Changed `DEBUG` handling since compiler warns about empty "IF" or "ELSE" statements in IRRemote.cpp.
+
+## 2.5.0 2020/06
+- Corrected keywords.txt.
+- BoseWave protocol added PR #690.
+- Formatting comply to the new stylesheet.
+- Renamed "boarddefs.h" [ISSUE #375](https://github.com/Arduino-IRremote/Arduino-IRremote/issues/375).
+- Renamed `SEND_PIN` to `IR_SEND_PIN`.
+- Renamed state macros.
+- Enabled `DUTY_CYCLE` for send signal.
+- Added sending for ESP32.
+- Changed rawlen from uint8_t to unsigned int allowing bigger receive buffer and renamed `RAWBUF` to `RAW_BUFFER_LENGTH`.
+- Introduced `USE_NO_CARRIER` for simulating an IR receiver.
+Changes from #283 by bengtmartensson
+- Added function sendRaw_P() for sending data from flash.
+Changes from #268 by adamlhumphreys
+- Optimized by reducing floating point operations as suggested by madmalkav (#193).
+- Optimized with macros when using default `MICROS_PER_TICK` and `TOLERANCE`.
+- Made decodeHash as a settable protocol defined by `DECODE_HASH`.
+- Added Philips Extended RC-5 protocol support [PR #522] (https://github.com/Arduino-IRremote/Arduino-IRremote/pull/522)
+
+## 2.4.0 - 2017/08/10
+ - Cleanup of hardware dependencies. Merge in SAM support [PR #437](https://github.com/Arduino-IRremote/Arduino-IRremote/pull/437)
+
+## 2.3.3 - 2017/03/31
+- Added ESP32 IR receive support [PR #427](https://github.com/Arduino-IRremote/Arduino-IRremote/pull/425)
+
+## 2.2.3 - 2017/03/27
+- Fix calculation of pause length in LEGO PF protocol [PR #427](https://github.com/Arduino-IRremote/Arduino-IRremote/pull/427)
+
+## 2.2.2 - 2017/01/20
+- Fixed naming bug [PR #398](https://github.com/Arduino-IRremote/Arduino-IRremote/pull/398)
+
+## 2.2.1 - 2016/07/27
+- Added tests for Lego Power Functions Protocol [PR #336](https://github.com/Arduino-IRremote/Arduino-IRremote/pull/336)
+
+## 2.2.0 - 2016/06/28
+- Added support for ATmega8535
+- Added support for ATmega16
+- Added support for ATmega32
+- Added support for ATmega164
+- Added support for ATmega324
+- Added support for ATmega644
+- Added support for ATmega1284
+- Added support for ATmega64
+- Added support for ATmega128
+
+[PR](https://github.com/Arduino-IRremote/Arduino-IRremote/pull/324)
+
+## 2.1.1 - 2016/05/04
+- Added Lego Power Functions Protocol [PR #309](https://github.com/Arduino-IRremote/Arduino-IRremote/pull/309)
+
+## 2.1.0 - 2016/02/20
+- Improved Debugging [PR #258](https://github.com/Arduino-IRremote/Arduino-IRremote/pull/258)
+- Display TIME instead of TICKS [PR #258](https://github.com/Arduino-IRremote/Arduino-IRremote/pull/258)
+
+## 2.0.4 - 2016/02/20
+- Add Panasonic and JVC to IRrecord example [PR](https://github.com/Arduino-IRremote/Arduino-IRremote/pull/54)
+
+## 2.0.3 - 2016/02/20
+- Change IRSend Raw parameter to const [PR](https://github.com/Arduino-IRremote/Arduino-IRremote/pull/227)
+
+## 2.0.2 - 2015/12/02
+- Added IRremoteInfo Sketch - [PR](https://github.com/Arduino-IRremote/Arduino-IRremote/pull/241)
+- Enforcing changelog.md
+
+## 2.0.1 - 2015/07/26 - [Release](https://github.com/shirriff/Arduino-IRremote/releases/tag/BETA)
+### Changes
+- Updated README
+- Updated Contributors
+- Fixed #110 Mess
+- Created Gitter Room
+- Added Gitter Badge
+- Standardised Code Base
+- Clean Debug Output
+- Optimized Send Loops
+- Modularized Design
+- Optimized and Updated Examples
+- Improved Documentation
+- Fixed and Improved many coding errors
+- Fixed Aiwa RC-T501 Decoding
+- Fixed Interrupt on ATmega8
+- Switched to Stable Release of PlatformIO
+
+### Additions
+- Added Aiwa RC-T501 Protocol
+- Added Denon Protocol
+- Added Pronto Support
+- Added compile options
+- Added Template For New Protocols
+- Added this changelog
+- Added Teensy LC Support
+- Added ATtiny84 Support
+- Added ATtiny85 Support
+- Added isIdle method
+
+### Deletions
+- Removed (Fixed) #110
+- Broke Teensy 3 / 3.1 Support
+
+### Not Working
+- Teensy 3 / 3.1 Support is in Development
diff --git a/libraries/IRremote/examples/ControlRelay/ControlRelay.ino b/libraries/IRremote/examples/ControlRelay/ControlRelay.ino
new file mode 100644
index 0000000..4b490e5
--- /dev/null
+++ b/libraries/IRremote/examples/ControlRelay/ControlRelay.ino
@@ -0,0 +1,100 @@
+/*
+ * ControlRelay.cpp
+ *
+ * Toggles an output pin at each command received
+ * An IR detector/demodulator must be connected to the input RECV_PIN.
+ * Initially coded 2009 Ken Shirriff http://www.righto.com
+ *
+ * This file is part of Arduino-IRremote https://github.com/Arduino-IRremote/Arduino-IRremote.
+ *
+ ************************************************************************************
+ * MIT License
+ *
+ * Copyright (c) 2009-2021 Ken Shirriff, 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.
+ *
+ ************************************************************************************
+ */
+#include
+
+//#include "PinDefinitionsAndMore.h" // Define macros for input and output pin etc.
+/*
+ * Helper macro for getting a macro definition as string
+ */
+#if !defined(STR_HELPER)
+#define STR_HELPER(x) #x
+#define STR(x) STR_HELPER(x)
+#endif
+
+#include
+
+#define RELAY_PIN 5 // P0_4
+#define IR_RECEIVE_PIN 4 // P0_1
+
+void setup() {
+ pinMode(LED_BUILTIN, OUTPUT);
+ pinMode(RELAY_PIN, OUTPUT);
+
+ Serial.begin(9600);
+ while (!Serial)
+ ; // Wait for Serial to become available. Is optimized away for some cores.
+
+ // Just to know which program is running on my Arduino
+ Serial.println(F("START " __FILE__ " from " __DATE__ "\r\nUsing library version " VERSION_IRREMOTE));
+
+ // Start the receiver and if not 3. parameter specified, take LED_BUILTIN pin from the internal boards definition as default feedback LED
+ IrReceiver.begin(IR_RECEIVE_PIN, ENABLE_LED_FEEDBACK);
+
+ Serial.print(F("Ready to receive IR signals of protocols: "));
+ printActiveIRProtocols(&Serial);
+ Serial.println(F("at pin " STR(IR_RECEIVE_PIN)));
+}
+
+int on = 0;
+unsigned long last = millis();
+
+void loop() {
+ if (IrReceiver.decode()) {
+ // If it's been at least 1/4 second since the last
+ // IR received, toggle the relay
+ if (millis() - last > 250) {
+ on = !on;
+ Serial.print(F("Switch relay "));
+ if (on) {
+ digitalWrite(RELAY_PIN, HIGH);
+ Serial.println(F("on"));
+ } else {
+ digitalWrite(RELAY_PIN, LOW);
+ Serial.println(F("off"));
+ }
+
+ IrReceiver.printIRResultShort(&Serial);
+ IrReceiver.printIRSendUsage(&Serial);
+ Serial.println();
+ if (IrReceiver.decodedIRData.protocol == UNKNOWN) {
+ // We have an unknown protocol, print more info
+ Serial.println(F("Received noise or an unknown (or not yet enabled) protocol"));
+ IrReceiver.printIRResultRawFormatted(&Serial, true);
+ }
+
+ }
+ last = millis();
+ IrReceiver.resume(); // Enable receiving of the next value
+ }
+}
diff --git a/libraries/IRremote/examples/ControlRelay/PinDefinitionsAndMore.h b/libraries/IRremote/examples/ControlRelay/PinDefinitionsAndMore.h
new file mode 100644
index 0000000..14573c7
--- /dev/null
+++ b/libraries/IRremote/examples/ControlRelay/PinDefinitionsAndMore.h
@@ -0,0 +1,349 @@
+/*
+ * PinDefinitionsAndMore.h
+ *
+ * Contains pin definitions for IRremote examples for various platforms
+ * as well as definitions for feedback LED and tone() and includes
+ *
+ * Copyright (C) 2021-2023 Armin Joachimsmeyer
+ * armin.joachimsmeyer@gmail.com
+ *
+ * This file is part of IRremote https://github.com/Arduino-IRremote/Arduino-IRremote.
+ *
+ * Arduino-IRremote is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
+ * See the GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see .
+ *
+ */
+
+/*
+ * Pin mapping table for different platforms
+ *
+ * Platform IR input IR output Tone Core/Pin schema
+ * --------------------------------------------------------------
+ * DEFAULT/AVR 2 3 4 Arduino
+ * ATtinyX5 0|PB0 4|PB4 3|PB3 ATTinyCore
+ * ATtiny167 3|PA3 2|PA2 7|PA7 ATTinyCore
+ * ATtiny167 9|PA3 8|PA2 5|PA7 Digispark original core
+ * ATtiny84 |PB2 |PA4 |PA3 ATTinyCore
+ * ATtiny88 3|PD3 4|PD4 9|PB1 ATTinyCore
+ * ATtiny3217 18|PA1 19|PA2 20|PA3 MegaTinyCore
+ * ATtiny1604 2 3|PA5 %
+ * ATtiny816 14|PA1 16|PA3 1|PA5 MegaTinyCore
+ * ATtiny1614 8|PA1 10|PA3 1|PA5 MegaTinyCore
+ * SAMD21 3 4 5
+ * ESP8266 14|D5 12|D6 %
+ * ESP32 15 4 27
+ * ESP32-C3 2 3 4
+ * BluePill PA6 PA7 PA3
+ * APOLLO3 11 12 5
+ * RP2040 3|GPIO15 4|GPIO16 5|GPIO17
+ */
+//#define _IR_MEASURE_TIMING // For debugging purposes.
+
+#if defined(__AVR__)
+#if defined(__AVR_ATtiny25__) || defined(__AVR_ATtiny45__) || defined(__AVR_ATtiny85__) // Digispark board. For use with ATTinyCore.
+#include "ATtinySerialOut.hpp" // TX is at pin 2 - Available as Arduino library "ATtinySerialOut". Saves 700 bytes program memory and 70 bytes RAM for ATtinyCore.
+#define IR_RECEIVE_PIN PIN_PB0
+#define IR_SEND_PIN PIN_PB4 // Pin 2 is serial output with ATtinySerialOut. Pin 1 is internal LED and Pin3 is USB+ with pullup on Digispark board.
+#define TONE_PIN PIN_PB3
+#define _IR_TIMING_TEST_PIN PIN_PB3
+
+# elif defined(__AVR_ATtiny87__) || defined(__AVR_ATtiny167__) // Digispark pro board
+#include "ATtinySerialOut.hpp" // Available as Arduino library "ATtinySerialOut"
+// For ATtiny167 Pins PB6 and PA3 are usable as interrupt source.
+# if defined(ARDUINO_AVR_DIGISPARKPRO)
+// For use with Digispark original core
+#define IR_RECEIVE_PIN 9 // PA3 - on Digispark board labeled as pin 9
+//#define IR_RECEIVE_PIN 14 // PB6 / INT0 is connected to USB+ on DigisparkPro boards
+#define IR_SEND_PIN 8 // PA2 - on Digispark board labeled as pin 8
+#define TONE_PIN 5 // PA7 - on Digispark board labeled as pin 5
+#define _IR_TIMING_TEST_PIN 10 // PA4
+# else
+// For use with ATTinyCore
+#define IR_RECEIVE_PIN PIN_PA3 // On Digispark board labeled as pin 9 - INT0 is connected to USB+ on DigisparkPro boards
+#define IR_SEND_PIN PIN_PA2 // On Digispark board labeled as pin 8
+#define TONE_PIN PIN_PA7 // On Digispark board labeled as pin 5
+# endif
+
+# elif defined(__AVR_ATtiny84__) // For use with ATTinyCore
+#include "ATtinySerialOut.hpp" // Available as Arduino library "ATtinySerialOut". Saves 128 bytes program memory.
+#define IR_RECEIVE_PIN PIN_PB2 // INT0
+#define IR_SEND_PIN PIN_PA4
+#define TONE_PIN PIN_PA3
+#define _IR_TIMING_TEST_PIN PIN_PA5
+
+# elif defined(__AVR_ATtiny88__) // MH-ET Tiny88 board. For use with ATTinyCore.
+#include "ATtinySerialOut.hpp" // Available as Arduino library "ATtinySerialOut". Saves 128 bytes program memory.
+// Pin 6 is TX, pin 7 is RX
+#define IR_RECEIVE_PIN PIN_PD3 // 3 - INT1
+#define IR_SEND_PIN PIN_PD4 // 4
+#define TONE_PIN PIN_PB1 // 9
+#define _IR_TIMING_TEST_PIN PIN_PB0 // 8
+
+# elif defined(__AVR_ATtiny1616__) || defined(__AVR_ATtiny3216__) || defined(__AVR_ATtiny3217__) // For use with megaTinyCore
+// Tiny Core Dev board
+// https://www.tindie.com/products/xkimi/tiny-core-16-dev-board-attiny1616/ - Out of Stock
+// https://www.tindie.com/products/xkimi/tiny-core-32-dev-board-attiny3217/ - Out of Stock
+#define IR_RECEIVE_PIN PIN_PA1 // use 18 instead of PIN_PA1 for TinyCore32
+#define IR_SEND_PIN PIN_PA2 // 19
+#define TONE_PIN PIN_PA3 // 20
+#define APPLICATION_PIN PIN_PA0 // 0
+#undef LED_BUILTIN // No LED available on the TinyCore 32 board, take the one on the programming board which is connected to the DAC output
+#define LED_BUILTIN PIN_PA6 // use 2 instead of PIN_PA6 for TinyCore32
+
+# elif defined(__AVR_ATtiny816__) // For use with megaTinyCore
+#define IR_RECEIVE_PIN PIN_PA1 // 14
+#define IR_SEND_PIN PIN_PA1 // 16
+#define TONE_PIN PIN_PA5 // 1
+#define APPLICATION_PIN PIN_PA4 // 0
+#undef LED_BUILTIN // No LED available, take the one which is connected to the DAC output
+#define LED_BUILTIN PIN_PB5 // 4
+
+# elif defined(__AVR_ATtiny1614__) // For use with megaTinyCore
+#define IR_RECEIVE_PIN PIN_PA1 // 8
+#define IR_SEND_PIN PIN_PA3 // 10
+#define TONE_PIN PIN_PA5 // 1
+#define APPLICATION_PIN PIN_PA4 // 0
+
+# elif defined(__AVR_ATtiny1604__) // For use with megaTinyCore
+#define IR_RECEIVE_PIN PIN_PA6 // 2 - To be compatible with interrupt example, pin 2 is chosen here.
+#define IR_SEND_PIN PIN_PA7 // 3
+#define APPLICATION_PIN PIN_PB2 // 5
+
+#define tone(...) void() // Define as void, since TCB0_INT_vect is also used by tone()
+#define noTone(a) void()
+#define TONE_PIN 42 // Dummy for examples using it
+
+# elif defined(__AVR_ATmega1284__) || defined(__AVR_ATmega1284P__) \
+|| defined(__AVR_ATmega644__) || defined(__AVR_ATmega644P__) \
+|| defined(__AVR_ATmega324P__) || defined(__AVR_ATmega324A__) \
+|| defined(__AVR_ATmega324PA__) || defined(__AVR_ATmega164A__) \
+|| defined(__AVR_ATmega164P__) || defined(__AVR_ATmega32__) \
+|| defined(__AVR_ATmega16__) || defined(__AVR_ATmega8535__) \
+|| defined(__AVR_ATmega64__) || defined(__AVR_ATmega128__) \
+|| defined(__AVR_ATmega1281__) || defined(__AVR_ATmega2561__) \
+|| defined(__AVR_ATmega8515__) || defined(__AVR_ATmega162__)
+#define IR_RECEIVE_PIN 2
+#define IR_SEND_PIN 13
+#define TONE_PIN 4
+#define APPLICATION_PIN 5
+#define ALTERNATIVE_IR_FEEDBACK_LED_PIN 6 // E.g. used for examples which use LED_BUILDIN for example output.
+#define _IR_TIMING_TEST_PIN 7
+
+# else // Default as for ATmega328 like on Uno, Nano, Leonardo, Teensy 2.0 etc.
+#define IR_RECEIVE_PIN 2 // To be compatible with interrupt example, pin 2 is chosen here.
+#define IR_SEND_PIN 3
+#define TONE_PIN 4
+#define APPLICATION_PIN 5
+#define ALTERNATIVE_IR_FEEDBACK_LED_PIN 6 // E.g. used for examples which use LED_BUILDIN for example output.
+#define _IR_TIMING_TEST_PIN 7
+
+# if defined(ARDUINO_AVR_PROMICRO) // Sparkfun Pro Micro is __AVR_ATmega32U4__ but has different external circuit
+// We have no built in LED at pin 13 -> reuse RX LED
+#undef LED_BUILTIN
+#define LED_BUILTIN LED_BUILTIN_RX
+# endif
+# endif // defined(__AVR_ATtiny25__)...
+
+#elif defined(ARDUINO_ARCH_RENESAS_UNO) // Uno R4
+// To be compatible with Uno R3.
+#define IR_RECEIVE_PIN 2
+#define IR_SEND_PIN 3
+#define TONE_PIN 4
+#define APPLICATION_PIN 5
+#define ALTERNATIVE_IR_FEEDBACK_LED_PIN 6 // E.g. used for examples which use LED_BUILDIN for example output.
+#define _IR_TIMING_TEST_PIN 7
+
+#elif defined(ESP8266)
+#define FEEDBACK_LED_IS_ACTIVE_LOW // The LED on my board (D4) is active LOW
+#define IR_RECEIVE_PIN 14 // D5
+#define IR_SEND_PIN 12 // D6 - D4/pin 2 is internal LED
+#define _IR_TIMING_TEST_PIN 2 // D4
+#define APPLICATION_PIN 13 // D7
+
+#define tone(...) void() // tone() inhibits receive timer
+#define noTone(a) void()
+#define TONE_PIN 42 // Dummy for examples using it#
+
+#elif defined(ARDUINO_NOLOGO_ESP32C3_SUPER_MINI)
+#define FEEDBACK_LED_IS_ACTIVE_LOW // The LED on my board (D8) is active LOW
+#define IR_RECEIVE_PIN 2
+#define IR_SEND_PIN 3
+#define TONE_PIN 4
+#define APPLICATION_PIN 10
+
+#elif defined(CONFIG_IDF_TARGET_ESP32C3) || defined(ARDUINO_ESP32C3_DEV)
+#define NO_LED_FEEDBACK_CODE // The WS2812 on pin 8 of AI-C3 board crashes if used as receive feedback LED, other I/O pins are working...
+#define IR_RECEIVE_PIN 6
+#define IR_SEND_PIN 7
+#define TONE_PIN 10
+#define APPLICATION_PIN 18
+
+#elif defined(ESP32)
+#include
+
+// tone() is included in ESP32 core since 2.0.2
+#if !defined(ESP_ARDUINO_VERSION_VAL)
+#define ESP_ARDUINO_VERSION_VAL(major, minor, patch) 12345678
+#endif
+#if ESP_ARDUINO_VERSION <= ESP_ARDUINO_VERSION_VAL(2, 0, 2)
+#define TONE_LEDC_CHANNEL 1 // Using channel 1 makes tone() independent of receiving timer -> No need to stop receiving timer.
+void tone(uint8_t aPinNumber, unsigned int aFrequency){
+ ledcAttachPin(aPinNumber, TONE_LEDC_CHANNEL);
+ ledcWriteTone(TONE_LEDC_CHANNEL, aFrequency);
+}
+void tone(uint8_t aPinNumber, unsigned int aFrequency, unsigned long aDuration){
+ ledcAttachPin(aPinNumber, TONE_LEDC_CHANNEL);
+ ledcWriteTone(TONE_LEDC_CHANNEL, aFrequency);
+ delay(aDuration);
+ ledcWriteTone(TONE_LEDC_CHANNEL, 0);
+}
+void noTone(uint8_t aPinNumber){
+ ledcWriteTone(TONE_LEDC_CHANNEL, 0);
+}
+#endif // ESP_ARDUINO_VERSION <= ESP_ARDUINO_VERSION_VAL(2, 0, 2)
+
+#define IR_RECEIVE_PIN 15 // D15
+#define IR_SEND_PIN 4 // D4
+#define TONE_PIN 27 // D27 25 & 26 are DAC0 and 1
+#define APPLICATION_PIN 16 // RX2 pin
+
+#elif defined(ARDUINO_ARCH_STM32) || defined(ARDUINO_ARCH_STM32F1) // BluePill
+// Timer 3 blocks PA6, PA7, PB0, PB1 for use by Servo or tone()
+#define IR_RECEIVE_PIN PA6
+#define IR_RECEIVE_PIN_STRING "PA6"
+#define IR_SEND_PIN PA7
+#define IR_SEND_PIN_STRING "PA7"
+#define TONE_PIN PA3
+#define _IR_TIMING_TEST_PIN PA5
+#define APPLICATION_PIN PA2
+#define APPLICATION_PIN_STRING "PA2"
+# if defined(ARDUINO_GENERIC_STM32F103C) || defined(ARDUINO_BLUEPILL_F103C8)
+// BluePill LED is active low
+#define FEEDBACK_LED_IS_ACTIVE_LOW
+# endif
+
+#elif defined(ARDUINO_ARCH_APOLLO3) // Sparkfun Apollo boards
+#define IR_RECEIVE_PIN 11
+#define IR_SEND_PIN 12
+#define TONE_PIN 5
+
+#elif defined(ARDUINO_ARCH_MBED) && defined(ARDUINO_ARCH_MBED_NANO) // Arduino Nano 33 BLE and Arduino Nano Connect layout for MBED
+// Must be before ARDUINO_ARCH_RP2040, since it is the layout for the MBED core of Arduino Nano Connect
+#define IR_RECEIVE_PIN 3 // GPIO15 Start with pin 3 since pin 2|GPIO25 is connected to LED on Pi pico
+#define IR_SEND_PIN 4 // GPIO16
+#define TONE_PIN 5
+#define APPLICATION_PIN 6
+#define ALTERNATIVE_IR_FEEDBACK_LED_PIN 7 // E.g. used for examples which use LED_BUILDIN for example output.
+#define _IR_TIMING_TEST_PIN 8
+
+#elif defined(ARDUINO_ARCH_RP2040) // Arduino Nano Connect, Pi Pico with arduino-pico core https://github.com/earlephilhower/arduino-pico
+#define IR_RECEIVE_PIN 15 // GPIO15 to be compatible with the Arduino Nano RP2040 Connect (pin3)
+#define IR_SEND_PIN 16 // GPIO16
+#define TONE_PIN 17
+#define APPLICATION_PIN 18
+#define ALTERNATIVE_IR_FEEDBACK_LED_PIN 19 // E.g. used for examples which use LED_BUILDIN for example output.
+#define _IR_TIMING_TEST_PIN 20
+
+// If you program the Nano RP2040 Connect with this core, then you must redefine LED_BUILTIN
+// and use the external reset with 1 kOhm to ground to enter UF2 mode
+#undef LED_BUILTIN
+#define LED_BUILTIN 6
+
+#elif defined(PARTICLE) // !!!UNTESTED!!!
+#define IR_RECEIVE_PIN A4
+#define IR_SEND_PIN A5 // Particle supports multiple pins
+
+#define LED_BUILTIN D7
+
+/*
+ * 4 times the same (default) layout for easy adaption in the future
+ */
+#elif defined(TEENSYDUINO) // Teensy 2.0 is handled at default for ATmega328 like on Uno, Nano, Leonardo etc.
+#define IR_RECEIVE_PIN 2
+#define IR_SEND_PIN 3
+#define TONE_PIN 4
+#define APPLICATION_PIN 5
+#define ALTERNATIVE_IR_FEEDBACK_LED_PIN 6 // E.g. used for examples which use LED_BUILDIN for example output.
+#define _IR_TIMING_TEST_PIN 7
+
+#elif defined(ARDUINO_ARCH_MBED) // Arduino Nano 33 BLE
+#define IR_RECEIVE_PIN 2
+#define IR_SEND_PIN 3
+#define TONE_PIN 4
+#define APPLICATION_PIN 5
+#define ALTERNATIVE_IR_FEEDBACK_LED_PIN 6 // E.g. used for examples which use LED_BUILDIN for example output.
+#define _IR_TIMING_TEST_PIN 7
+
+#elif defined(ARDUINO_ARCH_SAMD) || defined(ARDUINO_ARCH_SAM)
+#define IR_RECEIVE_PIN 2
+#define IR_SEND_PIN 3
+#define TONE_PIN 4
+#define APPLICATION_PIN 5
+#define ALTERNATIVE_IR_FEEDBACK_LED_PIN 6 // E.g. used for examples which use LED_BUILDIN for example output.
+#define _IR_TIMING_TEST_PIN 7
+
+#if !defined(ARDUINO_SAMD_ADAFRUIT) && !defined(ARDUINO_SEEED_XIAO_M0)
+// On the Zero and others we switch explicitly to SerialUSB
+#define Serial SerialUSB
+#endif
+
+// Definitions for the Chinese SAMD21 M0-Mini clone, which has no led connected to D13/PA17.
+// Attention!!! D2 and D4 are swapped on these boards!!!
+// If you connect the LED, it is on pin 24/PB11. In this case activate the next two lines.
+//#undef LED_BUILTIN
+//#define LED_BUILTIN 24 // PB11
+// As an alternative you can choose pin 25, it is the RX-LED pin (PB03), but active low.In this case activate the next 3 lines.
+//#undef LED_BUILTIN
+//#define LED_BUILTIN 25 // PB03
+//#define FEEDBACK_LED_IS_ACTIVE_LOW // The RX LED on the M0-Mini is active LOW
+
+#elif defined (NRF51) // BBC micro:bit
+#define IR_RECEIVE_PIN 2
+#define IR_SEND_PIN 3
+#define APPLICATION_PIN 1
+#define _IR_TIMING_TEST_PIN 4
+
+#define tone(...) void() // no tone() available
+#define noTone(a) void()
+#define TONE_PIN 42 // Dummy for examples using it
+
+#else
+#warning Board / CPU is not detected using pre-processor symbols -> using default values, which may not fit. Please extend PinDefinitionsAndMore.h.
+// Default valued for unidentified boards
+#define IR_RECEIVE_PIN 2
+#define IR_SEND_PIN 3
+#define TONE_PIN 4
+#define APPLICATION_PIN 5
+#define ALTERNATIVE_IR_FEEDBACK_LED_PIN 6 // E.g. used for examples which use LED_BUILDIN for example output.
+#define _IR_TIMING_TEST_PIN 7
+#endif // defined(ESP8266)
+
+#if defined(ESP32) || defined(ARDUINO_ARCH_RP2040) || defined(PARTICLE) || defined(ARDUINO_ARCH_MBED)
+#define SEND_PWM_BY_TIMER // We do not have pin restrictions for this CPU's, so lets use the hardware PWM for send carrier signal generation
+#else
+# if defined(SEND_PWM_BY_TIMER)
+#undef IR_SEND_PIN // SendPin is determined by timer! This avoids warnings in IRremote.hpp and IRTimer.hpp
+# endif
+#endif
+
+#if !defined (FLASHEND)
+#define FLASHEND 0xFFFF // Dummy value for platforms where FLASHEND is not defined
+#endif
+
+/*
+ * Helper macro for getting a macro definition as string
+ */
+#if !defined(STR_HELPER)
+#define STR_HELPER(x) #x
+#define STR(x) STR_HELPER(x)
+#endif
diff --git a/libraries/IRremote/examples/IRDispatcherDemo/DemoIRCommandMapping.h b/libraries/IRremote/examples/IRDispatcherDemo/DemoIRCommandMapping.h
new file mode 100644
index 0000000..26110da
--- /dev/null
+++ b/libraries/IRremote/examples/IRDispatcherDemo/DemoIRCommandMapping.h
@@ -0,0 +1,193 @@
+/*
+ * DemoIRCommandMapping.h
+ *
+ * IR remote button codes, strings, and functions to call
+ *
+ * Copyright (C) 2019-2022 Armin Joachimsmeyer
+ * armin.joachimsmeyer@gmail.com
+ *
+ */
+
+#ifndef _IR_COMMAND_MAPPING_H
+#define _IR_COMMAND_MAPPING_H
+
+#include
+//#include "Commands.h" // includes all the commands used in the mapping arrays below
+
+/*
+ * !!! Choose your remote !!!
+ */
+//#define USE_KEYES_REMOTE_CLONE With number pad and direction control switched, will be taken as default
+//#define USE_KEYES_REMOTE
+#if !defined(USE_KEYES_REMOTE) && !defined(USE_KEYES_REMOTE_CLONE)
+#define USE_KEYES_REMOTE_CLONE // the one you can buy at aliexpress
+#endif
+
+#if (defined(USE_KEYES_REMOTE) && defined(USE_KEYES_REMOTE_CLONE))
+#error "Please choose only one remote for compile"
+#endif
+
+#if defined(USE_KEYES_REMOTE_CLONE)
+#define IR_REMOTE_NAME "KEYES_CLONE"
+// Codes for the KEYES CLONE remote control with 17 keys with number pad above direction control
+#if defined(USE_IRMP_LIBRARY)
+#define IR_ADDRESS 0xFF00 // IRMP interprets NEC addresses always as 16 bit
+#else
+#define IR_ADDRESS 0x00
+#endif
+
+#define IR_UP 0x18
+#define IR_DOWN 0x52
+#define IR_RIGHT 0x5A
+#define IR_LEFT 0x08
+#define IR_OK 0x1C
+
+#define IR_1 0x45
+#define IR_2 0x46
+#define IR_3 0x47
+#define IR_4 0x44
+#define IR_5 0x40
+#define IR_6 0x43
+#define IR_7 0x07
+#define IR_8 0x15
+#define IR_9 0x09
+#define IR_0 0x19
+
+#define IR_STAR 0x16
+#define IR_HASH 0x0D
+/*
+ * SECOND:
+ * IR button to command mapping for better reading. IR buttons should only referenced here.
+ */
+#define COMMAND_ON IR_UP
+#define COMMAND_OFF IR_DOWN
+#define COMMAND_INCREASE_BLINK IR_RIGHT
+#define COMMAND_DECREASE_BLINK IR_LEFT
+
+#define COMMAND_START IR_OK
+#define COMMAND_STOP IR_HASH
+#define COMMAND_RESET IR_STAR
+#define COMMAND_BLINK IR_0
+#define COMMAND_TONE1 IR_1
+
+#define COMMAND_TONE2 IR_2
+#define COMMAND_TONE3 IR_3
+//#define IR_4
+//#define IR_5
+//#define IR_6
+//#define IR_7
+//#define IR_8
+//#define IR_9
+
+#endif
+
+#if defined(USE_KEYES_REMOTE)
+#define IR_REMOTE_NAME "KEYES"
+/*
+ * FIRST:
+ * IR code to button mapping for better reading. IR codes should only referenced here.
+ */
+// Codes for the KEYES remote control with 17 keys and direction control above number pad
+#if defined(USE_IRMP_LIBRARY)
+#define IR_ADDRESS 0xFF00 // IRMP interprets NEC addresses always as 16 bit
+#else
+#define IR_ADDRESS 0x00
+#endif
+
+#define IR_UP 0x46
+#define IR_DOWN 0x15
+#define IR_RIGHT 0x43
+#define IR_LEFT 0x44
+#define IR_OK 0x40
+
+#define IR_1 0x16
+#define IR_2 0x19
+#define IR_3 0x0D
+#define IR_4 0x0C
+#define IR_5 0x18
+#define IR_6 0x5E
+#define IR_7 0x08
+#define IR_8 0x1C
+#define IR_9 0x5A
+#define IR_0 0x52
+
+#define IR_STAR 0x42
+#define IR_HASH 0x4A
+
+/*
+ * SECOND:
+ * IR button to command mapping for better reading. IR buttons should only referenced here.
+ */
+#define COMMAND_ON IR_UP
+#define COMMAND_OFF IR_DOWN
+#define COMMAND_INCREASE_BLINK IR_RIGHT
+#define COMMAND_DECREASE_BLINK IR_LEFT
+
+#define COMMAND_RESET IR_OK
+#define COMMAND_STOP IR_HASH
+#define COMMAND_STOP IR_STAR
+#define COMMAND_BLINK IR_0
+#define COMMAND_TONE2 IR_1
+
+#define COMMAND_TONE1 IR_2
+#define COMMAND_TONE2 IR_3
+#define COMMAND_TONE2 IR_4
+#define COMMAND_TONE2 IR_5
+#define COMMAND_TONE2 IR_6
+#define COMMAND_TONE2 IR_7
+#define COMMAND_TONE2 IR_8
+#define COMMAND_TONE2 IR_9
+#endif
+
+/*
+ * THIRD:
+ * Main mapping of commands to C functions
+ */
+
+// IR strings of functions for output
+static const char LEDon[] PROGMEM ="LED on";
+static const char LEDoff[] PROGMEM ="LED off";
+
+static const char blink20times[] PROGMEM ="blink 20 times";
+static const char blinkStart[] PROGMEM ="blink start";
+
+static const char increaseBlink[] PROGMEM ="increase blink frequency";
+static const char decreaseBlink[] PROGMEM ="decrease blink frequency";
+
+static const char tone2200[] PROGMEM ="tone 2200";
+static const char tone1800[] PROGMEM ="tone 1800";
+static const char printMenu[] PROGMEM ="printMenu";
+
+static const char reset[] PROGMEM ="reset";
+static const char stop[] PROGMEM ="stop";
+
+// not used yet
+static const char test[] PROGMEM ="test";
+static const char pattern[] PROGMEM ="pattern";
+static const char unknown[] PROGMEM ="unknown";
+
+/*
+ * Main mapping array of commands to C functions and command strings
+ */
+const struct IRToCommandMappingStruct IRMapping[] = { /**/
+{ COMMAND_BLINK, IR_COMMAND_FLAG_BLOCKING, &doLedBlink20times, blink20times }, /**/
+{ COMMAND_STOP, IR_COMMAND_FLAG_BLOCKING, &doStop, stop },
+
+/*
+ * Short commands, which can be executed always
+ */
+{ COMMAND_TONE1, IR_COMMAND_FLAG_BLOCKING, &doTone1800, tone1800 }, /**/
+{ COMMAND_TONE3, IR_COMMAND_FLAG_BLOCKING, &doPrintMenu, printMenu }, /**/
+{ COMMAND_ON, IR_COMMAND_FLAG_NON_BLOCKING, &doLedOn, LEDon }, /**/
+{ COMMAND_OFF, IR_COMMAND_FLAG_NON_BLOCKING, &doLedOff, LEDoff }, /**/
+{ COMMAND_START, IR_COMMAND_FLAG_NON_BLOCKING, &doLedBlinkStart, blinkStart }, /**/
+{ COMMAND_RESET, IR_COMMAND_FLAG_NON_BLOCKING, &doResetBlinkFrequency, reset },
+
+/*
+ * Repeatable short commands
+ */
+{ COMMAND_TONE2, IR_COMMAND_FLAG_REPEATABLE_NON_BLOCKING, &doTone2200, tone2200 }, /**/
+{ COMMAND_INCREASE_BLINK, IR_COMMAND_FLAG_REPEATABLE_NON_BLOCKING, &doIncreaseBlinkFrequency, increaseBlink }, /**/
+{ COMMAND_DECREASE_BLINK, IR_COMMAND_FLAG_REPEATABLE_NON_BLOCKING, &doDecreaseBlinkFrequency, decreaseBlink } };
+
+#endif // _IR_COMMAND_MAPPING_H
diff --git a/libraries/IRremote/examples/IRDispatcherDemo/IRCommandDispatcher.h b/libraries/IRremote/examples/IRDispatcherDemo/IRCommandDispatcher.h
new file mode 100644
index 0000000..83a98b2
--- /dev/null
+++ b/libraries/IRremote/examples/IRDispatcherDemo/IRCommandDispatcher.h
@@ -0,0 +1,138 @@
+/*
+ * IRCommandDispatcher.h
+ *
+ * Library to process IR commands by calling functions specified in a mapping array.
+ *
+ * To run this example you need to install the "IRremote" or "IRMP" library under "Tools -> Manage Libraries..." or "Ctrl+Shift+I"
+ *
+ * Copyright (C) 2019-2024 Armin Joachimsmeyer
+ * armin.joachimsmeyer@gmail.com
+ *
+ * This file is part of ServoEasing https://github.com/ArminJo/ServoEasing.
+ * This file is part of IRMP https://github.com/IRMP-org/IRMP.
+ * This file is part of Arduino-IRremote https://github.com/Arduino-IRremote/Arduino-IRremote.
+ *
+ * IRCommandDispatcher is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
+ * See the GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see .
+ */
+
+#ifndef _IR_COMMAND_DISPATCHER_H
+#define _IR_COMMAND_DISPATCHER_H
+
+#include
+
+/*
+ * For command mapping file
+ */
+#define IR_COMMAND_FLAG_BLOCKING 0x00 // default - blocking command, repeat not accepted, only one command at a time. Stops an already running command.
+#define IR_COMMAND_FLAG_REPEATABLE 0x01 // repeat accepted
+#define IR_COMMAND_FLAG_NON_BLOCKING 0x02 // Non blocking (short) command that can be processed any time and may interrupt other IR commands - used for stop, set direction etc.
+#define IR_COMMAND_FLAG_REPEATABLE_NON_BLOCKING (IR_COMMAND_FLAG_REPEATABLE | IR_COMMAND_FLAG_NON_BLOCKING)
+#define IR_COMMAND_FLAG_BEEP 0x04 // Do a single short beep before executing command. May not be useful for short or repeating commands.
+#define IR_COMMAND_FLAG_BLOCKING_BEEP (IR_COMMAND_FLAG_BLOCKING | IR_COMMAND_FLAG_BEEP)
+
+
+#if !defined(IS_STOP_REQUESTED)
+#define IS_STOP_REQUESTED IRDispatcher.requestToStopReceived
+#endif
+#if !defined(RETURN_IF_STOP)
+#define RETURN_IF_STOP if (IRDispatcher.requestToStopReceived) return
+#endif
+#if !defined(BREAK_IF_STOP)
+#define BREAK_IF_STOP if (IRDispatcher.requestToStopReceived) break
+#endif
+#if !defined(DELAY_AND_RETURN_IF_STOP)
+#define DELAY_AND_RETURN_IF_STOP(aDurationMillis) if (IRDispatcher.delayAndCheckForStop(aDurationMillis)) return
+#endif
+
+// Basic mapping structure
+struct IRToCommandMappingStruct {
+#if defined(IR_COMMAND_HAS_MORE_THAN_8_BIT)
+ uint16_t IRCode;
+#else
+ uint8_t IRCode;
+#endif
+ uint8_t Flags;
+ void (*CommandToCall)();
+ const char *CommandString;
+};
+
+struct IRDataForCommandDispatcherStruct {
+ uint16_t address; // to distinguish between multiple senders
+#if defined(IR_COMMAND_HAS_MORE_THAN_8_BIT)
+ uint16_t command;
+#else
+ uint8_t command;
+#endif
+ bool isRepeat;
+ uint32_t MillisOfLastCode; // millis() of last IR command -including repeats!- received - for timeouts etc.
+ volatile bool isAvailable; // flag for a polling interpreting function, that a new command has arrived. Is set true by library and set false by main loop.
+};
+
+/*
+ * Special codes (hopefully) not sent by the remote - otherwise please redefine it here
+ */
+#if defined(IR_COMMAND_HAS_MORE_THAN_8_BIT)
+#define COMMAND_EMPTY 0xFFFF // code no command
+#else
+#define COMMAND_EMPTY 0xFF // code no command
+#endif
+
+class IRCommandDispatcher {
+public:
+ void init();
+ void printIRInfo(Print *aSerial);
+
+ bool checkAndRunNonBlockingCommands();
+ bool checkAndRunSuspendedBlockingCommands();
+#if defined(IR_COMMAND_HAS_MORE_THAN_8_BIT)
+ void setNextBlockingCommand(uint16_t aBlockingCommandToRunNext);
+#else
+ void setNextBlockingCommand(uint8_t aBlockingCommandToRunNext);
+#endif
+ bool delayAndCheckForStop(uint16_t aDelayMillis);
+
+ // The main dispatcher function
+ void checkAndCallCommand(bool aCallBlockingCommandImmediately);
+
+ void printIRCommandString(Print *aSerial);
+ void setRequestToStopReceived(bool aRequestToStopReceived = true);
+
+#if defined(IR_COMMAND_HAS_MORE_THAN_8_BIT)
+ uint16_t currentBlockingCommandCalled = COMMAND_EMPTY; // The code for the current called command
+ uint16_t lastBlockingCommandCalled = COMMAND_EMPTY; // The code for the last called command. Can be evaluated by main loop
+ uint16_t BlockingCommandToRunNext = COMMAND_EMPTY; // Storage for command currently suspended to allow the current command to end, before it is called by main loop
+#else
+ uint8_t currentBlockingCommandCalled = COMMAND_EMPTY; // The code for the current called command
+ uint8_t lastBlockingCommandCalled = COMMAND_EMPTY; // The code for the last called command. Can be evaluated by main loop
+ uint8_t BlockingCommandToRunNext = COMMAND_EMPTY; // Storage for command currently suspended to allow the current command to end, before it is called by main loop
+#endif
+ bool justCalledBlockingCommand = false; // Flag that a blocking command was received and called - is set before call of command
+ /*
+ * Flag for running blocking commands to terminate. To check, you can use "if (IRDispatcher.requestToStopReceived) return;" (available as macro RETURN_IF_STOP).
+ * It is set if a blocking IR command received, which cannot be executed directly. Can be reset by main loop, if command has stopped.
+ * It is reset before executing a blocking command.
+ */
+ volatile bool requestToStopReceived;
+ /*
+ * This flag must be true, if we have a function, which want to interpret the IR codes by itself e.g. the calibrate function of QuadrupedControl
+ */
+ bool doNotUseDispatcher = false;
+
+ struct IRDataForCommandDispatcherStruct IRReceivedData;
+
+};
+
+extern IRCommandDispatcher IRDispatcher;
+
+#endif // _IR_COMMAND_DISPATCHER_H
diff --git a/libraries/IRremote/examples/IRDispatcherDemo/IRCommandDispatcher.hpp b/libraries/IRremote/examples/IRDispatcherDemo/IRCommandDispatcher.hpp
new file mode 100644
index 0000000..701103a
--- /dev/null
+++ b/libraries/IRremote/examples/IRDispatcherDemo/IRCommandDispatcher.hpp
@@ -0,0 +1,366 @@
+/*
+ * IRCommandDispatcher.hpp
+ *
+ * Library to process IR commands by calling functions specified in a mapping array.
+ * Commands can be tagged as blocking or non blocking.
+ *
+ * To run this example you need to install the "IRremote" or "IRMP" library.
+ * Install it under "Tools -> Manage Libraries..." or "Ctrl+Shift+I"
+ *
+ * The IR library calls a callback function, which executes a non blocking command directly in ISR (Interrupt Service Routine) context!
+ * A blocking command is stored and sets a stop flag for an already running blocking function to terminate.
+ * The blocking command can in turn be executed by main loop by calling IRDispatcher.checkAndRunSuspendedBlockingCommands().
+ *
+ * Copyright (C) 2019-2024 Armin Joachimsmeyer
+ * armin.joachimsmeyer@gmail.com
+ *
+ * This file is part of ServoEasing https://github.com/ArminJo/ServoEasing.
+ * This file is part of IRMP https://github.com/IRMP-org/IRMP.
+ * This file is part of Arduino-IRremote https://github.com/Arduino-IRremote/Arduino-IRremote.
+ *
+ * IRCommandDispatcher is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
+ * See the GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see .
+ */
+
+/*
+ * Program behavior is modified by the following macros
+ * USE_TINY_IR_RECEIVER
+ * USE_IRMP_LIBRARY
+ * IR_COMMAND_HAS_MORE_THAN_8_BIT
+ */
+
+#ifndef _IR_COMMAND_DISPATCHER_HPP
+#define _IR_COMMAND_DISPATCHER_HPP
+
+#include
+
+#include "IRCommandDispatcher.h"
+
+#if !defined(STR_HELPER)
+#define STR_HELPER(x) #x
+#define STR(x) STR_HELPER(x)
+#endif
+/*
+ * Enable this to see information on each call.
+ * Since there should be no library which uses Serial, it should only be enabled for development purposes.
+ */
+#if defined(INFO) && !defined(LOCAL_INFO)
+#define LOCAL_INFO
+#else
+//#define LOCAL_INFO // This enables info output only for this file
+#endif
+#if defined(DEBUG) && !defined(LOCAL_DEBUG)
+#define LOCAL_DEBUG
+// Propagate debug level
+#define LOCAL_INFO
+#else
+//#define LOCAL_DEBUG // This enables debug output only for this file
+#endif
+
+IRCommandDispatcher IRDispatcher;
+
+#if defined(LOCAL_INFO)
+#define CD_INFO_PRINT(...) Serial.print(__VA_ARGS__);
+#define CD_INFO_PRINTLN(...) Serial.println(__VA_ARGS__);
+#else
+#define CD_INFO_PRINT(...) void();
+#define CD_INFO_PRINTLN(...) void();
+#endif
+
+#if defined(USE_TINY_IR_RECEIVER)
+#define USE_CALLBACK_FOR_TINY_RECEIVER // Call the fixed function "void handleReceivedTinyIRData()" each time a frame or repeat is received.
+#include "TinyIRReceiver.hpp" // included in "IRremote" library
+
+void IRCommandDispatcher::init() {
+ initPCIInterruptForTinyReceiver();
+}
+
+/*
+ * @return true, if IR Receiver is attached
+ */
+void IRCommandDispatcher::printIRInfo(Print *aSerial) {
+ aSerial->println();
+ // For available IR commands see IRCommandMapping.h https://github.com/ArminJo/PWMMotorControl/blob/master/examples/SmartCarFollower/IRCommandMapping.h
+ aSerial->print(F("Listening to IR remote of type "));
+ aSerial->print(IR_REMOTE_NAME);
+ aSerial->println(F(" at pin " STR(IR_RECEIVE_PIN)));
+}
+
+/*
+ * This is the TinyReceiver callback function, which is called if a complete command was received
+ * It checks for right address and then call the dispatcher
+ */
+# if defined(ESP8266) || defined(ESP32)
+IRAM_ATTR
+# endif
+void handleReceivedTinyIRData() {
+ IRDispatcher.IRReceivedData.address = TinyIRReceiverData.Address;
+ IRDispatcher.IRReceivedData.command = TinyIRReceiverData.Command;
+ IRDispatcher.IRReceivedData.isRepeat = TinyIRReceiverData.Flags & IRDATA_FLAGS_IS_REPEAT;
+ IRDispatcher.IRReceivedData.MillisOfLastCode = millis();
+
+# if defined(LOCAL_INFO)
+ printTinyReceiverResultMinimal(&Serial);
+# endif
+
+ if (TinyIRReceiverData.Address == IR_ADDRESS) { // IR_ADDRESS is defined in *IRCommandMapping.h
+ IRDispatcher.IRReceivedData.isAvailable = true;
+ if(!IRDispatcher.doNotUseDispatcher) {
+ /*
+ * Only short (non blocking) commands are executed directly in ISR (Interrupt Service Routine) context,
+ * others are stored for main loop which calls checkAndRunSuspendedBlockingCommands()
+ */
+ IRDispatcher.checkAndCallCommand(false);
+ }
+
+ } else {
+ CD_INFO_PRINT(F("Wrong address. Expected 0x"));
+ CD_INFO_PRINTLN(IR_ADDRESS, HEX);
+ }
+}
+
+#elif defined(USE_IRMP_LIBRARY)
+# if !defined(IRMP_USE_COMPLETE_CALLBACK)
+# error IRMP_USE_COMPLETE_CALLBACK must be activated for IRMP library
+# endif
+
+void IRCommandDispatcher::init() {
+ irmp_init();
+}
+
+/*
+ * This is the callback function, which is called if a complete command was received
+ */
+#if defined(ESP8266) || defined(ESP32)
+IRAM_ATTR
+#endif
+void handleReceivedIRData() {
+ IRMP_DATA tTeporaryData;
+ irmp_get_data(&tTeporaryData);
+ IRDispatcher.IRReceivedData.address = tTeporaryData.address;
+ IRDispatcher.IRReceivedData.command = tTeporaryData.command;
+ IRDispatcher.IRReceivedData.isRepeat = tTeporaryData.flags & IRMP_FLAG_REPETITION;
+ IRDispatcher.IRReceivedData.MillisOfLastCode = millis();
+
+ CD_INFO_PRINT(F("A=0x"));
+ CD_INFO_PRINT(IRDispatcher.IRReceivedData.address, HEX);
+ CD_INFO_PRINT(F(" C=0x"));
+ CD_INFO_PRINT(IRDispatcher.IRReceivedData.command, HEX);
+ if (IRDispatcher.IRReceivedData.isRepeat) {
+ CD_INFO_PRINT(F("R"));
+ }
+ CD_INFO_PRINTLN();
+
+ // To enable delay() for commands
+# if !defined(ARDUINO_ARCH_MBED)
+ interrupts(); // be careful with always executable commands which lasts longer than the IR repeat duration.
+# endif
+
+ if (IRDispatcher.IRReceivedData.address == IR_ADDRESS) {
+ IRDispatcher.checkAndCallCommand(true);
+ } else {
+ CD_INFO_PRINT(F("Wrong address. Expected 0x"));
+ CD_INFO_PRINTLN(IR_ADDRESS, HEX);
+ }
+}
+#endif // elif defined(USE_IRMP_LIBRARY)
+
+/*
+ * The main dispatcher function called by IR-ISR, main loop and checkAndRunSuspendedBlockingCommands()
+ * Non blocking commands are executed directly, blocking commands are executed if enabled by parameter and no other command is just running.
+ * Otherwise request to stop (requestToStopReceived) is set and command is stored for main loop to be later execute by checkAndRunSuspendedBlockingCommands().
+ * Sets flags justCalledRegularIRCommand, executingBlockingCommand, requestToStopReceived
+ * @param aCallBlockingCommandImmediately Run blocking command directly, if no other command is just running. Should be false if called by ISR in order not to block ISR.
+ */
+void IRCommandDispatcher::checkAndCallCommand(bool aCallBlockingCommandImmediately) {
+ if (IRReceivedData.command == COMMAND_EMPTY) {
+ return;
+ }
+
+ /*
+ * Search for command in Array of IRToCommandMappingStruct
+ */
+ for (uint_fast8_t i = 0; i < sizeof(IRMapping) / sizeof(struct IRToCommandMappingStruct); ++i) {
+ if (IRReceivedData.command == IRMapping[i].IRCode) {
+ /*
+ * Command found
+ */
+#if defined(LOCAL_INFO)
+ const __FlashStringHelper *tCommandName = reinterpret_cast(IRMapping[i].CommandString);
+#endif
+ /*
+ * Check for repeat and if repeat is allowed for the current command
+ */
+ if (IRReceivedData.isRepeat && !(IRMapping[i].Flags & IR_COMMAND_FLAG_REPEATABLE)) {
+#if defined(LOCAL_DEBUG)
+ Serial.print(F("Repeats of command \""));
+ Serial.print(tCommandName);
+ Serial.println("\" not accepted");
+#endif
+ return;
+ }
+
+ /*
+ * Do not accept recursive call of the same command
+ */
+ if (currentBlockingCommandCalled == IRReceivedData.command) {
+#if defined(LOCAL_DEBUG)
+ Serial.print(F("Recursive command \""));
+ Serial.print(tCommandName);
+ Serial.println("\" not accepted");
+#endif
+ return;
+ }
+
+ /*
+ * Execute commands
+ */
+ bool tIsNonBlockingCommand = (IRMapping[i].Flags & IR_COMMAND_FLAG_NON_BLOCKING);
+ if (tIsNonBlockingCommand) {
+ // short command here, just call
+ CD_INFO_PRINT(F("Run non blocking command: "));
+ CD_INFO_PRINTLN(tCommandName);
+#if defined(BUZZER_PIN) && defined(USE_TINY_IR_RECEIVER)
+ /*
+ * Do (non blocking) buzzer feedback before command is executed
+ */
+ if(IRMapping[i].Flags & IR_COMMAND_FLAG_BEEP) {
+ tone(BUZZER_PIN, 2200, 50);
+ }
+#endif
+ IRMapping[i].CommandToCall();
+ } else {
+ /*
+ * Blocking command here
+ */
+ if (aCallBlockingCommandImmediately && currentBlockingCommandCalled == COMMAND_EMPTY) {
+ /*
+ * Here no blocking command was running and we are called from main loop
+ */
+ requestToStopReceived = false; // Do not stop the command executed now
+ justCalledBlockingCommand = true;
+ currentBlockingCommandCalled = IRReceivedData.command; // set lock for recursive calls
+ lastBlockingCommandCalled = IRReceivedData.command; // set history, can be evaluated by main loop
+ /*
+ * This call is blocking!!!
+ */
+ CD_INFO_PRINT(F("Run blocking command: "));
+ CD_INFO_PRINTLN(tCommandName);
+
+#if defined(BUZZER_PIN) && defined(USE_TINY_IR_RECEIVER)
+ /*
+ * Do (non blocking) buzzer feedback before command is executed
+ */
+ if(IRMapping[i].Flags & IR_COMMAND_FLAG_BEEP) {
+ tone(BUZZER_PIN, 2200, 50);
+ }
+#endif
+
+ IRMapping[i].CommandToCall();
+#if defined(TRACE)
+ Serial.println(F("End of blocking command"));
+#endif
+ currentBlockingCommandCalled = COMMAND_EMPTY;
+ } else {
+ /*
+ * Called by ISR or another command still running.
+ * Do not run command directly, but set request to stop to true and store command
+ * for main loop to execute by checkAndRunSuspendedBlockingCommands()
+ */
+ BlockingCommandToRunNext = IRReceivedData.command;
+ requestToStopReceived = true; // to stop running command
+ CD_INFO_PRINT(F("Requested stop and stored blocking command "));
+ CD_INFO_PRINT(tCommandName);
+ CD_INFO_PRINTLN(F(" as next command to run."));
+ }
+ }
+ break; // command found
+ } // if (IRReceivedData.command == IRMapping[i].IRCode)
+ } // for loop
+ return;
+}
+
+/*
+ * Intended to be called from main loop
+ * @return true, if command was called
+ */
+bool IRCommandDispatcher::checkAndRunSuspendedBlockingCommands() {
+ /*
+ * Take last rejected command and call associated function
+ */
+ if (BlockingCommandToRunNext != COMMAND_EMPTY) {
+
+ CD_INFO_PRINT(F("Run stored command=0x"));
+ CD_INFO_PRINTLN(BlockingCommandToRunNext, HEX);
+
+ IRReceivedData.command = BlockingCommandToRunNext;
+ BlockingCommandToRunNext = COMMAND_EMPTY;
+ IRReceivedData.isRepeat = false;
+ requestToStopReceived = false; // Do not stop the command executed now
+ checkAndCallCommand(true);
+ return true;
+ }
+ return false;
+}
+
+/*
+ * Not used internally
+ */
+#if defined(IR_COMMAND_HAS_MORE_THAN_8_BIT)
+void IRCommandDispatcher::setNextBlockingCommand(uint16_t aBlockingCommandToRunNext)
+#else
+void IRCommandDispatcher::setNextBlockingCommand(uint8_t aBlockingCommandToRunNext)
+#endif
+ {
+ CD_INFO_PRINT(F("Set next command to run to 0x"));
+ CD_INFO_PRINTLN(aBlockingCommandToRunNext, HEX);
+ BlockingCommandToRunNext = aBlockingCommandToRunNext;
+ requestToStopReceived = true;
+}
+
+/*
+ * Special delay function for the IRCommandDispatcher. Returns prematurely if requestToStopReceived is set.
+ * To be used in blocking functions as delay
+ * @return true - as soon as stop received
+ */
+bool IRCommandDispatcher::delayAndCheckForStop(uint16_t aDelayMillis) {
+ uint32_t tStartMillis = millis();
+ do {
+ if (requestToStopReceived) {
+ return true;
+ }
+ } while (millis() - tStartMillis < aDelayMillis);
+ return false;
+}
+
+void IRCommandDispatcher::printIRCommandString(Print *aSerial) {
+ for (uint_fast8_t i = 0; i < sizeof(IRMapping) / sizeof(struct IRToCommandMappingStruct); ++i) {
+ if (IRReceivedData.command == IRMapping[i].IRCode) {
+ aSerial->println(reinterpret_cast(IRMapping[i].CommandString));
+ return;
+ }
+ }
+ aSerial->println(reinterpret_cast(unknown));
+}
+
+void IRCommandDispatcher::setRequestToStopReceived(bool aRequestToStopReceived) {
+ requestToStopReceived = aRequestToStopReceived;
+}
+
+#if defined(LOCAL_DEBUG)
+#undef LOCAL_DEBUG
+#endif
+#if defined(LOCAL_INFO)
+#undef LOCAL_INFO
+#endif
+#endif // _IR_COMMAND_DISPATCHER_HPP
diff --git a/libraries/IRremote/examples/IRDispatcherDemo/IRDispatcherDemo.ino b/libraries/IRremote/examples/IRDispatcherDemo/IRDispatcherDemo.ino
new file mode 100644
index 0000000..0f924aa
--- /dev/null
+++ b/libraries/IRremote/examples/IRDispatcherDemo/IRDispatcherDemo.ino
@@ -0,0 +1,249 @@
+/*
+ * IRDispatcherDemo.cpp
+ *
+ * Receives NEC IR commands and maps them to different actions by means of a mapping array.
+ *
+ * Copyright (C) 2020-2021 Armin Joachimsmeyer
+ * armin.joachimsmeyer@gmail.com
+ *
+ * This file is part of IRMP https://github.com/IRMP-org/IRMP.
+ * This file is part of Arduino-IRremote https://github.com/Arduino-IRremote/Arduino-IRremote.
+ *
+ * IRMP is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
+ * See the GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see .
+ *
+ */
+
+#include
+
+/*
+ * Choose the library to be used for IR receiving
+ */
+#define USE_TINY_IR_RECEIVER // Recommended, but only for NEC protocol!!! If disabled and IRMP_INPUT_PIN is defined, the IRMP library is used for decoding
+//#define TINY_RECEIVER_USE_ARDUINO_ATTACH_INTERRUPT // Requires additional 112 bytes program memory + 4 bytes RAM
+
+//#include "PinDefinitionsAndMore.h" // Define macros for input and output pin etc.
+
+#define IR_RECEIVE_PIN 4 // P0_1
+#define TONE_PIN 5 // P0_2
+
+// Some kind of auto detect library if USE_TINY_IR_RECEIVER is deactivated
+#if !defined(USE_TINY_IR_RECEIVER)
+# if defined(IR_RECEIVE_PIN)
+#define USE_TINY_IR_RECEIVER
+# elif !defined(USE_IRMP_LIBRARY) && defined(IRMP_INPUT_PIN)
+#define USE_IRMP_LIBRARY
+# else
+#error No IR library selected
+# endif
+#endif
+
+//#define NO_LED_FEEDBACK_CODE // You can set it here, before the include of IRCommandDispatcher below
+
+#if defined(USE_TINY_IR_RECEIVER)
+//#define NO_LED_FEEDBACK_CODE // Activate this if you want to suppress LED feedback or if you do not have a LED. This saves 14 bytes code and 2 clock cycles per interrupt.
+
+#elif defined(USE_IRMP_LIBRARY)
+/*
+ * IRMP version
+ */
+#define IR_RECEIVE_PIN 2
+#define IRMP_USE_COMPLETE_CALLBACK 1 // Enable callback functionality. It is required if IRMP library is used.
+
+//#define IRMP_ENABLE_PIN_CHANGE_INTERRUPT // Enable interrupt functionality (not for all protocols) - requires around 376 additional bytes of program memory
+
+#define IRMP_PROTOCOL_NAMES 1 // Enable protocol number mapping to protocol strings - requires some program memory. Must before #include
+
+#define IRMP_SUPPORT_NEC_PROTOCOL 1 // this enables only one protocol
+//#define IRMP_SUPPORT_KASEIKYO_PROTOCOL 1
+
+/*
+ * After setting the definitions we can include the code and compile it.
+ */
+#include
+void handleReceivedIRData();
+void irmp_tone(uint8_t _pin, unsigned int frequency, unsigned long duration);
+#endif // #if defined(USE_IRMP_LIBRARY)
+
+bool doBlink = false;
+uint16_t sBlinkDelay = 200;
+
+void doPrintMenu();
+void doLedOn();
+void doLedOff();
+void doIncreaseBlinkFrequency();
+void doDecreaseBlinkFrequency();
+void doStop();
+void doResetBlinkFrequency();
+void doLedBlinkStart();
+void doLedBlink20times();
+void doTone1800();
+void doTone2200();
+
+/*
+ * Set definitions and include IRCommandDispatcher library after the declaration of all commands to map
+ */
+#define INFO // to see some informative output
+#include "IRCommandDispatcher.h" // Only for required declarations, the library itself is included below after the definitions of the commands
+#include "DemoIRCommandMapping.h" // must be included before IRCommandDispatcher.hpp to define IR_ADDRESS and IRMapping and string "unknown".
+#include "IRCommandDispatcher.hpp"
+
+/*
+ * Helper macro for getting a macro definition as string
+ */
+#define STR_HELPER(x) #x
+#define STR(x) STR_HELPER(x)
+
+void setup() {
+ pinMode(LED_BUILTIN, OUTPUT);
+ Serial.begin(9600);
+ while (!Serial)
+ ; // Wait for Serial to become available. Is optimized away for some cores.
+
+ // Just to know which program is running on my Arduino
+#if defined(USE_TINY_IR_RECEIVER)
+ Serial.println(F("START " __FILE__ " from " __DATE__ "\r\nUsing TinyIRReceiver"));
+#elif defined(USE_IRREMOTE_LIBRARY)
+ Serial.println(F("START " __FILE__ " from " __DATE__ "\r\nUsing IRremote library version " VERSION_IRREMOTE));
+#elif defined(USE_IRMP_LIBRARY)
+ Serial.println(F("START " __FILE__ " from " __DATE__ "\r\nUsing IRMP library version " VERSION_IRMP));
+#endif
+
+ // play feedback tone before setup, since it kills the IR timer settings
+ tone(TONE_PIN, 1000, 50);
+ delay(50);
+
+ IRDispatcher.init(); // This just calls irmp_init()
+#if defined(USE_TINY_IR_RECEIVER)
+ Serial.println(F("Ready to receive NEC IR signals at pin " STR(IR_RECEIVE_PIN)));
+#else
+ irmp_register_complete_callback_function(&handleReceivedIRData); // fixed function in IRCommandDispatcher.hpp
+
+ Serial.print(F("Ready to receive IR signals of protocols: "));
+ irmp_print_active_protocols(&Serial);
+ Serial.println(F("at pin " STR(IRMP_INPUT_PIN)));
+#endif
+
+ Serial.print(F("Listening to commands of IR remote of type "));
+ Serial.println(IR_REMOTE_NAME);
+ doPrintMenu();
+}
+
+void loop() {
+
+ IRDispatcher.checkAndRunSuspendedBlockingCommands();
+
+ if (doBlink) {
+ digitalWrite(LED_BUILTIN, HIGH);
+ DELAY_AND_RETURN_IF_STOP(sBlinkDelay);
+ digitalWrite(LED_BUILTIN, LOW);
+ DELAY_AND_RETURN_IF_STOP(sBlinkDelay);
+ }
+
+ if (millis() - IRDispatcher.IRReceivedData.MillisOfLastCode > 120000) {
+ //Short beep as remainder, if we did not receive any command in the last 2 minutes
+ IRDispatcher.IRReceivedData.MillisOfLastCode += 120000;
+ doTone1800();
+ }
+
+// delay(10);
+}
+
+void doPrintMenu() {
+ Serial.println();
+ Serial.println(F("Press 1 for tone 1800 Hz"));
+ Serial.println(F("Press 2 for tone 2200 Hz"));
+ Serial.println(F("Press 3 for this Menu"));
+ Serial.println(F("Press 0 for LED blink 20 times"));
+ Serial.println(F("Press UP for LED on"));
+ Serial.println(F("Press DOWN for LED off"));
+ Serial.println(F("Press OK for LED blink start"));
+ Serial.println(F("Press RIGHT for LED increase blink frequency"));
+ Serial.println(F("Press LEFT for LED decrease blink frequency"));
+ Serial.println(F("Press STAR for reset blink frequency"));
+ Serial.println(F("Press HASH for stop"));
+ Serial.println();
+}
+/*
+ * Here the actions that are matched to IR keys
+ */
+void doLedOn() {
+ digitalWrite(LED_BUILTIN, HIGH);
+ doBlink = false;
+}
+void doLedOff() {
+ digitalWrite(LED_BUILTIN, LOW);
+ doBlink = false;
+}
+void doIncreaseBlinkFrequency() {
+ doBlink = true;
+ if (sBlinkDelay > 5) {
+ sBlinkDelay -= sBlinkDelay / 4;
+ }
+}
+void doDecreaseBlinkFrequency() {
+ doBlink = true;
+ sBlinkDelay += sBlinkDelay / 4;
+}
+void doStop() {
+ doBlink = false;
+}
+void doResetBlinkFrequency() {
+ sBlinkDelay = 200;
+ digitalWrite(LED_BUILTIN, LOW);
+}
+void doLedBlinkStart() {
+ doBlink = true;
+}
+/*
+ * This is a blocking function and checks periodically for stop
+ */
+void doLedBlink20times() {
+ for (int i = 0; i < 20; ++i) {
+ digitalWrite(LED_BUILTIN, HIGH);
+ DELAY_AND_RETURN_IF_STOP(200);
+ digitalWrite(LED_BUILTIN, LOW);
+ DELAY_AND_RETURN_IF_STOP(200);
+ }
+}
+
+void doTone1800() {
+#if defined(USE_IRMP_LIBRARY) && !defined(IRMP_ENABLE_PIN_CHANGE_INTERRUPT)
+ irmp_tone(TONE_PIN, 1800, 200);
+#else
+# if !defined(ESP8266) && !defined(NRF5) // tone() stops timer 1 for ESP8266
+ tone(TONE_PIN, 1800, 200);
+# endif
+#endif
+}
+
+void doTone2200() {
+#if defined(USE_IRMP_LIBRARY) && !defined(IRMP_ENABLE_PIN_CHANGE_INTERRUPT)
+ // use IRMP compatible function for tone()
+ irmp_tone(TONE_PIN, 2200, 50);
+#else
+# if !defined(ESP8266) && !defined(NRF5) // tone() stops timer 1 for ESP8266
+ tone(TONE_PIN, 2200, 50);
+# endif
+#endif
+}
+
+#if defined(USE_IRMP_LIBRARY)
+/*
+ * Convenience IRMP compatible wrapper function for Arduino tone() if IRMP_ENABLE_PIN_CHANGE_INTERRUPT is NOT activated
+ * It currently disables the receiving of repeats
+ */
+void irmp_tone(uint8_t _pin, unsigned int frequency, unsigned long duration) {
+ tone(_pin, frequency, duration);
+}
+#endif // #if defined(USE_IRMP_LIBRARY)
diff --git a/libraries/IRremote/examples/IRDispatcherDemo/PinDefinitionsAndMore.h b/libraries/IRremote/examples/IRDispatcherDemo/PinDefinitionsAndMore.h
new file mode 100644
index 0000000..14573c7
--- /dev/null
+++ b/libraries/IRremote/examples/IRDispatcherDemo/PinDefinitionsAndMore.h
@@ -0,0 +1,349 @@
+/*
+ * PinDefinitionsAndMore.h
+ *
+ * Contains pin definitions for IRremote examples for various platforms
+ * as well as definitions for feedback LED and tone() and includes
+ *
+ * Copyright (C) 2021-2023 Armin Joachimsmeyer
+ * armin.joachimsmeyer@gmail.com
+ *
+ * This file is part of IRremote https://github.com/Arduino-IRremote/Arduino-IRremote.
+ *
+ * Arduino-IRremote is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
+ * See the GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see .
+ *
+ */
+
+/*
+ * Pin mapping table for different platforms
+ *
+ * Platform IR input IR output Tone Core/Pin schema
+ * --------------------------------------------------------------
+ * DEFAULT/AVR 2 3 4 Arduino
+ * ATtinyX5 0|PB0 4|PB4 3|PB3 ATTinyCore
+ * ATtiny167 3|PA3 2|PA2 7|PA7 ATTinyCore
+ * ATtiny167 9|PA3 8|PA2 5|PA7 Digispark original core
+ * ATtiny84 |PB2 |PA4 |PA3 ATTinyCore
+ * ATtiny88 3|PD3 4|PD4 9|PB1 ATTinyCore
+ * ATtiny3217 18|PA1 19|PA2 20|PA3 MegaTinyCore
+ * ATtiny1604 2 3|PA5 %
+ * ATtiny816 14|PA1 16|PA3 1|PA5 MegaTinyCore
+ * ATtiny1614 8|PA1 10|PA3 1|PA5 MegaTinyCore
+ * SAMD21 3 4 5
+ * ESP8266 14|D5 12|D6 %
+ * ESP32 15 4 27
+ * ESP32-C3 2 3 4
+ * BluePill PA6 PA7 PA3
+ * APOLLO3 11 12 5
+ * RP2040 3|GPIO15 4|GPIO16 5|GPIO17
+ */
+//#define _IR_MEASURE_TIMING // For debugging purposes.
+
+#if defined(__AVR__)
+#if defined(__AVR_ATtiny25__) || defined(__AVR_ATtiny45__) || defined(__AVR_ATtiny85__) // Digispark board. For use with ATTinyCore.
+#include "ATtinySerialOut.hpp" // TX is at pin 2 - Available as Arduino library "ATtinySerialOut". Saves 700 bytes program memory and 70 bytes RAM for ATtinyCore.
+#define IR_RECEIVE_PIN PIN_PB0
+#define IR_SEND_PIN PIN_PB4 // Pin 2 is serial output with ATtinySerialOut. Pin 1 is internal LED and Pin3 is USB+ with pullup on Digispark board.
+#define TONE_PIN PIN_PB3
+#define _IR_TIMING_TEST_PIN PIN_PB3
+
+# elif defined(__AVR_ATtiny87__) || defined(__AVR_ATtiny167__) // Digispark pro board
+#include "ATtinySerialOut.hpp" // Available as Arduino library "ATtinySerialOut"
+// For ATtiny167 Pins PB6 and PA3 are usable as interrupt source.
+# if defined(ARDUINO_AVR_DIGISPARKPRO)
+// For use with Digispark original core
+#define IR_RECEIVE_PIN 9 // PA3 - on Digispark board labeled as pin 9
+//#define IR_RECEIVE_PIN 14 // PB6 / INT0 is connected to USB+ on DigisparkPro boards
+#define IR_SEND_PIN 8 // PA2 - on Digispark board labeled as pin 8
+#define TONE_PIN 5 // PA7 - on Digispark board labeled as pin 5
+#define _IR_TIMING_TEST_PIN 10 // PA4
+# else
+// For use with ATTinyCore
+#define IR_RECEIVE_PIN PIN_PA3 // On Digispark board labeled as pin 9 - INT0 is connected to USB+ on DigisparkPro boards
+#define IR_SEND_PIN PIN_PA2 // On Digispark board labeled as pin 8
+#define TONE_PIN PIN_PA7 // On Digispark board labeled as pin 5
+# endif
+
+# elif defined(__AVR_ATtiny84__) // For use with ATTinyCore
+#include "ATtinySerialOut.hpp" // Available as Arduino library "ATtinySerialOut". Saves 128 bytes program memory.
+#define IR_RECEIVE_PIN PIN_PB2 // INT0
+#define IR_SEND_PIN PIN_PA4
+#define TONE_PIN PIN_PA3
+#define _IR_TIMING_TEST_PIN PIN_PA5
+
+# elif defined(__AVR_ATtiny88__) // MH-ET Tiny88 board. For use with ATTinyCore.
+#include "ATtinySerialOut.hpp" // Available as Arduino library "ATtinySerialOut". Saves 128 bytes program memory.
+// Pin 6 is TX, pin 7 is RX
+#define IR_RECEIVE_PIN PIN_PD3 // 3 - INT1
+#define IR_SEND_PIN PIN_PD4 // 4
+#define TONE_PIN PIN_PB1 // 9
+#define _IR_TIMING_TEST_PIN PIN_PB0 // 8
+
+# elif defined(__AVR_ATtiny1616__) || defined(__AVR_ATtiny3216__) || defined(__AVR_ATtiny3217__) // For use with megaTinyCore
+// Tiny Core Dev board
+// https://www.tindie.com/products/xkimi/tiny-core-16-dev-board-attiny1616/ - Out of Stock
+// https://www.tindie.com/products/xkimi/tiny-core-32-dev-board-attiny3217/ - Out of Stock
+#define IR_RECEIVE_PIN PIN_PA1 // use 18 instead of PIN_PA1 for TinyCore32
+#define IR_SEND_PIN PIN_PA2 // 19
+#define TONE_PIN PIN_PA3 // 20
+#define APPLICATION_PIN PIN_PA0 // 0
+#undef LED_BUILTIN // No LED available on the TinyCore 32 board, take the one on the programming board which is connected to the DAC output
+#define LED_BUILTIN PIN_PA6 // use 2 instead of PIN_PA6 for TinyCore32
+
+# elif defined(__AVR_ATtiny816__) // For use with megaTinyCore
+#define IR_RECEIVE_PIN PIN_PA1 // 14
+#define IR_SEND_PIN PIN_PA1 // 16
+#define TONE_PIN PIN_PA5 // 1
+#define APPLICATION_PIN PIN_PA4 // 0
+#undef LED_BUILTIN // No LED available, take the one which is connected to the DAC output
+#define LED_BUILTIN PIN_PB5 // 4
+
+# elif defined(__AVR_ATtiny1614__) // For use with megaTinyCore
+#define IR_RECEIVE_PIN PIN_PA1 // 8
+#define IR_SEND_PIN PIN_PA3 // 10
+#define TONE_PIN PIN_PA5 // 1
+#define APPLICATION_PIN PIN_PA4 // 0
+
+# elif defined(__AVR_ATtiny1604__) // For use with megaTinyCore
+#define IR_RECEIVE_PIN PIN_PA6 // 2 - To be compatible with interrupt example, pin 2 is chosen here.
+#define IR_SEND_PIN PIN_PA7 // 3
+#define APPLICATION_PIN PIN_PB2 // 5
+
+#define tone(...) void() // Define as void, since TCB0_INT_vect is also used by tone()
+#define noTone(a) void()
+#define TONE_PIN 42 // Dummy for examples using it
+
+# elif defined(__AVR_ATmega1284__) || defined(__AVR_ATmega1284P__) \
+|| defined(__AVR_ATmega644__) || defined(__AVR_ATmega644P__) \
+|| defined(__AVR_ATmega324P__) || defined(__AVR_ATmega324A__) \
+|| defined(__AVR_ATmega324PA__) || defined(__AVR_ATmega164A__) \
+|| defined(__AVR_ATmega164P__) || defined(__AVR_ATmega32__) \
+|| defined(__AVR_ATmega16__) || defined(__AVR_ATmega8535__) \
+|| defined(__AVR_ATmega64__) || defined(__AVR_ATmega128__) \
+|| defined(__AVR_ATmega1281__) || defined(__AVR_ATmega2561__) \
+|| defined(__AVR_ATmega8515__) || defined(__AVR_ATmega162__)
+#define IR_RECEIVE_PIN 2
+#define IR_SEND_PIN 13
+#define TONE_PIN 4
+#define APPLICATION_PIN 5
+#define ALTERNATIVE_IR_FEEDBACK_LED_PIN 6 // E.g. used for examples which use LED_BUILDIN for example output.
+#define _IR_TIMING_TEST_PIN 7
+
+# else // Default as for ATmega328 like on Uno, Nano, Leonardo, Teensy 2.0 etc.
+#define IR_RECEIVE_PIN 2 // To be compatible with interrupt example, pin 2 is chosen here.
+#define IR_SEND_PIN 3
+#define TONE_PIN 4
+#define APPLICATION_PIN 5
+#define ALTERNATIVE_IR_FEEDBACK_LED_PIN 6 // E.g. used for examples which use LED_BUILDIN for example output.
+#define _IR_TIMING_TEST_PIN 7
+
+# if defined(ARDUINO_AVR_PROMICRO) // Sparkfun Pro Micro is __AVR_ATmega32U4__ but has different external circuit
+// We have no built in LED at pin 13 -> reuse RX LED
+#undef LED_BUILTIN
+#define LED_BUILTIN LED_BUILTIN_RX
+# endif
+# endif // defined(__AVR_ATtiny25__)...
+
+#elif defined(ARDUINO_ARCH_RENESAS_UNO) // Uno R4
+// To be compatible with Uno R3.
+#define IR_RECEIVE_PIN 2
+#define IR_SEND_PIN 3
+#define TONE_PIN 4
+#define APPLICATION_PIN 5
+#define ALTERNATIVE_IR_FEEDBACK_LED_PIN 6 // E.g. used for examples which use LED_BUILDIN for example output.
+#define _IR_TIMING_TEST_PIN 7
+
+#elif defined(ESP8266)
+#define FEEDBACK_LED_IS_ACTIVE_LOW // The LED on my board (D4) is active LOW
+#define IR_RECEIVE_PIN 14 // D5
+#define IR_SEND_PIN 12 // D6 - D4/pin 2 is internal LED
+#define _IR_TIMING_TEST_PIN 2 // D4
+#define APPLICATION_PIN 13 // D7
+
+#define tone(...) void() // tone() inhibits receive timer
+#define noTone(a) void()
+#define TONE_PIN 42 // Dummy for examples using it#
+
+#elif defined(ARDUINO_NOLOGO_ESP32C3_SUPER_MINI)
+#define FEEDBACK_LED_IS_ACTIVE_LOW // The LED on my board (D8) is active LOW
+#define IR_RECEIVE_PIN 2
+#define IR_SEND_PIN 3
+#define TONE_PIN 4
+#define APPLICATION_PIN 10
+
+#elif defined(CONFIG_IDF_TARGET_ESP32C3) || defined(ARDUINO_ESP32C3_DEV)
+#define NO_LED_FEEDBACK_CODE // The WS2812 on pin 8 of AI-C3 board crashes if used as receive feedback LED, other I/O pins are working...
+#define IR_RECEIVE_PIN 6
+#define IR_SEND_PIN 7
+#define TONE_PIN 10
+#define APPLICATION_PIN 18
+
+#elif defined(ESP32)
+#include
+
+// tone() is included in ESP32 core since 2.0.2
+#if !defined(ESP_ARDUINO_VERSION_VAL)
+#define ESP_ARDUINO_VERSION_VAL(major, minor, patch) 12345678
+#endif
+#if ESP_ARDUINO_VERSION <= ESP_ARDUINO_VERSION_VAL(2, 0, 2)
+#define TONE_LEDC_CHANNEL 1 // Using channel 1 makes tone() independent of receiving timer -> No need to stop receiving timer.
+void tone(uint8_t aPinNumber, unsigned int aFrequency){
+ ledcAttachPin(aPinNumber, TONE_LEDC_CHANNEL);
+ ledcWriteTone(TONE_LEDC_CHANNEL, aFrequency);
+}
+void tone(uint8_t aPinNumber, unsigned int aFrequency, unsigned long aDuration){
+ ledcAttachPin(aPinNumber, TONE_LEDC_CHANNEL);
+ ledcWriteTone(TONE_LEDC_CHANNEL, aFrequency);
+ delay(aDuration);
+ ledcWriteTone(TONE_LEDC_CHANNEL, 0);
+}
+void noTone(uint8_t aPinNumber){
+ ledcWriteTone(TONE_LEDC_CHANNEL, 0);
+}
+#endif // ESP_ARDUINO_VERSION <= ESP_ARDUINO_VERSION_VAL(2, 0, 2)
+
+#define IR_RECEIVE_PIN 15 // D15
+#define IR_SEND_PIN 4 // D4
+#define TONE_PIN 27 // D27 25 & 26 are DAC0 and 1
+#define APPLICATION_PIN 16 // RX2 pin
+
+#elif defined(ARDUINO_ARCH_STM32) || defined(ARDUINO_ARCH_STM32F1) // BluePill
+// Timer 3 blocks PA6, PA7, PB0, PB1 for use by Servo or tone()
+#define IR_RECEIVE_PIN PA6
+#define IR_RECEIVE_PIN_STRING "PA6"
+#define IR_SEND_PIN PA7
+#define IR_SEND_PIN_STRING "PA7"
+#define TONE_PIN PA3
+#define _IR_TIMING_TEST_PIN PA5
+#define APPLICATION_PIN PA2
+#define APPLICATION_PIN_STRING "PA2"
+# if defined(ARDUINO_GENERIC_STM32F103C) || defined(ARDUINO_BLUEPILL_F103C8)
+// BluePill LED is active low
+#define FEEDBACK_LED_IS_ACTIVE_LOW
+# endif
+
+#elif defined(ARDUINO_ARCH_APOLLO3) // Sparkfun Apollo boards
+#define IR_RECEIVE_PIN 11
+#define IR_SEND_PIN 12
+#define TONE_PIN 5
+
+#elif defined(ARDUINO_ARCH_MBED) && defined(ARDUINO_ARCH_MBED_NANO) // Arduino Nano 33 BLE and Arduino Nano Connect layout for MBED
+// Must be before ARDUINO_ARCH_RP2040, since it is the layout for the MBED core of Arduino Nano Connect
+#define IR_RECEIVE_PIN 3 // GPIO15 Start with pin 3 since pin 2|GPIO25 is connected to LED on Pi pico
+#define IR_SEND_PIN 4 // GPIO16
+#define TONE_PIN 5
+#define APPLICATION_PIN 6
+#define ALTERNATIVE_IR_FEEDBACK_LED_PIN 7 // E.g. used for examples which use LED_BUILDIN for example output.
+#define _IR_TIMING_TEST_PIN 8
+
+#elif defined(ARDUINO_ARCH_RP2040) // Arduino Nano Connect, Pi Pico with arduino-pico core https://github.com/earlephilhower/arduino-pico
+#define IR_RECEIVE_PIN 15 // GPIO15 to be compatible with the Arduino Nano RP2040 Connect (pin3)
+#define IR_SEND_PIN 16 // GPIO16
+#define TONE_PIN 17
+#define APPLICATION_PIN 18
+#define ALTERNATIVE_IR_FEEDBACK_LED_PIN 19 // E.g. used for examples which use LED_BUILDIN for example output.
+#define _IR_TIMING_TEST_PIN 20
+
+// If you program the Nano RP2040 Connect with this core, then you must redefine LED_BUILTIN
+// and use the external reset with 1 kOhm to ground to enter UF2 mode
+#undef LED_BUILTIN
+#define LED_BUILTIN 6
+
+#elif defined(PARTICLE) // !!!UNTESTED!!!
+#define IR_RECEIVE_PIN A4
+#define IR_SEND_PIN A5 // Particle supports multiple pins
+
+#define LED_BUILTIN D7
+
+/*
+ * 4 times the same (default) layout for easy adaption in the future
+ */
+#elif defined(TEENSYDUINO) // Teensy 2.0 is handled at default for ATmega328 like on Uno, Nano, Leonardo etc.
+#define IR_RECEIVE_PIN 2
+#define IR_SEND_PIN 3
+#define TONE_PIN 4
+#define APPLICATION_PIN 5
+#define ALTERNATIVE_IR_FEEDBACK_LED_PIN 6 // E.g. used for examples which use LED_BUILDIN for example output.
+#define _IR_TIMING_TEST_PIN 7
+
+#elif defined(ARDUINO_ARCH_MBED) // Arduino Nano 33 BLE
+#define IR_RECEIVE_PIN 2
+#define IR_SEND_PIN 3
+#define TONE_PIN 4
+#define APPLICATION_PIN 5
+#define ALTERNATIVE_IR_FEEDBACK_LED_PIN 6 // E.g. used for examples which use LED_BUILDIN for example output.
+#define _IR_TIMING_TEST_PIN 7
+
+#elif defined(ARDUINO_ARCH_SAMD) || defined(ARDUINO_ARCH_SAM)
+#define IR_RECEIVE_PIN 2
+#define IR_SEND_PIN 3
+#define TONE_PIN 4
+#define APPLICATION_PIN 5
+#define ALTERNATIVE_IR_FEEDBACK_LED_PIN 6 // E.g. used for examples which use LED_BUILDIN for example output.
+#define _IR_TIMING_TEST_PIN 7
+
+#if !defined(ARDUINO_SAMD_ADAFRUIT) && !defined(ARDUINO_SEEED_XIAO_M0)
+// On the Zero and others we switch explicitly to SerialUSB
+#define Serial SerialUSB
+#endif
+
+// Definitions for the Chinese SAMD21 M0-Mini clone, which has no led connected to D13/PA17.
+// Attention!!! D2 and D4 are swapped on these boards!!!
+// If you connect the LED, it is on pin 24/PB11. In this case activate the next two lines.
+//#undef LED_BUILTIN
+//#define LED_BUILTIN 24 // PB11
+// As an alternative you can choose pin 25, it is the RX-LED pin (PB03), but active low.In this case activate the next 3 lines.
+//#undef LED_BUILTIN
+//#define LED_BUILTIN 25 // PB03
+//#define FEEDBACK_LED_IS_ACTIVE_LOW // The RX LED on the M0-Mini is active LOW
+
+#elif defined (NRF51) // BBC micro:bit
+#define IR_RECEIVE_PIN 2
+#define IR_SEND_PIN 3
+#define APPLICATION_PIN 1
+#define _IR_TIMING_TEST_PIN 4
+
+#define tone(...) void() // no tone() available
+#define noTone(a) void()
+#define TONE_PIN 42 // Dummy for examples using it
+
+#else
+#warning Board / CPU is not detected using pre-processor symbols -> using default values, which may not fit. Please extend PinDefinitionsAndMore.h.
+// Default valued for unidentified boards
+#define IR_RECEIVE_PIN 2
+#define IR_SEND_PIN 3
+#define TONE_PIN 4
+#define APPLICATION_PIN 5
+#define ALTERNATIVE_IR_FEEDBACK_LED_PIN 6 // E.g. used for examples which use LED_BUILDIN for example output.
+#define _IR_TIMING_TEST_PIN 7
+#endif // defined(ESP8266)
+
+#if defined(ESP32) || defined(ARDUINO_ARCH_RP2040) || defined(PARTICLE) || defined(ARDUINO_ARCH_MBED)
+#define SEND_PWM_BY_TIMER // We do not have pin restrictions for this CPU's, so lets use the hardware PWM for send carrier signal generation
+#else
+# if defined(SEND_PWM_BY_TIMER)
+#undef IR_SEND_PIN // SendPin is determined by timer! This avoids warnings in IRremote.hpp and IRTimer.hpp
+# endif
+#endif
+
+#if !defined (FLASHEND)
+#define FLASHEND 0xFFFF // Dummy value for platforms where FLASHEND is not defined
+#endif
+
+/*
+ * Helper macro for getting a macro definition as string
+ */
+#if !defined(STR_HELPER)
+#define STR_HELPER(x) #x
+#define STR(x) STR_HELPER(x)
+#endif
diff --git a/libraries/IRremote/examples/IRremoteExtensionTest/IRremoteExtensionClass.cpp b/libraries/IRremote/examples/IRremoteExtensionTest/IRremoteExtensionClass.cpp
new file mode 100644
index 0000000..8a315e9
--- /dev/null
+++ b/libraries/IRremote/examples/IRremoteExtensionTest/IRremoteExtensionClass.cpp
@@ -0,0 +1,63 @@
+/*
+ * IRremoteExtensionClass.cpp
+ *
+ * Example for a class which itself uses the IRrecv class from IRremote
+ *
+ * This file is part of Arduino-IRremote https://github.com/Arduino-IRremote/Arduino-IRremote.
+ *
+ ************************************************************************************
+ * MIT License
+ *
+ * Copyright (c) 2021-2024 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.
+ *
+ ************************************************************************************
+ */
+#include
+
+/*
+ * !!! The value of RAW_BUFFER_LENGTH (and some other macros) must be the same in all compile units !!!
+ * Otherwise you may get warnings like "type 'struct IRData' itself violates the C++ One Definition Rule"
+ */
+#if !defined(RAW_BUFFER_LENGTH)
+// For air condition remotes it requires 750. Default is 200.
+# if (defined(RAMEND) && RAMEND <= 0x4FF) || (defined(RAMSIZE) && RAMSIZE < 0x4FF)
+#define RAW_BUFFER_LENGTH 360
+# elif (defined(RAMEND) && RAMEND <= 0x8FF) || (defined(RAMSIZE) && RAMSIZE < 0x8FF)
+#define RAW_BUFFER_LENGTH 750
+# endif
+#endif
+
+#include "IRremoteExtensionClass.h"
+
+IRExtensionClass::IRExtensionClass(IRrecv *aIrReceiver) {
+ MyIrReceiver = aIrReceiver;
+}
+bool IRExtensionClass::decode() {
+ return MyIrReceiver->decode();
+}
+
+bool IRExtensionClass::printIRResultShort(Print *aSerial, bool aPrintRepeatGap, bool aCheckForRecordGapsMicros) {
+ return MyIrReceiver->printIRResultShort(aSerial, aPrintRepeatGap, aCheckForRecordGapsMicros);
+}
+
+void IRExtensionClass::resume() {
+ Serial.println(F("Call resume()"));
+ MyIrReceiver->resume();
+}
diff --git a/libraries/IRremote/examples/IRremoteExtensionTest/IRremoteExtensionClass.h b/libraries/IRremote/examples/IRremoteExtensionTest/IRremoteExtensionClass.h
new file mode 100644
index 0000000..2fa648a
--- /dev/null
+++ b/libraries/IRremote/examples/IRremoteExtensionTest/IRremoteExtensionClass.h
@@ -0,0 +1,46 @@
+/*
+ * IRremoteExtensionClass.h
+ *
+ * Example for a class which itself uses the IRrecv class from IRremote
+ *
+ * This file is part of Arduino-IRremote https://github.com/Arduino-IRremote/Arduino-IRremote.
+ *
+ ************************************************************************************
+ * MIT License
+ *
+ * Copyright (c) 2021-2024 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.
+ *
+ ************************************************************************************
+ */
+#include
+
+#define USE_IRREMOTE_HPP_AS_PLAIN_INCLUDE
+#include
+
+class IRExtensionClass
+{
+public:
+ IRrecv * MyIrReceiver;
+ IRExtensionClass(IRrecv * aIrReceiver);
+ bool decode();
+ bool printIRResultShort(Print *aSerial, bool aPrintRepeatGap = true, bool aCheckForRecordGapsMicros = true);
+ void resume();
+};
+
diff --git a/libraries/IRremote/examples/IRremoteExtensionTest/IRremoteExtensionTest.ino b/libraries/IRremote/examples/IRremoteExtensionTest/IRremoteExtensionTest.ino
new file mode 100644
index 0000000..a0a31d1
--- /dev/null
+++ b/libraries/IRremote/examples/IRremoteExtensionTest/IRremoteExtensionTest.ino
@@ -0,0 +1,80 @@
+/*
+ * IRremoteExtensionTest.cpp
+ * Simple test using the IRremoteExtensionClass.
+ *
+ * This file is part of Arduino-IRremote https://github.com/Arduino-IRremote/Arduino-IRremote.
+ *
+ ************************************************************************************
+ * MIT License
+ *
+ * Copyright (c) 2022 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.
+ *
+ ************************************************************************************
+ */
+#include
+
+#if !defined(RAW_BUFFER_LENGTH)
+#define RAW_BUFFER_LENGTH 750
+#endif
+
+#include
+
+#include "IRremoteExtensionClass.h"
+
+/*
+ * Helper macro for getting a macro definition as string
+ */
+#if !defined(STR_HELPER)
+#define STR_HELPER(x) #x
+#define STR(x) STR_HELPER(x)
+#endif
+
+#define IR_RECEIVE_PIN 4 // 4 P1_9
+
+/*
+ * Create the class, which itself uses the IRrecv class from IRremote
+ */
+IRExtensionClass IRExtension(&IrReceiver);
+
+void setup() {
+ Serial.begin(9600);
+ while (!Serial)
+ ; // Wait for Serial to become available. Is optimized away for some cores.
+
+ // Just to know which program is running on my Arduino
+ Serial.println(F("START " __FILE__ " from " __DATE__ "\r\nUsing library version " VERSION_IRREMOTE));
+
+ // Start the receiver and if not 3. parameter specified, take LED_BUILTIN pin from the internal boards definition as default feedback LED
+ IrReceiver.begin(IR_RECEIVE_PIN, ENABLE_LED_FEEDBACK);
+
+ Serial.print(F("Ready to receive IR signals of protocols: "));
+ printActiveIRProtocols(&Serial);
+ Serial.println(F("at pin " STR(IR_RECEIVE_PIN)));
+
+}
+
+void loop() {
+ if (IRExtension.decode()) {
+ IRExtension.printIRResultShort(&Serial);
+ IrReceiver.printIRSendUsage(&Serial);
+ IRExtension.resume(); // Use the extended function provided by IRExtension class
+ }
+ delay(100);
+}
diff --git a/libraries/IRremote/examples/IRremoteExtensionTest/PinDefinitionsAndMore.h b/libraries/IRremote/examples/IRremoteExtensionTest/PinDefinitionsAndMore.h
new file mode 100644
index 0000000..14573c7
--- /dev/null
+++ b/libraries/IRremote/examples/IRremoteExtensionTest/PinDefinitionsAndMore.h
@@ -0,0 +1,349 @@
+/*
+ * PinDefinitionsAndMore.h
+ *
+ * Contains pin definitions for IRremote examples for various platforms
+ * as well as definitions for feedback LED and tone() and includes
+ *
+ * Copyright (C) 2021-2023 Armin Joachimsmeyer
+ * armin.joachimsmeyer@gmail.com
+ *
+ * This file is part of IRremote https://github.com/Arduino-IRremote/Arduino-IRremote.
+ *
+ * Arduino-IRremote is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
+ * See the GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see .
+ *
+ */
+
+/*
+ * Pin mapping table for different platforms
+ *
+ * Platform IR input IR output Tone Core/Pin schema
+ * --------------------------------------------------------------
+ * DEFAULT/AVR 2 3 4 Arduino
+ * ATtinyX5 0|PB0 4|PB4 3|PB3 ATTinyCore
+ * ATtiny167 3|PA3 2|PA2 7|PA7 ATTinyCore
+ * ATtiny167 9|PA3 8|PA2 5|PA7 Digispark original core
+ * ATtiny84 |PB2 |PA4 |PA3 ATTinyCore
+ * ATtiny88 3|PD3 4|PD4 9|PB1 ATTinyCore
+ * ATtiny3217 18|PA1 19|PA2 20|PA3 MegaTinyCore
+ * ATtiny1604 2 3|PA5 %
+ * ATtiny816 14|PA1 16|PA3 1|PA5 MegaTinyCore
+ * ATtiny1614 8|PA1 10|PA3 1|PA5 MegaTinyCore
+ * SAMD21 3 4 5
+ * ESP8266 14|D5 12|D6 %
+ * ESP32 15 4 27
+ * ESP32-C3 2 3 4
+ * BluePill PA6 PA7 PA3
+ * APOLLO3 11 12 5
+ * RP2040 3|GPIO15 4|GPIO16 5|GPIO17
+ */
+//#define _IR_MEASURE_TIMING // For debugging purposes.
+
+#if defined(__AVR__)
+#if defined(__AVR_ATtiny25__) || defined(__AVR_ATtiny45__) || defined(__AVR_ATtiny85__) // Digispark board. For use with ATTinyCore.
+#include "ATtinySerialOut.hpp" // TX is at pin 2 - Available as Arduino library "ATtinySerialOut". Saves 700 bytes program memory and 70 bytes RAM for ATtinyCore.
+#define IR_RECEIVE_PIN PIN_PB0
+#define IR_SEND_PIN PIN_PB4 // Pin 2 is serial output with ATtinySerialOut. Pin 1 is internal LED and Pin3 is USB+ with pullup on Digispark board.
+#define TONE_PIN PIN_PB3
+#define _IR_TIMING_TEST_PIN PIN_PB3
+
+# elif defined(__AVR_ATtiny87__) || defined(__AVR_ATtiny167__) // Digispark pro board
+#include "ATtinySerialOut.hpp" // Available as Arduino library "ATtinySerialOut"
+// For ATtiny167 Pins PB6 and PA3 are usable as interrupt source.
+# if defined(ARDUINO_AVR_DIGISPARKPRO)
+// For use with Digispark original core
+#define IR_RECEIVE_PIN 9 // PA3 - on Digispark board labeled as pin 9
+//#define IR_RECEIVE_PIN 14 // PB6 / INT0 is connected to USB+ on DigisparkPro boards
+#define IR_SEND_PIN 8 // PA2 - on Digispark board labeled as pin 8
+#define TONE_PIN 5 // PA7 - on Digispark board labeled as pin 5
+#define _IR_TIMING_TEST_PIN 10 // PA4
+# else
+// For use with ATTinyCore
+#define IR_RECEIVE_PIN PIN_PA3 // On Digispark board labeled as pin 9 - INT0 is connected to USB+ on DigisparkPro boards
+#define IR_SEND_PIN PIN_PA2 // On Digispark board labeled as pin 8
+#define TONE_PIN PIN_PA7 // On Digispark board labeled as pin 5
+# endif
+
+# elif defined(__AVR_ATtiny84__) // For use with ATTinyCore
+#include "ATtinySerialOut.hpp" // Available as Arduino library "ATtinySerialOut". Saves 128 bytes program memory.
+#define IR_RECEIVE_PIN PIN_PB2 // INT0
+#define IR_SEND_PIN PIN_PA4
+#define TONE_PIN PIN_PA3
+#define _IR_TIMING_TEST_PIN PIN_PA5
+
+# elif defined(__AVR_ATtiny88__) // MH-ET Tiny88 board. For use with ATTinyCore.
+#include "ATtinySerialOut.hpp" // Available as Arduino library "ATtinySerialOut". Saves 128 bytes program memory.
+// Pin 6 is TX, pin 7 is RX
+#define IR_RECEIVE_PIN PIN_PD3 // 3 - INT1
+#define IR_SEND_PIN PIN_PD4 // 4
+#define TONE_PIN PIN_PB1 // 9
+#define _IR_TIMING_TEST_PIN PIN_PB0 // 8
+
+# elif defined(__AVR_ATtiny1616__) || defined(__AVR_ATtiny3216__) || defined(__AVR_ATtiny3217__) // For use with megaTinyCore
+// Tiny Core Dev board
+// https://www.tindie.com/products/xkimi/tiny-core-16-dev-board-attiny1616/ - Out of Stock
+// https://www.tindie.com/products/xkimi/tiny-core-32-dev-board-attiny3217/ - Out of Stock
+#define IR_RECEIVE_PIN PIN_PA1 // use 18 instead of PIN_PA1 for TinyCore32
+#define IR_SEND_PIN PIN_PA2 // 19
+#define TONE_PIN PIN_PA3 // 20
+#define APPLICATION_PIN PIN_PA0 // 0
+#undef LED_BUILTIN // No LED available on the TinyCore 32 board, take the one on the programming board which is connected to the DAC output
+#define LED_BUILTIN PIN_PA6 // use 2 instead of PIN_PA6 for TinyCore32
+
+# elif defined(__AVR_ATtiny816__) // For use with megaTinyCore
+#define IR_RECEIVE_PIN PIN_PA1 // 14
+#define IR_SEND_PIN PIN_PA1 // 16
+#define TONE_PIN PIN_PA5 // 1
+#define APPLICATION_PIN PIN_PA4 // 0
+#undef LED_BUILTIN // No LED available, take the one which is connected to the DAC output
+#define LED_BUILTIN PIN_PB5 // 4
+
+# elif defined(__AVR_ATtiny1614__) // For use with megaTinyCore
+#define IR_RECEIVE_PIN PIN_PA1 // 8
+#define IR_SEND_PIN PIN_PA3 // 10
+#define TONE_PIN PIN_PA5 // 1
+#define APPLICATION_PIN PIN_PA4 // 0
+
+# elif defined(__AVR_ATtiny1604__) // For use with megaTinyCore
+#define IR_RECEIVE_PIN PIN_PA6 // 2 - To be compatible with interrupt example, pin 2 is chosen here.
+#define IR_SEND_PIN PIN_PA7 // 3
+#define APPLICATION_PIN PIN_PB2 // 5
+
+#define tone(...) void() // Define as void, since TCB0_INT_vect is also used by tone()
+#define noTone(a) void()
+#define TONE_PIN 42 // Dummy for examples using it
+
+# elif defined(__AVR_ATmega1284__) || defined(__AVR_ATmega1284P__) \
+|| defined(__AVR_ATmega644__) || defined(__AVR_ATmega644P__) \
+|| defined(__AVR_ATmega324P__) || defined(__AVR_ATmega324A__) \
+|| defined(__AVR_ATmega324PA__) || defined(__AVR_ATmega164A__) \
+|| defined(__AVR_ATmega164P__) || defined(__AVR_ATmega32__) \
+|| defined(__AVR_ATmega16__) || defined(__AVR_ATmega8535__) \
+|| defined(__AVR_ATmega64__) || defined(__AVR_ATmega128__) \
+|| defined(__AVR_ATmega1281__) || defined(__AVR_ATmega2561__) \
+|| defined(__AVR_ATmega8515__) || defined(__AVR_ATmega162__)
+#define IR_RECEIVE_PIN 2
+#define IR_SEND_PIN 13
+#define TONE_PIN 4
+#define APPLICATION_PIN 5
+#define ALTERNATIVE_IR_FEEDBACK_LED_PIN 6 // E.g. used for examples which use LED_BUILDIN for example output.
+#define _IR_TIMING_TEST_PIN 7
+
+# else // Default as for ATmega328 like on Uno, Nano, Leonardo, Teensy 2.0 etc.
+#define IR_RECEIVE_PIN 2 // To be compatible with interrupt example, pin 2 is chosen here.
+#define IR_SEND_PIN 3
+#define TONE_PIN 4
+#define APPLICATION_PIN 5
+#define ALTERNATIVE_IR_FEEDBACK_LED_PIN 6 // E.g. used for examples which use LED_BUILDIN for example output.
+#define _IR_TIMING_TEST_PIN 7
+
+# if defined(ARDUINO_AVR_PROMICRO) // Sparkfun Pro Micro is __AVR_ATmega32U4__ but has different external circuit
+// We have no built in LED at pin 13 -> reuse RX LED
+#undef LED_BUILTIN
+#define LED_BUILTIN LED_BUILTIN_RX
+# endif
+# endif // defined(__AVR_ATtiny25__)...
+
+#elif defined(ARDUINO_ARCH_RENESAS_UNO) // Uno R4
+// To be compatible with Uno R3.
+#define IR_RECEIVE_PIN 2
+#define IR_SEND_PIN 3
+#define TONE_PIN 4
+#define APPLICATION_PIN 5
+#define ALTERNATIVE_IR_FEEDBACK_LED_PIN 6 // E.g. used for examples which use LED_BUILDIN for example output.
+#define _IR_TIMING_TEST_PIN 7
+
+#elif defined(ESP8266)
+#define FEEDBACK_LED_IS_ACTIVE_LOW // The LED on my board (D4) is active LOW
+#define IR_RECEIVE_PIN 14 // D5
+#define IR_SEND_PIN 12 // D6 - D4/pin 2 is internal LED
+#define _IR_TIMING_TEST_PIN 2 // D4
+#define APPLICATION_PIN 13 // D7
+
+#define tone(...) void() // tone() inhibits receive timer
+#define noTone(a) void()
+#define TONE_PIN 42 // Dummy for examples using it#
+
+#elif defined(ARDUINO_NOLOGO_ESP32C3_SUPER_MINI)
+#define FEEDBACK_LED_IS_ACTIVE_LOW // The LED on my board (D8) is active LOW
+#define IR_RECEIVE_PIN 2
+#define IR_SEND_PIN 3
+#define TONE_PIN 4
+#define APPLICATION_PIN 10
+
+#elif defined(CONFIG_IDF_TARGET_ESP32C3) || defined(ARDUINO_ESP32C3_DEV)
+#define NO_LED_FEEDBACK_CODE // The WS2812 on pin 8 of AI-C3 board crashes if used as receive feedback LED, other I/O pins are working...
+#define IR_RECEIVE_PIN 6
+#define IR_SEND_PIN 7
+#define TONE_PIN 10
+#define APPLICATION_PIN 18
+
+#elif defined(ESP32)
+#include
+
+// tone() is included in ESP32 core since 2.0.2
+#if !defined(ESP_ARDUINO_VERSION_VAL)
+#define ESP_ARDUINO_VERSION_VAL(major, minor, patch) 12345678
+#endif
+#if ESP_ARDUINO_VERSION <= ESP_ARDUINO_VERSION_VAL(2, 0, 2)
+#define TONE_LEDC_CHANNEL 1 // Using channel 1 makes tone() independent of receiving timer -> No need to stop receiving timer.
+void tone(uint8_t aPinNumber, unsigned int aFrequency){
+ ledcAttachPin(aPinNumber, TONE_LEDC_CHANNEL);
+ ledcWriteTone(TONE_LEDC_CHANNEL, aFrequency);
+}
+void tone(uint8_t aPinNumber, unsigned int aFrequency, unsigned long aDuration){
+ ledcAttachPin(aPinNumber, TONE_LEDC_CHANNEL);
+ ledcWriteTone(TONE_LEDC_CHANNEL, aFrequency);
+ delay(aDuration);
+ ledcWriteTone(TONE_LEDC_CHANNEL, 0);
+}
+void noTone(uint8_t aPinNumber){
+ ledcWriteTone(TONE_LEDC_CHANNEL, 0);
+}
+#endif // ESP_ARDUINO_VERSION <= ESP_ARDUINO_VERSION_VAL(2, 0, 2)
+
+#define IR_RECEIVE_PIN 15 // D15
+#define IR_SEND_PIN 4 // D4
+#define TONE_PIN 27 // D27 25 & 26 are DAC0 and 1
+#define APPLICATION_PIN 16 // RX2 pin
+
+#elif defined(ARDUINO_ARCH_STM32) || defined(ARDUINO_ARCH_STM32F1) // BluePill
+// Timer 3 blocks PA6, PA7, PB0, PB1 for use by Servo or tone()
+#define IR_RECEIVE_PIN PA6
+#define IR_RECEIVE_PIN_STRING "PA6"
+#define IR_SEND_PIN PA7
+#define IR_SEND_PIN_STRING "PA7"
+#define TONE_PIN PA3
+#define _IR_TIMING_TEST_PIN PA5
+#define APPLICATION_PIN PA2
+#define APPLICATION_PIN_STRING "PA2"
+# if defined(ARDUINO_GENERIC_STM32F103C) || defined(ARDUINO_BLUEPILL_F103C8)
+// BluePill LED is active low
+#define FEEDBACK_LED_IS_ACTIVE_LOW
+# endif
+
+#elif defined(ARDUINO_ARCH_APOLLO3) // Sparkfun Apollo boards
+#define IR_RECEIVE_PIN 11
+#define IR_SEND_PIN 12
+#define TONE_PIN 5
+
+#elif defined(ARDUINO_ARCH_MBED) && defined(ARDUINO_ARCH_MBED_NANO) // Arduino Nano 33 BLE and Arduino Nano Connect layout for MBED
+// Must be before ARDUINO_ARCH_RP2040, since it is the layout for the MBED core of Arduino Nano Connect
+#define IR_RECEIVE_PIN 3 // GPIO15 Start with pin 3 since pin 2|GPIO25 is connected to LED on Pi pico
+#define IR_SEND_PIN 4 // GPIO16
+#define TONE_PIN 5
+#define APPLICATION_PIN 6
+#define ALTERNATIVE_IR_FEEDBACK_LED_PIN 7 // E.g. used for examples which use LED_BUILDIN for example output.
+#define _IR_TIMING_TEST_PIN 8
+
+#elif defined(ARDUINO_ARCH_RP2040) // Arduino Nano Connect, Pi Pico with arduino-pico core https://github.com/earlephilhower/arduino-pico
+#define IR_RECEIVE_PIN 15 // GPIO15 to be compatible with the Arduino Nano RP2040 Connect (pin3)
+#define IR_SEND_PIN 16 // GPIO16
+#define TONE_PIN 17
+#define APPLICATION_PIN 18
+#define ALTERNATIVE_IR_FEEDBACK_LED_PIN 19 // E.g. used for examples which use LED_BUILDIN for example output.
+#define _IR_TIMING_TEST_PIN 20
+
+// If you program the Nano RP2040 Connect with this core, then you must redefine LED_BUILTIN
+// and use the external reset with 1 kOhm to ground to enter UF2 mode
+#undef LED_BUILTIN
+#define LED_BUILTIN 6
+
+#elif defined(PARTICLE) // !!!UNTESTED!!!
+#define IR_RECEIVE_PIN A4
+#define IR_SEND_PIN A5 // Particle supports multiple pins
+
+#define LED_BUILTIN D7
+
+/*
+ * 4 times the same (default) layout for easy adaption in the future
+ */
+#elif defined(TEENSYDUINO) // Teensy 2.0 is handled at default for ATmega328 like on Uno, Nano, Leonardo etc.
+#define IR_RECEIVE_PIN 2
+#define IR_SEND_PIN 3
+#define TONE_PIN 4
+#define APPLICATION_PIN 5
+#define ALTERNATIVE_IR_FEEDBACK_LED_PIN 6 // E.g. used for examples which use LED_BUILDIN for example output.
+#define _IR_TIMING_TEST_PIN 7
+
+#elif defined(ARDUINO_ARCH_MBED) // Arduino Nano 33 BLE
+#define IR_RECEIVE_PIN 2
+#define IR_SEND_PIN 3
+#define TONE_PIN 4
+#define APPLICATION_PIN 5
+#define ALTERNATIVE_IR_FEEDBACK_LED_PIN 6 // E.g. used for examples which use LED_BUILDIN for example output.
+#define _IR_TIMING_TEST_PIN 7
+
+#elif defined(ARDUINO_ARCH_SAMD) || defined(ARDUINO_ARCH_SAM)
+#define IR_RECEIVE_PIN 2
+#define IR_SEND_PIN 3
+#define TONE_PIN 4
+#define APPLICATION_PIN 5
+#define ALTERNATIVE_IR_FEEDBACK_LED_PIN 6 // E.g. used for examples which use LED_BUILDIN for example output.
+#define _IR_TIMING_TEST_PIN 7
+
+#if !defined(ARDUINO_SAMD_ADAFRUIT) && !defined(ARDUINO_SEEED_XIAO_M0)
+// On the Zero and others we switch explicitly to SerialUSB
+#define Serial SerialUSB
+#endif
+
+// Definitions for the Chinese SAMD21 M0-Mini clone, which has no led connected to D13/PA17.
+// Attention!!! D2 and D4 are swapped on these boards!!!
+// If you connect the LED, it is on pin 24/PB11. In this case activate the next two lines.
+//#undef LED_BUILTIN
+//#define LED_BUILTIN 24 // PB11
+// As an alternative you can choose pin 25, it is the RX-LED pin (PB03), but active low.In this case activate the next 3 lines.
+//#undef LED_BUILTIN
+//#define LED_BUILTIN 25 // PB03
+//#define FEEDBACK_LED_IS_ACTIVE_LOW // The RX LED on the M0-Mini is active LOW
+
+#elif defined (NRF51) // BBC micro:bit
+#define IR_RECEIVE_PIN 2
+#define IR_SEND_PIN 3
+#define APPLICATION_PIN 1
+#define _IR_TIMING_TEST_PIN 4
+
+#define tone(...) void() // no tone() available
+#define noTone(a) void()
+#define TONE_PIN 42 // Dummy for examples using it
+
+#else
+#warning Board / CPU is not detected using pre-processor symbols -> using default values, which may not fit. Please extend PinDefinitionsAndMore.h.
+// Default valued for unidentified boards
+#define IR_RECEIVE_PIN 2
+#define IR_SEND_PIN 3
+#define TONE_PIN 4
+#define APPLICATION_PIN 5
+#define ALTERNATIVE_IR_FEEDBACK_LED_PIN 6 // E.g. used for examples which use LED_BUILDIN for example output.
+#define _IR_TIMING_TEST_PIN 7
+#endif // defined(ESP8266)
+
+#if defined(ESP32) || defined(ARDUINO_ARCH_RP2040) || defined(PARTICLE) || defined(ARDUINO_ARCH_MBED)
+#define SEND_PWM_BY_TIMER // We do not have pin restrictions for this CPU's, so lets use the hardware PWM for send carrier signal generation
+#else
+# if defined(SEND_PWM_BY_TIMER)
+#undef IR_SEND_PIN // SendPin is determined by timer! This avoids warnings in IRremote.hpp and IRTimer.hpp
+# endif
+#endif
+
+#if !defined (FLASHEND)
+#define FLASHEND 0xFFFF // Dummy value for platforms where FLASHEND is not defined
+#endif
+
+/*
+ * Helper macro for getting a macro definition as string
+ */
+#if !defined(STR_HELPER)
+#define STR_HELPER(x) #x
+#define STR(x) STR_HELPER(x)
+#endif
diff --git a/libraries/IRremote/examples/IRremoteInfo/IRremoteInfo.ino b/libraries/IRremote/examples/IRremoteInfo/IRremoteInfo.ino
new file mode 100644
index 0000000..337f49f
--- /dev/null
+++ b/libraries/IRremote/examples/IRremoteInfo/IRremoteInfo.ino
@@ -0,0 +1,244 @@
+/*
+ * IRremote: IRremoteInfo - prints relevant config info & settings for IRremote over serial
+ * Intended to help identify & troubleshoot the various settings of IRremote
+ * For example, sometimes users are unsure of which pin is used for Tx or the RAW_BUFFER_LENGTH value
+ * This example can be used to assist the user directly or with support.
+ * Intended to help identify & troubleshoot the various settings of IRremote
+ * Hopefully this utility will be a useful tool for support & troubleshooting for IRremote
+ * Check out the blog post describing the sketch via http://www.analysir.com/blog/2015/11/28/helper-utility-for-troubleshooting-irremote/
+ * Version 1.0 November 2015
+ * Original Author: AnalysIR - IR software & modules for Makers & Pros, visit http://www.AnalysIR.com
+ */
+#include
+
+//#define EXCLUDE_EXOTIC_PROTOCOLS // saves around 240 bytes program memory if IrSender.write is used
+//#define SEND_PWM_BY_TIMER
+//#define USE_NO_SEND_PWM
+//#define NO_LED_FEEDBACK_CODE // saves 566 bytes program memory
+
+#include
+
+// Function declarations for non Arduino IDE's
+void dumpHeader();
+void dumpRAW_BUFFER_LENGTH();
+void dumpTIMER();
+void dumpTimerPin();
+void dumpClock();
+void dumpPlatform();
+void dumpPulseParams();
+void dumpSignalParams();
+void dumpArduinoIDE();
+void dumpDebugMode();
+void dumpProtocols();
+void dumpFooter();
+
+void setup() {
+ Serial.begin(9600);
+ while (!Serial)
+ ; // Wait for Serial to become available. Is optimized away for some cores.
+
+ // Just to know which program is running on my Arduino
+ Serial.println(F("START " __FILE__ " from " __DATE__ "\r\nUsing library version " VERSION_IRREMOTE));
+
+ //Runs only once per restart of the Arduino.
+ dumpHeader();
+ dumpRAW_BUFFER_LENGTH();
+ dumpClock();
+ dumpPlatform();
+ dumpPulseParams();
+ dumpSignalParams();
+ dumpDebugMode();
+ dumpProtocols();
+ dumpFooter();
+}
+
+void loop() {
+ //nothing to do!
+}
+
+void dumpRAW_BUFFER_LENGTH() {
+ Serial.print(F("RAW_BUFFER_LENGTH: "));
+ Serial.println(RAW_BUFFER_LENGTH);
+}
+
+
+void dumpClock() {
+#if defined(F_CPU)
+ Serial.print(F("MCU Clock: "));
+ Serial.println(F_CPU);
+#endif
+}
+
+void dumpPlatform() {
+ Serial.print(F("MCU Platform: "));
+
+#if defined(MIK32V2)
+ Serial.println(F("MIK32 Amur"));
+#endif
+}
+
+void dumpPulseParams() {
+ Serial.print(F("Mark Excess: "));
+ Serial.print(MARK_EXCESS_MICROS);
+ ;
+ Serial.println(F(" uSecs"));
+ Serial.print(F("Microseconds per tick: "));
+ Serial.print(MICROS_PER_TICK);
+ ;
+ Serial.println(F(" uSecs"));
+ Serial.print(F("Measurement tolerance: "));
+ Serial.print(TOLERANCE_FOR_DECODERS_MARK_OR_SPACE_MATCHING_PERCENT);
+ Serial.println(F("%"));
+}
+
+void dumpSignalParams() {
+ Serial.print(F("Minimum Gap between IR Signals: "));
+ Serial.print(RECORD_GAP_MICROS);
+ Serial.println(F(" uSecs"));
+}
+
+void dumpDebugMode() {
+ Serial.print(F("Debug Mode: "));
+#if DEBUG
+ Serial.println(F("ON"));
+#else
+ Serial.println(F("OFF (Normal)"));
+#endif
+
+}
+
+void dumpProtocols() {
+
+ Serial.println();
+ Serial.print(F("IR PROTOCOLS "));
+ Serial.print(F("SEND "));
+ Serial.println(F("DECODE"));
+ Serial.print(F("============= "));
+ Serial.print(F("======== "));
+ Serial.println(F("========"));
+ Serial.print(F("RC5: "));
+#if defined(DECODE_RC5)
+ Serial.println(F("Enabled"));
+#else
+ Serial.println(F("Disabled"));
+#endif
+
+ Serial.print(F("RC6: "));
+#if defined(DECODE_RC6)
+ Serial.println(F("Enabled"));
+#else
+ Serial.println(F("Disabled"));
+#endif
+
+ Serial.print(F("NEC: "));
+#if defined(DECODE_NEC)
+ Serial.println(F("Enabled"));
+#else
+ Serial.println(F("Disabled"));
+#endif
+
+ Serial.print(F("SONY: "));
+#if defined(DECODE_SONY)
+ Serial.println(F("Enabled"));
+#else
+ Serial.println(F("Disabled"));
+#endif
+
+ Serial.print(F("PANASONIC: "));
+#if defined(DECODE_PANASONIC)
+ Serial.println(F("Enabled"));
+#else
+ Serial.println(F("Disabled"));
+#endif
+
+ Serial.print(F("JVC: "));
+#if defined(DECODE_JVC)
+ Serial.println(F("Enabled"));
+#else
+ Serial.println(F("Disabled"));
+#endif
+
+ Serial.print(F("SAMSUNG: "));
+#if defined(DECODE_SAMSUNG)
+ Serial.println(F("Enabled"));
+#else
+ Serial.println(F("Disabled"));
+#endif
+
+ Serial.print(F("LG: "));
+#if defined(DECODE_LG)
+ Serial.println(F("Enabled"));
+#else
+ Serial.println(F("Disabled"));
+#endif
+
+ Serial.print(F("DENON: "));
+#if defined(DECODE_DENON)
+ Serial.println(F("Enabled"));
+#else
+ Serial.println(F("Disabled"));
+#endif
+
+#if !defined(EXCLUDE_EXOTIC_PROTOCOLS) // saves around 2000 bytes program memory
+
+ Serial.print(F("BANG_OLUFSEN: "));
+#if defined(DECODE_BEO)
+ Serial.println(F("Enabled"));
+#else
+ Serial.println(F("Disabled"));
+#endif
+
+ Serial.print(F("BOSEWAVE: "));
+#if defined(DECODE_BOSEWAVE)
+ Serial.println(F("Enabled"));
+#else
+ Serial.println(F("Disabled"));
+#endif
+
+ Serial.print(F("WHYNTER: "));
+#if defined(DECODE_WHYNTER)
+ Serial.println(F("Enabled"));
+#else
+ Serial.println(F("Disabled"));
+#endif
+
+ Serial.print(F("FAST: "));
+#if defined(DECODE_FAST)
+ Serial.println(F("Enabled"));
+#else
+ Serial.println(F("Disabled"));
+#endif
+#endif
+}
+
+void printDecodeEnabled(int flag) {
+ if (flag) {
+ Serial.println(F("Enabled"));
+ } else {
+ Serial.println(F("Disabled"));
+ }
+}
+
+void dumpHeader() {
+ Serial.println(F("IRremoteInfo - by AnalysIR (http://www.AnalysIR.com/)"));
+ Serial.println(
+ F(
+ "- A helper sketch to assist in troubleshooting issues with the library by reviewing the settings within the IRremote library"));
+ Serial.println(
+ F(
+ "- Prints out the important settings within the library, which can be configured to suit the many supported platforms"));
+ Serial.println(F("- When seeking on-line support, please post or upload the output of this sketch, where appropriate"));
+ Serial.println();
+ Serial.println(F("IRremote Library Settings"));
+ Serial.println(F("========================="));
+}
+
+void dumpFooter() {
+ Serial.println();
+ Serial.println(F("Notes: "));
+ Serial.println(F("- Most of the settings above can be configured in the following files included as part of the library"));
+ Serial.println(F("- IRremoteInt.h"));
+ Serial.println(F("- IRremote.h"));
+ Serial.println(
+ F("- You can save SRAM by disabling the Decode or Send features for any protocol (Near the top of IRremoteInt.h)"));
+}
diff --git a/libraries/IRremote/examples/ReceiveAndSend/PinDefinitionsAndMore.h b/libraries/IRremote/examples/ReceiveAndSend/PinDefinitionsAndMore.h
new file mode 100644
index 0000000..14573c7
--- /dev/null
+++ b/libraries/IRremote/examples/ReceiveAndSend/PinDefinitionsAndMore.h
@@ -0,0 +1,349 @@
+/*
+ * PinDefinitionsAndMore.h
+ *
+ * Contains pin definitions for IRremote examples for various platforms
+ * as well as definitions for feedback LED and tone() and includes
+ *
+ * Copyright (C) 2021-2023 Armin Joachimsmeyer
+ * armin.joachimsmeyer@gmail.com
+ *
+ * This file is part of IRremote https://github.com/Arduino-IRremote/Arduino-IRremote.
+ *
+ * Arduino-IRremote is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
+ * See the GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see .
+ *
+ */
+
+/*
+ * Pin mapping table for different platforms
+ *
+ * Platform IR input IR output Tone Core/Pin schema
+ * --------------------------------------------------------------
+ * DEFAULT/AVR 2 3 4 Arduino
+ * ATtinyX5 0|PB0 4|PB4 3|PB3 ATTinyCore
+ * ATtiny167 3|PA3 2|PA2 7|PA7 ATTinyCore
+ * ATtiny167 9|PA3 8|PA2 5|PA7 Digispark original core
+ * ATtiny84 |PB2 |PA4 |PA3 ATTinyCore
+ * ATtiny88 3|PD3 4|PD4 9|PB1 ATTinyCore
+ * ATtiny3217 18|PA1 19|PA2 20|PA3 MegaTinyCore
+ * ATtiny1604 2 3|PA5 %
+ * ATtiny816 14|PA1 16|PA3 1|PA5 MegaTinyCore
+ * ATtiny1614 8|PA1 10|PA3 1|PA5 MegaTinyCore
+ * SAMD21 3 4 5
+ * ESP8266 14|D5 12|D6 %
+ * ESP32 15 4 27
+ * ESP32-C3 2 3 4
+ * BluePill PA6 PA7 PA3
+ * APOLLO3 11 12 5
+ * RP2040 3|GPIO15 4|GPIO16 5|GPIO17
+ */
+//#define _IR_MEASURE_TIMING // For debugging purposes.
+
+#if defined(__AVR__)
+#if defined(__AVR_ATtiny25__) || defined(__AVR_ATtiny45__) || defined(__AVR_ATtiny85__) // Digispark board. For use with ATTinyCore.
+#include "ATtinySerialOut.hpp" // TX is at pin 2 - Available as Arduino library "ATtinySerialOut". Saves 700 bytes program memory and 70 bytes RAM for ATtinyCore.
+#define IR_RECEIVE_PIN PIN_PB0
+#define IR_SEND_PIN PIN_PB4 // Pin 2 is serial output with ATtinySerialOut. Pin 1 is internal LED and Pin3 is USB+ with pullup on Digispark board.
+#define TONE_PIN PIN_PB3
+#define _IR_TIMING_TEST_PIN PIN_PB3
+
+# elif defined(__AVR_ATtiny87__) || defined(__AVR_ATtiny167__) // Digispark pro board
+#include "ATtinySerialOut.hpp" // Available as Arduino library "ATtinySerialOut"
+// For ATtiny167 Pins PB6 and PA3 are usable as interrupt source.
+# if defined(ARDUINO_AVR_DIGISPARKPRO)
+// For use with Digispark original core
+#define IR_RECEIVE_PIN 9 // PA3 - on Digispark board labeled as pin 9
+//#define IR_RECEIVE_PIN 14 // PB6 / INT0 is connected to USB+ on DigisparkPro boards
+#define IR_SEND_PIN 8 // PA2 - on Digispark board labeled as pin 8
+#define TONE_PIN 5 // PA7 - on Digispark board labeled as pin 5
+#define _IR_TIMING_TEST_PIN 10 // PA4
+# else
+// For use with ATTinyCore
+#define IR_RECEIVE_PIN PIN_PA3 // On Digispark board labeled as pin 9 - INT0 is connected to USB+ on DigisparkPro boards
+#define IR_SEND_PIN PIN_PA2 // On Digispark board labeled as pin 8
+#define TONE_PIN PIN_PA7 // On Digispark board labeled as pin 5
+# endif
+
+# elif defined(__AVR_ATtiny84__) // For use with ATTinyCore
+#include "ATtinySerialOut.hpp" // Available as Arduino library "ATtinySerialOut". Saves 128 bytes program memory.
+#define IR_RECEIVE_PIN PIN_PB2 // INT0
+#define IR_SEND_PIN PIN_PA4
+#define TONE_PIN PIN_PA3
+#define _IR_TIMING_TEST_PIN PIN_PA5
+
+# elif defined(__AVR_ATtiny88__) // MH-ET Tiny88 board. For use with ATTinyCore.
+#include "ATtinySerialOut.hpp" // Available as Arduino library "ATtinySerialOut". Saves 128 bytes program memory.
+// Pin 6 is TX, pin 7 is RX
+#define IR_RECEIVE_PIN PIN_PD3 // 3 - INT1
+#define IR_SEND_PIN PIN_PD4 // 4
+#define TONE_PIN PIN_PB1 // 9
+#define _IR_TIMING_TEST_PIN PIN_PB0 // 8
+
+# elif defined(__AVR_ATtiny1616__) || defined(__AVR_ATtiny3216__) || defined(__AVR_ATtiny3217__) // For use with megaTinyCore
+// Tiny Core Dev board
+// https://www.tindie.com/products/xkimi/tiny-core-16-dev-board-attiny1616/ - Out of Stock
+// https://www.tindie.com/products/xkimi/tiny-core-32-dev-board-attiny3217/ - Out of Stock
+#define IR_RECEIVE_PIN PIN_PA1 // use 18 instead of PIN_PA1 for TinyCore32
+#define IR_SEND_PIN PIN_PA2 // 19
+#define TONE_PIN PIN_PA3 // 20
+#define APPLICATION_PIN PIN_PA0 // 0
+#undef LED_BUILTIN // No LED available on the TinyCore 32 board, take the one on the programming board which is connected to the DAC output
+#define LED_BUILTIN PIN_PA6 // use 2 instead of PIN_PA6 for TinyCore32
+
+# elif defined(__AVR_ATtiny816__) // For use with megaTinyCore
+#define IR_RECEIVE_PIN PIN_PA1 // 14
+#define IR_SEND_PIN PIN_PA1 // 16
+#define TONE_PIN PIN_PA5 // 1
+#define APPLICATION_PIN PIN_PA4 // 0
+#undef LED_BUILTIN // No LED available, take the one which is connected to the DAC output
+#define LED_BUILTIN PIN_PB5 // 4
+
+# elif defined(__AVR_ATtiny1614__) // For use with megaTinyCore
+#define IR_RECEIVE_PIN PIN_PA1 // 8
+#define IR_SEND_PIN PIN_PA3 // 10
+#define TONE_PIN PIN_PA5 // 1
+#define APPLICATION_PIN PIN_PA4 // 0
+
+# elif defined(__AVR_ATtiny1604__) // For use with megaTinyCore
+#define IR_RECEIVE_PIN PIN_PA6 // 2 - To be compatible with interrupt example, pin 2 is chosen here.
+#define IR_SEND_PIN PIN_PA7 // 3
+#define APPLICATION_PIN PIN_PB2 // 5
+
+#define tone(...) void() // Define as void, since TCB0_INT_vect is also used by tone()
+#define noTone(a) void()
+#define TONE_PIN 42 // Dummy for examples using it
+
+# elif defined(__AVR_ATmega1284__) || defined(__AVR_ATmega1284P__) \
+|| defined(__AVR_ATmega644__) || defined(__AVR_ATmega644P__) \
+|| defined(__AVR_ATmega324P__) || defined(__AVR_ATmega324A__) \
+|| defined(__AVR_ATmega324PA__) || defined(__AVR_ATmega164A__) \
+|| defined(__AVR_ATmega164P__) || defined(__AVR_ATmega32__) \
+|| defined(__AVR_ATmega16__) || defined(__AVR_ATmega8535__) \
+|| defined(__AVR_ATmega64__) || defined(__AVR_ATmega128__) \
+|| defined(__AVR_ATmega1281__) || defined(__AVR_ATmega2561__) \
+|| defined(__AVR_ATmega8515__) || defined(__AVR_ATmega162__)
+#define IR_RECEIVE_PIN 2
+#define IR_SEND_PIN 13
+#define TONE_PIN 4
+#define APPLICATION_PIN 5
+#define ALTERNATIVE_IR_FEEDBACK_LED_PIN 6 // E.g. used for examples which use LED_BUILDIN for example output.
+#define _IR_TIMING_TEST_PIN 7
+
+# else // Default as for ATmega328 like on Uno, Nano, Leonardo, Teensy 2.0 etc.
+#define IR_RECEIVE_PIN 2 // To be compatible with interrupt example, pin 2 is chosen here.
+#define IR_SEND_PIN 3
+#define TONE_PIN 4
+#define APPLICATION_PIN 5
+#define ALTERNATIVE_IR_FEEDBACK_LED_PIN 6 // E.g. used for examples which use LED_BUILDIN for example output.
+#define _IR_TIMING_TEST_PIN 7
+
+# if defined(ARDUINO_AVR_PROMICRO) // Sparkfun Pro Micro is __AVR_ATmega32U4__ but has different external circuit
+// We have no built in LED at pin 13 -> reuse RX LED
+#undef LED_BUILTIN
+#define LED_BUILTIN LED_BUILTIN_RX
+# endif
+# endif // defined(__AVR_ATtiny25__)...
+
+#elif defined(ARDUINO_ARCH_RENESAS_UNO) // Uno R4
+// To be compatible with Uno R3.
+#define IR_RECEIVE_PIN 2
+#define IR_SEND_PIN 3
+#define TONE_PIN 4
+#define APPLICATION_PIN 5
+#define ALTERNATIVE_IR_FEEDBACK_LED_PIN 6 // E.g. used for examples which use LED_BUILDIN for example output.
+#define _IR_TIMING_TEST_PIN 7
+
+#elif defined(ESP8266)
+#define FEEDBACK_LED_IS_ACTIVE_LOW // The LED on my board (D4) is active LOW
+#define IR_RECEIVE_PIN 14 // D5
+#define IR_SEND_PIN 12 // D6 - D4/pin 2 is internal LED
+#define _IR_TIMING_TEST_PIN 2 // D4
+#define APPLICATION_PIN 13 // D7
+
+#define tone(...) void() // tone() inhibits receive timer
+#define noTone(a) void()
+#define TONE_PIN 42 // Dummy for examples using it#
+
+#elif defined(ARDUINO_NOLOGO_ESP32C3_SUPER_MINI)
+#define FEEDBACK_LED_IS_ACTIVE_LOW // The LED on my board (D8) is active LOW
+#define IR_RECEIVE_PIN 2
+#define IR_SEND_PIN 3
+#define TONE_PIN 4
+#define APPLICATION_PIN 10
+
+#elif defined(CONFIG_IDF_TARGET_ESP32C3) || defined(ARDUINO_ESP32C3_DEV)
+#define NO_LED_FEEDBACK_CODE // The WS2812 on pin 8 of AI-C3 board crashes if used as receive feedback LED, other I/O pins are working...
+#define IR_RECEIVE_PIN 6
+#define IR_SEND_PIN 7
+#define TONE_PIN 10
+#define APPLICATION_PIN 18
+
+#elif defined(ESP32)
+#include
+
+// tone() is included in ESP32 core since 2.0.2
+#if !defined(ESP_ARDUINO_VERSION_VAL)
+#define ESP_ARDUINO_VERSION_VAL(major, minor, patch) 12345678
+#endif
+#if ESP_ARDUINO_VERSION <= ESP_ARDUINO_VERSION_VAL(2, 0, 2)
+#define TONE_LEDC_CHANNEL 1 // Using channel 1 makes tone() independent of receiving timer -> No need to stop receiving timer.
+void tone(uint8_t aPinNumber, unsigned int aFrequency){
+ ledcAttachPin(aPinNumber, TONE_LEDC_CHANNEL);
+ ledcWriteTone(TONE_LEDC_CHANNEL, aFrequency);
+}
+void tone(uint8_t aPinNumber, unsigned int aFrequency, unsigned long aDuration){
+ ledcAttachPin(aPinNumber, TONE_LEDC_CHANNEL);
+ ledcWriteTone(TONE_LEDC_CHANNEL, aFrequency);
+ delay(aDuration);
+ ledcWriteTone(TONE_LEDC_CHANNEL, 0);
+}
+void noTone(uint8_t aPinNumber){
+ ledcWriteTone(TONE_LEDC_CHANNEL, 0);
+}
+#endif // ESP_ARDUINO_VERSION <= ESP_ARDUINO_VERSION_VAL(2, 0, 2)
+
+#define IR_RECEIVE_PIN 15 // D15
+#define IR_SEND_PIN 4 // D4
+#define TONE_PIN 27 // D27 25 & 26 are DAC0 and 1
+#define APPLICATION_PIN 16 // RX2 pin
+
+#elif defined(ARDUINO_ARCH_STM32) || defined(ARDUINO_ARCH_STM32F1) // BluePill
+// Timer 3 blocks PA6, PA7, PB0, PB1 for use by Servo or tone()
+#define IR_RECEIVE_PIN PA6
+#define IR_RECEIVE_PIN_STRING "PA6"
+#define IR_SEND_PIN PA7
+#define IR_SEND_PIN_STRING "PA7"
+#define TONE_PIN PA3
+#define _IR_TIMING_TEST_PIN PA5
+#define APPLICATION_PIN PA2
+#define APPLICATION_PIN_STRING "PA2"
+# if defined(ARDUINO_GENERIC_STM32F103C) || defined(ARDUINO_BLUEPILL_F103C8)
+// BluePill LED is active low
+#define FEEDBACK_LED_IS_ACTIVE_LOW
+# endif
+
+#elif defined(ARDUINO_ARCH_APOLLO3) // Sparkfun Apollo boards
+#define IR_RECEIVE_PIN 11
+#define IR_SEND_PIN 12
+#define TONE_PIN 5
+
+#elif defined(ARDUINO_ARCH_MBED) && defined(ARDUINO_ARCH_MBED_NANO) // Arduino Nano 33 BLE and Arduino Nano Connect layout for MBED
+// Must be before ARDUINO_ARCH_RP2040, since it is the layout for the MBED core of Arduino Nano Connect
+#define IR_RECEIVE_PIN 3 // GPIO15 Start with pin 3 since pin 2|GPIO25 is connected to LED on Pi pico
+#define IR_SEND_PIN 4 // GPIO16
+#define TONE_PIN 5
+#define APPLICATION_PIN 6
+#define ALTERNATIVE_IR_FEEDBACK_LED_PIN 7 // E.g. used for examples which use LED_BUILDIN for example output.
+#define _IR_TIMING_TEST_PIN 8
+
+#elif defined(ARDUINO_ARCH_RP2040) // Arduino Nano Connect, Pi Pico with arduino-pico core https://github.com/earlephilhower/arduino-pico
+#define IR_RECEIVE_PIN 15 // GPIO15 to be compatible with the Arduino Nano RP2040 Connect (pin3)
+#define IR_SEND_PIN 16 // GPIO16
+#define TONE_PIN 17
+#define APPLICATION_PIN 18
+#define ALTERNATIVE_IR_FEEDBACK_LED_PIN 19 // E.g. used for examples which use LED_BUILDIN for example output.
+#define _IR_TIMING_TEST_PIN 20
+
+// If you program the Nano RP2040 Connect with this core, then you must redefine LED_BUILTIN
+// and use the external reset with 1 kOhm to ground to enter UF2 mode
+#undef LED_BUILTIN
+#define LED_BUILTIN 6
+
+#elif defined(PARTICLE) // !!!UNTESTED!!!
+#define IR_RECEIVE_PIN A4
+#define IR_SEND_PIN A5 // Particle supports multiple pins
+
+#define LED_BUILTIN D7
+
+/*
+ * 4 times the same (default) layout for easy adaption in the future
+ */
+#elif defined(TEENSYDUINO) // Teensy 2.0 is handled at default for ATmega328 like on Uno, Nano, Leonardo etc.
+#define IR_RECEIVE_PIN 2
+#define IR_SEND_PIN 3
+#define TONE_PIN 4
+#define APPLICATION_PIN 5
+#define ALTERNATIVE_IR_FEEDBACK_LED_PIN 6 // E.g. used for examples which use LED_BUILDIN for example output.
+#define _IR_TIMING_TEST_PIN 7
+
+#elif defined(ARDUINO_ARCH_MBED) // Arduino Nano 33 BLE
+#define IR_RECEIVE_PIN 2
+#define IR_SEND_PIN 3
+#define TONE_PIN 4
+#define APPLICATION_PIN 5
+#define ALTERNATIVE_IR_FEEDBACK_LED_PIN 6 // E.g. used for examples which use LED_BUILDIN for example output.
+#define _IR_TIMING_TEST_PIN 7
+
+#elif defined(ARDUINO_ARCH_SAMD) || defined(ARDUINO_ARCH_SAM)
+#define IR_RECEIVE_PIN 2
+#define IR_SEND_PIN 3
+#define TONE_PIN 4
+#define APPLICATION_PIN 5
+#define ALTERNATIVE_IR_FEEDBACK_LED_PIN 6 // E.g. used for examples which use LED_BUILDIN for example output.
+#define _IR_TIMING_TEST_PIN 7
+
+#if !defined(ARDUINO_SAMD_ADAFRUIT) && !defined(ARDUINO_SEEED_XIAO_M0)
+// On the Zero and others we switch explicitly to SerialUSB
+#define Serial SerialUSB
+#endif
+
+// Definitions for the Chinese SAMD21 M0-Mini clone, which has no led connected to D13/PA17.
+// Attention!!! D2 and D4 are swapped on these boards!!!
+// If you connect the LED, it is on pin 24/PB11. In this case activate the next two lines.
+//#undef LED_BUILTIN
+//#define LED_BUILTIN 24 // PB11
+// As an alternative you can choose pin 25, it is the RX-LED pin (PB03), but active low.In this case activate the next 3 lines.
+//#undef LED_BUILTIN
+//#define LED_BUILTIN 25 // PB03
+//#define FEEDBACK_LED_IS_ACTIVE_LOW // The RX LED on the M0-Mini is active LOW
+
+#elif defined (NRF51) // BBC micro:bit
+#define IR_RECEIVE_PIN 2
+#define IR_SEND_PIN 3
+#define APPLICATION_PIN 1
+#define _IR_TIMING_TEST_PIN 4
+
+#define tone(...) void() // no tone() available
+#define noTone(a) void()
+#define TONE_PIN 42 // Dummy for examples using it
+
+#else
+#warning Board / CPU is not detected using pre-processor symbols -> using default values, which may not fit. Please extend PinDefinitionsAndMore.h.
+// Default valued for unidentified boards
+#define IR_RECEIVE_PIN 2
+#define IR_SEND_PIN 3
+#define TONE_PIN 4
+#define APPLICATION_PIN 5
+#define ALTERNATIVE_IR_FEEDBACK_LED_PIN 6 // E.g. used for examples which use LED_BUILDIN for example output.
+#define _IR_TIMING_TEST_PIN 7
+#endif // defined(ESP8266)
+
+#if defined(ESP32) || defined(ARDUINO_ARCH_RP2040) || defined(PARTICLE) || defined(ARDUINO_ARCH_MBED)
+#define SEND_PWM_BY_TIMER // We do not have pin restrictions for this CPU's, so lets use the hardware PWM for send carrier signal generation
+#else
+# if defined(SEND_PWM_BY_TIMER)
+#undef IR_SEND_PIN // SendPin is determined by timer! This avoids warnings in IRremote.hpp and IRTimer.hpp
+# endif
+#endif
+
+#if !defined (FLASHEND)
+#define FLASHEND 0xFFFF // Dummy value for platforms where FLASHEND is not defined
+#endif
+
+/*
+ * Helper macro for getting a macro definition as string
+ */
+#if !defined(STR_HELPER)
+#define STR_HELPER(x) #x
+#define STR(x) STR_HELPER(x)
+#endif
diff --git a/libraries/IRremote/examples/ReceiveAndSend/ReceiveAndSend.ino b/libraries/IRremote/examples/ReceiveAndSend/ReceiveAndSend.ino
new file mode 100644
index 0000000..13fc658
--- /dev/null
+++ b/libraries/IRremote/examples/ReceiveAndSend/ReceiveAndSend.ino
@@ -0,0 +1,248 @@
+/*
+ * ReceiveAndSend.cpp
+ *
+ * Record and play back last received IR signal at button press.
+ * The logic is:
+ * If the button is pressed, send the IR code.
+ * If an IR code is received, record it.
+ * If the protocol is unknown or not enabled, store it as raw data for later sending.
+ *
+ * An example for simultaneous receiving and sending is in the UnitTest example.
+ *
+ * An IR detector/demodulator must be connected to the input IR_RECEIVE_PIN.
+ *
+ * A button must be connected between the input SEND_BUTTON_PIN and ground.
+ * A visible LED can be connected to STATUS_PIN to provide status.
+ *
+ * See also https://dronebotworkshop.com/ir-remotes/#ReceiveAndSend_Code
+ *
+ * Initially coded 2009 Ken Shirriff http://www.righto.com
+ *
+ * This file is part of Arduino-IRremote https://github.com/Arduino-IRremote/Arduino-IRremote.
+ *
+ ************************************************************************************
+ * MIT License
+ *
+ * Copyright (c) 2009-2024 Ken Shirriff, 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.
+ *
+ ************************************************************************************
+ */
+#include
+
+
+/*
+ * Specify which protocol(s) should be used for decoding.
+ * If no protocol is defined, all protocols (except Bang&Olufsen) are active.
+ * This must be done before the #include
+ */
+//#define DECODE_DENON // Includes Sharp
+//#define DECODE_JVC
+//#define DECODE_KASEIKYO
+//#define DECODE_PANASONIC // alias for DECODE_KASEIKYO
+//#define DECODE_LG
+#define DECODE_NEC // Includes Apple and Onkyo
+//#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
+//
+
+#if !defined(RAW_BUFFER_LENGTH)
+#define RAW_BUFFER_LENGTH 750
+#endif
+
+//#define EXCLUDE_UNIVERSAL_PROTOCOLS // Saves up to 1000 bytes program memory.
+//#define EXCLUDE_EXOTIC_PROTOCOLS // saves around 650 bytes program memory if all other protocols are active
+//#define NO_LED_FEEDBACK_CODE // saves 92 bytes program memory
+//#define RECORD_GAP_MICROS 12000 // Default is 8000. Activate it for some LG air conditioner protocols
+//#define SEND_PWM_BY_TIMER // Disable carrier PWM generation in software and use (restricted) hardware PWM.
+//#define USE_NO_SEND_PWM // Use no carrier PWM, just simulate an active low receiver signal. Overrides SEND_PWM_BY_TIMER definition
+
+// 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. See also IRremote.hpp line 142.
+#define MARK_EXCESS_MICROS 20 // Adapt it to your IR receiver module. 20 is recommended for the cheap VS1838 modules.
+
+//#define DEBUG // Activate this for lots of lovely debug output from the decoders.
+
+#define IR_RECEIVE_PIN 4 // P0_1
+#define IR_SEND_PIN 3 // P0_0
+
+int SEND_BUTTON_PIN = BTN_BUILTIN;
+int BTN_ACTIVE_STATE = LOW; // HIGH for Elbear boards, LOW for start board
+
+/*
+ * Helper macro for getting a macro definition as string
+ */
+#if !defined(STR_HELPER)
+#define STR_HELPER(x) #x
+#define STR(x) STR_HELPER(x)
+#endif
+
+#include
+
+int DELAY_BETWEEN_REPEAT = 50;
+
+// Storage for the recorded code
+struct storedIRDataStruct {
+ IRData receivedIRData;
+ // extensions for sendRaw
+ uint8_t rawCode[RAW_BUFFER_LENGTH]; // The durations if raw
+ uint8_t rawCodeLength; // The length of the code
+} sStoredIRData;
+
+bool sSendButtonWasActive;
+
+void storeCode();
+void sendCode(storedIRDataStruct *aIRDataToSend);
+
+void setup() {
+ pinMode(SEND_BUTTON_PIN, INPUT);
+
+ Serial.begin(9600);
+ while (!Serial)
+ ; // Wait for Serial to become available. Is optimized away for some cores.
+
+ // Just to know which program is running on my Arduino
+ Serial.println(F("START " __FILE__ " from " __DATE__ "\r\nUsing library version " VERSION_IRREMOTE));
+
+ // Start the receiver and if not 3. parameter specified, take LED_BUILTIN pin from the internal boards definition as default feedback LED
+ IrReceiver.begin(IR_RECEIVE_PIN, ENABLE_LED_FEEDBACK);
+ Serial.print(F("Ready to receive IR signals of protocols: "));
+ printActiveIRProtocols(&Serial);
+ Serial.println(F("at pin " STR(IR_RECEIVE_PIN)));
+
+ IrSender.begin(); // Start with IR_SEND_PIN as send pin and enable feedback LED at default feedback LED pin
+ Serial.print(F("Ready to send IR signals at pin " STR(IR_SEND_PIN) " on press of button at pin "));
+ Serial.println(SEND_BUTTON_PIN);
+}
+
+void loop() {
+
+ // If button pressed, send the code.
+ bool tSendButtonIsActive = (digitalRead(SEND_BUTTON_PIN) == BTN_ACTIVE_STATE); // Button pin is active LOW
+ /*
+ * Check for current button state
+ */
+ if (tSendButtonIsActive) {
+ if (!sSendButtonWasActive) {
+ Serial.println(F("Stop receiving"));
+ IrReceiver.stop();
+ }
+ /*
+ * Button pressed -> send stored data
+ */
+ Serial.print(F("Button pressed, now sending "));
+ if (sSendButtonWasActive == tSendButtonIsActive) {
+ Serial.print(F("repeat "));
+ sStoredIRData.receivedIRData.flags = IRDATA_FLAGS_IS_REPEAT;
+ } else {
+ sStoredIRData.receivedIRData.flags = IRDATA_FLAGS_EMPTY;
+ }
+ Serial.flush(); // To avoid disturbing the software PWM generation by serial output interrupts
+ sendCode(&sStoredIRData);
+ delay(DELAY_BETWEEN_REPEAT); // Wait a bit between retransmissions
+
+ } else if (sSendButtonWasActive) {
+ /*
+ * Button is just released -> activate receiving
+ */
+ // Restart receiver
+ Serial.println(F("Button released -> start receiving"));
+ IrReceiver.start();
+
+ } else if (IrReceiver.decode()) {
+ /*
+ * Button is not pressed and data available -> store received data and resume
+ */
+ storeCode();
+ IrReceiver.resume(); // resume receiver
+ }
+
+ sSendButtonWasActive = tSendButtonIsActive;
+ delay(100);
+}
+
+// Stores the code for later playback in sStoredIRData
+// Most of this code is just logging
+void storeCode() {
+ if (IrReceiver.decodedIRData.rawDataPtr->rawlen < 4) {
+ Serial.print(F("Ignore data with rawlen="));
+ Serial.println(IrReceiver.decodedIRData.rawDataPtr->rawlen);
+ return;
+ }
+ if (IrReceiver.decodedIRData.flags & IRDATA_FLAGS_IS_REPEAT) {
+ Serial.println(F("Ignore repeat"));
+ return;
+ }
+ if (IrReceiver.decodedIRData.flags & IRDATA_FLAGS_IS_AUTO_REPEAT) {
+ Serial.println(F("Ignore autorepeat"));
+ return;
+ }
+ if (IrReceiver.decodedIRData.flags & IRDATA_FLAGS_PARITY_FAILED) {
+ Serial.println(F("Ignore parity error"));
+ return;
+ }
+ /*
+ * Copy decoded data
+ */
+ sStoredIRData.receivedIRData = IrReceiver.decodedIRData;
+
+ if (sStoredIRData.receivedIRData.protocol == UNKNOWN) {
+ Serial.print(F("Received unknown code and store "));
+ Serial.print(IrReceiver.decodedIRData.rawDataPtr->rawlen - 1);
+ Serial.println(F(" timing entries as raw "));
+ IrReceiver.printIRResultRawFormatted(&Serial, true); // Output the results in RAW format
+ sStoredIRData.rawCodeLength = IrReceiver.decodedIRData.rawDataPtr->rawlen - 1;
+ /*
+ * Store the current raw data in a dedicated array for later usage
+ */
+ IrReceiver.compensateAndStoreIRResultInArray(sStoredIRData.rawCode);
+ } else {
+ IrReceiver.printIRResultShort(&Serial);
+ IrReceiver.printIRSendUsage(&Serial);
+ sStoredIRData.receivedIRData.flags = 0; // clear flags -esp. repeat- for later sending
+ Serial.println();
+ }
+}
+
+void sendCode(storedIRDataStruct *aIRDataToSend) {
+ if (aIRDataToSend->receivedIRData.protocol == UNKNOWN /* i.e. raw */) {
+ // Assume 38 KHz
+ IrSender.sendRaw(aIRDataToSend->rawCode, aIRDataToSend->rawCodeLength, 38);
+
+ Serial.print(F("raw "));
+ Serial.print(aIRDataToSend->rawCodeLength);
+ Serial.println(F(" marks or spaces"));
+ } else {
+
+ /*
+ * Use the write function, which does the switch for different protocols
+ */
+ IrSender.write(&aIRDataToSend->receivedIRData);
+ printIRResultShort(&Serial, &aIRDataToSend->receivedIRData, false);
+ }
+}
+
diff --git a/libraries/IRremote/examples/ReceiveAndSendDistanceWidth/PinDefinitionsAndMore.h b/libraries/IRremote/examples/ReceiveAndSendDistanceWidth/PinDefinitionsAndMore.h
new file mode 100644
index 0000000..14573c7
--- /dev/null
+++ b/libraries/IRremote/examples/ReceiveAndSendDistanceWidth/PinDefinitionsAndMore.h
@@ -0,0 +1,349 @@
+/*
+ * PinDefinitionsAndMore.h
+ *
+ * Contains pin definitions for IRremote examples for various platforms
+ * as well as definitions for feedback LED and tone() and includes
+ *
+ * Copyright (C) 2021-2023 Armin Joachimsmeyer
+ * armin.joachimsmeyer@gmail.com
+ *
+ * This file is part of IRremote https://github.com/Arduino-IRremote/Arduino-IRremote.
+ *
+ * Arduino-IRremote is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
+ * See the GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see .
+ *
+ */
+
+/*
+ * Pin mapping table for different platforms
+ *
+ * Platform IR input IR output Tone Core/Pin schema
+ * --------------------------------------------------------------
+ * DEFAULT/AVR 2 3 4 Arduino
+ * ATtinyX5 0|PB0 4|PB4 3|PB3 ATTinyCore
+ * ATtiny167 3|PA3 2|PA2 7|PA7 ATTinyCore
+ * ATtiny167 9|PA3 8|PA2 5|PA7 Digispark original core
+ * ATtiny84 |PB2 |PA4 |PA3 ATTinyCore
+ * ATtiny88 3|PD3 4|PD4 9|PB1 ATTinyCore
+ * ATtiny3217 18|PA1 19|PA2 20|PA3 MegaTinyCore
+ * ATtiny1604 2 3|PA5 %
+ * ATtiny816 14|PA1 16|PA3 1|PA5 MegaTinyCore
+ * ATtiny1614 8|PA1 10|PA3 1|PA5 MegaTinyCore
+ * SAMD21 3 4 5
+ * ESP8266 14|D5 12|D6 %
+ * ESP32 15 4 27
+ * ESP32-C3 2 3 4
+ * BluePill PA6 PA7 PA3
+ * APOLLO3 11 12 5
+ * RP2040 3|GPIO15 4|GPIO16 5|GPIO17
+ */
+//#define _IR_MEASURE_TIMING // For debugging purposes.
+
+#if defined(__AVR__)
+#if defined(__AVR_ATtiny25__) || defined(__AVR_ATtiny45__) || defined(__AVR_ATtiny85__) // Digispark board. For use with ATTinyCore.
+#include "ATtinySerialOut.hpp" // TX is at pin 2 - Available as Arduino library "ATtinySerialOut". Saves 700 bytes program memory and 70 bytes RAM for ATtinyCore.
+#define IR_RECEIVE_PIN PIN_PB0
+#define IR_SEND_PIN PIN_PB4 // Pin 2 is serial output with ATtinySerialOut. Pin 1 is internal LED and Pin3 is USB+ with pullup on Digispark board.
+#define TONE_PIN PIN_PB3
+#define _IR_TIMING_TEST_PIN PIN_PB3
+
+# elif defined(__AVR_ATtiny87__) || defined(__AVR_ATtiny167__) // Digispark pro board
+#include "ATtinySerialOut.hpp" // Available as Arduino library "ATtinySerialOut"
+// For ATtiny167 Pins PB6 and PA3 are usable as interrupt source.
+# if defined(ARDUINO_AVR_DIGISPARKPRO)
+// For use with Digispark original core
+#define IR_RECEIVE_PIN 9 // PA3 - on Digispark board labeled as pin 9
+//#define IR_RECEIVE_PIN 14 // PB6 / INT0 is connected to USB+ on DigisparkPro boards
+#define IR_SEND_PIN 8 // PA2 - on Digispark board labeled as pin 8
+#define TONE_PIN 5 // PA7 - on Digispark board labeled as pin 5
+#define _IR_TIMING_TEST_PIN 10 // PA4
+# else
+// For use with ATTinyCore
+#define IR_RECEIVE_PIN PIN_PA3 // On Digispark board labeled as pin 9 - INT0 is connected to USB+ on DigisparkPro boards
+#define IR_SEND_PIN PIN_PA2 // On Digispark board labeled as pin 8
+#define TONE_PIN PIN_PA7 // On Digispark board labeled as pin 5
+# endif
+
+# elif defined(__AVR_ATtiny84__) // For use with ATTinyCore
+#include "ATtinySerialOut.hpp" // Available as Arduino library "ATtinySerialOut". Saves 128 bytes program memory.
+#define IR_RECEIVE_PIN PIN_PB2 // INT0
+#define IR_SEND_PIN PIN_PA4
+#define TONE_PIN PIN_PA3
+#define _IR_TIMING_TEST_PIN PIN_PA5
+
+# elif defined(__AVR_ATtiny88__) // MH-ET Tiny88 board. For use with ATTinyCore.
+#include "ATtinySerialOut.hpp" // Available as Arduino library "ATtinySerialOut". Saves 128 bytes program memory.
+// Pin 6 is TX, pin 7 is RX
+#define IR_RECEIVE_PIN PIN_PD3 // 3 - INT1
+#define IR_SEND_PIN PIN_PD4 // 4
+#define TONE_PIN PIN_PB1 // 9
+#define _IR_TIMING_TEST_PIN PIN_PB0 // 8
+
+# elif defined(__AVR_ATtiny1616__) || defined(__AVR_ATtiny3216__) || defined(__AVR_ATtiny3217__) // For use with megaTinyCore
+// Tiny Core Dev board
+// https://www.tindie.com/products/xkimi/tiny-core-16-dev-board-attiny1616/ - Out of Stock
+// https://www.tindie.com/products/xkimi/tiny-core-32-dev-board-attiny3217/ - Out of Stock
+#define IR_RECEIVE_PIN PIN_PA1 // use 18 instead of PIN_PA1 for TinyCore32
+#define IR_SEND_PIN PIN_PA2 // 19
+#define TONE_PIN PIN_PA3 // 20
+#define APPLICATION_PIN PIN_PA0 // 0
+#undef LED_BUILTIN // No LED available on the TinyCore 32 board, take the one on the programming board which is connected to the DAC output
+#define LED_BUILTIN PIN_PA6 // use 2 instead of PIN_PA6 for TinyCore32
+
+# elif defined(__AVR_ATtiny816__) // For use with megaTinyCore
+#define IR_RECEIVE_PIN PIN_PA1 // 14
+#define IR_SEND_PIN PIN_PA1 // 16
+#define TONE_PIN PIN_PA5 // 1
+#define APPLICATION_PIN PIN_PA4 // 0
+#undef LED_BUILTIN // No LED available, take the one which is connected to the DAC output
+#define LED_BUILTIN PIN_PB5 // 4
+
+# elif defined(__AVR_ATtiny1614__) // For use with megaTinyCore
+#define IR_RECEIVE_PIN PIN_PA1 // 8
+#define IR_SEND_PIN PIN_PA3 // 10
+#define TONE_PIN PIN_PA5 // 1
+#define APPLICATION_PIN PIN_PA4 // 0
+
+# elif defined(__AVR_ATtiny1604__) // For use with megaTinyCore
+#define IR_RECEIVE_PIN PIN_PA6 // 2 - To be compatible with interrupt example, pin 2 is chosen here.
+#define IR_SEND_PIN PIN_PA7 // 3
+#define APPLICATION_PIN PIN_PB2 // 5
+
+#define tone(...) void() // Define as void, since TCB0_INT_vect is also used by tone()
+#define noTone(a) void()
+#define TONE_PIN 42 // Dummy for examples using it
+
+# elif defined(__AVR_ATmega1284__) || defined(__AVR_ATmega1284P__) \
+|| defined(__AVR_ATmega644__) || defined(__AVR_ATmega644P__) \
+|| defined(__AVR_ATmega324P__) || defined(__AVR_ATmega324A__) \
+|| defined(__AVR_ATmega324PA__) || defined(__AVR_ATmega164A__) \
+|| defined(__AVR_ATmega164P__) || defined(__AVR_ATmega32__) \
+|| defined(__AVR_ATmega16__) || defined(__AVR_ATmega8535__) \
+|| defined(__AVR_ATmega64__) || defined(__AVR_ATmega128__) \
+|| defined(__AVR_ATmega1281__) || defined(__AVR_ATmega2561__) \
+|| defined(__AVR_ATmega8515__) || defined(__AVR_ATmega162__)
+#define IR_RECEIVE_PIN 2
+#define IR_SEND_PIN 13
+#define TONE_PIN 4
+#define APPLICATION_PIN 5
+#define ALTERNATIVE_IR_FEEDBACK_LED_PIN 6 // E.g. used for examples which use LED_BUILDIN for example output.
+#define _IR_TIMING_TEST_PIN 7
+
+# else // Default as for ATmega328 like on Uno, Nano, Leonardo, Teensy 2.0 etc.
+#define IR_RECEIVE_PIN 2 // To be compatible with interrupt example, pin 2 is chosen here.
+#define IR_SEND_PIN 3
+#define TONE_PIN 4
+#define APPLICATION_PIN 5
+#define ALTERNATIVE_IR_FEEDBACK_LED_PIN 6 // E.g. used for examples which use LED_BUILDIN for example output.
+#define _IR_TIMING_TEST_PIN 7
+
+# if defined(ARDUINO_AVR_PROMICRO) // Sparkfun Pro Micro is __AVR_ATmega32U4__ but has different external circuit
+// We have no built in LED at pin 13 -> reuse RX LED
+#undef LED_BUILTIN
+#define LED_BUILTIN LED_BUILTIN_RX
+# endif
+# endif // defined(__AVR_ATtiny25__)...
+
+#elif defined(ARDUINO_ARCH_RENESAS_UNO) // Uno R4
+// To be compatible with Uno R3.
+#define IR_RECEIVE_PIN 2
+#define IR_SEND_PIN 3
+#define TONE_PIN 4
+#define APPLICATION_PIN 5
+#define ALTERNATIVE_IR_FEEDBACK_LED_PIN 6 // E.g. used for examples which use LED_BUILDIN for example output.
+#define _IR_TIMING_TEST_PIN 7
+
+#elif defined(ESP8266)
+#define FEEDBACK_LED_IS_ACTIVE_LOW // The LED on my board (D4) is active LOW
+#define IR_RECEIVE_PIN 14 // D5
+#define IR_SEND_PIN 12 // D6 - D4/pin 2 is internal LED
+#define _IR_TIMING_TEST_PIN 2 // D4
+#define APPLICATION_PIN 13 // D7
+
+#define tone(...) void() // tone() inhibits receive timer
+#define noTone(a) void()
+#define TONE_PIN 42 // Dummy for examples using it#
+
+#elif defined(ARDUINO_NOLOGO_ESP32C3_SUPER_MINI)
+#define FEEDBACK_LED_IS_ACTIVE_LOW // The LED on my board (D8) is active LOW
+#define IR_RECEIVE_PIN 2
+#define IR_SEND_PIN 3
+#define TONE_PIN 4
+#define APPLICATION_PIN 10
+
+#elif defined(CONFIG_IDF_TARGET_ESP32C3) || defined(ARDUINO_ESP32C3_DEV)
+#define NO_LED_FEEDBACK_CODE // The WS2812 on pin 8 of AI-C3 board crashes if used as receive feedback LED, other I/O pins are working...
+#define IR_RECEIVE_PIN 6
+#define IR_SEND_PIN 7
+#define TONE_PIN 10
+#define APPLICATION_PIN 18
+
+#elif defined(ESP32)
+#include
+
+// tone() is included in ESP32 core since 2.0.2
+#if !defined(ESP_ARDUINO_VERSION_VAL)
+#define ESP_ARDUINO_VERSION_VAL(major, minor, patch) 12345678
+#endif
+#if ESP_ARDUINO_VERSION <= ESP_ARDUINO_VERSION_VAL(2, 0, 2)
+#define TONE_LEDC_CHANNEL 1 // Using channel 1 makes tone() independent of receiving timer -> No need to stop receiving timer.
+void tone(uint8_t aPinNumber, unsigned int aFrequency){
+ ledcAttachPin(aPinNumber, TONE_LEDC_CHANNEL);
+ ledcWriteTone(TONE_LEDC_CHANNEL, aFrequency);
+}
+void tone(uint8_t aPinNumber, unsigned int aFrequency, unsigned long aDuration){
+ ledcAttachPin(aPinNumber, TONE_LEDC_CHANNEL);
+ ledcWriteTone(TONE_LEDC_CHANNEL, aFrequency);
+ delay(aDuration);
+ ledcWriteTone(TONE_LEDC_CHANNEL, 0);
+}
+void noTone(uint8_t aPinNumber){
+ ledcWriteTone(TONE_LEDC_CHANNEL, 0);
+}
+#endif // ESP_ARDUINO_VERSION <= ESP_ARDUINO_VERSION_VAL(2, 0, 2)
+
+#define IR_RECEIVE_PIN 15 // D15
+#define IR_SEND_PIN 4 // D4
+#define TONE_PIN 27 // D27 25 & 26 are DAC0 and 1
+#define APPLICATION_PIN 16 // RX2 pin
+
+#elif defined(ARDUINO_ARCH_STM32) || defined(ARDUINO_ARCH_STM32F1) // BluePill
+// Timer 3 blocks PA6, PA7, PB0, PB1 for use by Servo or tone()
+#define IR_RECEIVE_PIN PA6
+#define IR_RECEIVE_PIN_STRING "PA6"
+#define IR_SEND_PIN PA7
+#define IR_SEND_PIN_STRING "PA7"
+#define TONE_PIN PA3
+#define _IR_TIMING_TEST_PIN PA5
+#define APPLICATION_PIN PA2
+#define APPLICATION_PIN_STRING "PA2"
+# if defined(ARDUINO_GENERIC_STM32F103C) || defined(ARDUINO_BLUEPILL_F103C8)
+// BluePill LED is active low
+#define FEEDBACK_LED_IS_ACTIVE_LOW
+# endif
+
+#elif defined(ARDUINO_ARCH_APOLLO3) // Sparkfun Apollo boards
+#define IR_RECEIVE_PIN 11
+#define IR_SEND_PIN 12
+#define TONE_PIN 5
+
+#elif defined(ARDUINO_ARCH_MBED) && defined(ARDUINO_ARCH_MBED_NANO) // Arduino Nano 33 BLE and Arduino Nano Connect layout for MBED
+// Must be before ARDUINO_ARCH_RP2040, since it is the layout for the MBED core of Arduino Nano Connect
+#define IR_RECEIVE_PIN 3 // GPIO15 Start with pin 3 since pin 2|GPIO25 is connected to LED on Pi pico
+#define IR_SEND_PIN 4 // GPIO16
+#define TONE_PIN 5
+#define APPLICATION_PIN 6
+#define ALTERNATIVE_IR_FEEDBACK_LED_PIN 7 // E.g. used for examples which use LED_BUILDIN for example output.
+#define _IR_TIMING_TEST_PIN 8
+
+#elif defined(ARDUINO_ARCH_RP2040) // Arduino Nano Connect, Pi Pico with arduino-pico core https://github.com/earlephilhower/arduino-pico
+#define IR_RECEIVE_PIN 15 // GPIO15 to be compatible with the Arduino Nano RP2040 Connect (pin3)
+#define IR_SEND_PIN 16 // GPIO16
+#define TONE_PIN 17
+#define APPLICATION_PIN 18
+#define ALTERNATIVE_IR_FEEDBACK_LED_PIN 19 // E.g. used for examples which use LED_BUILDIN for example output.
+#define _IR_TIMING_TEST_PIN 20
+
+// If you program the Nano RP2040 Connect with this core, then you must redefine LED_BUILTIN
+// and use the external reset with 1 kOhm to ground to enter UF2 mode
+#undef LED_BUILTIN
+#define LED_BUILTIN 6
+
+#elif defined(PARTICLE) // !!!UNTESTED!!!
+#define IR_RECEIVE_PIN A4
+#define IR_SEND_PIN A5 // Particle supports multiple pins
+
+#define LED_BUILTIN D7
+
+/*
+ * 4 times the same (default) layout for easy adaption in the future
+ */
+#elif defined(TEENSYDUINO) // Teensy 2.0 is handled at default for ATmega328 like on Uno, Nano, Leonardo etc.
+#define IR_RECEIVE_PIN 2
+#define IR_SEND_PIN 3
+#define TONE_PIN 4
+#define APPLICATION_PIN 5
+#define ALTERNATIVE_IR_FEEDBACK_LED_PIN 6 // E.g. used for examples which use LED_BUILDIN for example output.
+#define _IR_TIMING_TEST_PIN 7
+
+#elif defined(ARDUINO_ARCH_MBED) // Arduino Nano 33 BLE
+#define IR_RECEIVE_PIN 2
+#define IR_SEND_PIN 3
+#define TONE_PIN 4
+#define APPLICATION_PIN 5
+#define ALTERNATIVE_IR_FEEDBACK_LED_PIN 6 // E.g. used for examples which use LED_BUILDIN for example output.
+#define _IR_TIMING_TEST_PIN 7
+
+#elif defined(ARDUINO_ARCH_SAMD) || defined(ARDUINO_ARCH_SAM)
+#define IR_RECEIVE_PIN 2
+#define IR_SEND_PIN 3
+#define TONE_PIN 4
+#define APPLICATION_PIN 5
+#define ALTERNATIVE_IR_FEEDBACK_LED_PIN 6 // E.g. used for examples which use LED_BUILDIN for example output.
+#define _IR_TIMING_TEST_PIN 7
+
+#if !defined(ARDUINO_SAMD_ADAFRUIT) && !defined(ARDUINO_SEEED_XIAO_M0)
+// On the Zero and others we switch explicitly to SerialUSB
+#define Serial SerialUSB
+#endif
+
+// Definitions for the Chinese SAMD21 M0-Mini clone, which has no led connected to D13/PA17.
+// Attention!!! D2 and D4 are swapped on these boards!!!
+// If you connect the LED, it is on pin 24/PB11. In this case activate the next two lines.
+//#undef LED_BUILTIN
+//#define LED_BUILTIN 24 // PB11
+// As an alternative you can choose pin 25, it is the RX-LED pin (PB03), but active low.In this case activate the next 3 lines.
+//#undef LED_BUILTIN
+//#define LED_BUILTIN 25 // PB03
+//#define FEEDBACK_LED_IS_ACTIVE_LOW // The RX LED on the M0-Mini is active LOW
+
+#elif defined (NRF51) // BBC micro:bit
+#define IR_RECEIVE_PIN 2
+#define IR_SEND_PIN 3
+#define APPLICATION_PIN 1
+#define _IR_TIMING_TEST_PIN 4
+
+#define tone(...) void() // no tone() available
+#define noTone(a) void()
+#define TONE_PIN 42 // Dummy for examples using it
+
+#else
+#warning Board / CPU is not detected using pre-processor symbols -> using default values, which may not fit. Please extend PinDefinitionsAndMore.h.
+// Default valued for unidentified boards
+#define IR_RECEIVE_PIN 2
+#define IR_SEND_PIN 3
+#define TONE_PIN 4
+#define APPLICATION_PIN 5
+#define ALTERNATIVE_IR_FEEDBACK_LED_PIN 6 // E.g. used for examples which use LED_BUILDIN for example output.
+#define _IR_TIMING_TEST_PIN 7
+#endif // defined(ESP8266)
+
+#if defined(ESP32) || defined(ARDUINO_ARCH_RP2040) || defined(PARTICLE) || defined(ARDUINO_ARCH_MBED)
+#define SEND_PWM_BY_TIMER // We do not have pin restrictions for this CPU's, so lets use the hardware PWM for send carrier signal generation
+#else
+# if defined(SEND_PWM_BY_TIMER)
+#undef IR_SEND_PIN // SendPin is determined by timer! This avoids warnings in IRremote.hpp and IRTimer.hpp
+# endif
+#endif
+
+#if !defined (FLASHEND)
+#define FLASHEND 0xFFFF // Dummy value for platforms where FLASHEND is not defined
+#endif
+
+/*
+ * Helper macro for getting a macro definition as string
+ */
+#if !defined(STR_HELPER)
+#define STR_HELPER(x) #x
+#define STR(x) STR_HELPER(x)
+#endif
diff --git a/libraries/IRremote/examples/ReceiveAndSendDistanceWidth/ReceiveAndSendDistanceWidth.ino b/libraries/IRremote/examples/ReceiveAndSendDistanceWidth/ReceiveAndSendDistanceWidth.ino
new file mode 100644
index 0000000..f3d8a13
--- /dev/null
+++ b/libraries/IRremote/examples/ReceiveAndSendDistanceWidth/ReceiveAndSendDistanceWidth.ino
@@ -0,0 +1,191 @@
+/*
+ * ReceiveAndSendDistanceWidth.cpp
+ *
+ * Record and play back last received distance width IR signal at button press.
+ * Using DistanceWidthProtocol covers a lot of known and unknown IR protocols,
+ * and requires less memory than raw protocol.
+ *
+ * The logic is:
+ * If the button is pressed, send the IR code.
+ * If an IR code is received, record it.
+ *
+ * An example for simultaneous receiving and sending is in the UnitTest example.
+ *
+ * An IR detector/demodulator must be connected to the input IR_RECEIVE_PIN.
+ *
+ * A button must be connected between the input SEND_BUTTON_PIN and ground.
+ * A visible LED can be connected to STATUS_PIN to provide status.
+ *
+ * See also https://dronebotworkshop.com/ir-remotes/#ReceiveAndSendDistanceWidth_Code
+ *
+ * This file is part of Arduino-IRremote https://github.com/Arduino-IRremote/Arduino-IRremote.
+ *
+ ************************************************************************************
+ * MIT License
+ *
+ * Copyright (c) 2023 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.
+ *
+ ************************************************************************************
+ */
+#include
+
+#if !defined(IR_SEND_PIN)
+#define IR_SEND_PIN 3 // P0_0
+#endif
+
+#define IR_RECEIVE_PIN 4 // P0_1
+
+#define SEND_BUTTON_PIN BTN_BUILTIN
+#define BTN_ACTIVE_STATE HIGH // HIGH for Elbear boards, LOW for Start board
+
+/*
+ * Helper macro for getting a macro definition as string
+ */
+#if !defined(STR_HELPER)
+#define STR_HELPER(x) #x
+#define STR(x) STR_HELPER(x)
+#endif
+
+
+/*
+ * Specify DistanceWidthProtocol for decoding. This must be done before the #include
+ */
+#define DECODE_DISTANCE_WIDTH // Universal decoder for pulse distance width protocols
+//
+#if !defined(RAW_BUFFER_LENGTH)
+#define RAW_BUFFER_LENGTH 750
+#endif
+
+//#define NO_LED_FEEDBACK_CODE // saves 92 bytes program memory
+//#define RECORD_GAP_MICROS 12000 // Default is 8000. Activate it for some LG air conditioner protocols
+//#define SEND_PWM_BY_TIMER // Disable carrier PWM generation in software and use (restricted) hardware PWM.
+//#define USE_NO_SEND_PWM // Use no carrier PWM, just simulate an active low receiver signal. Overrides SEND_PWM_BY_TIMER definition
+
+//#define DEBUG // Activate this for lots of lovely debug output from the decoders.
+
+#include
+
+#define DELAY_BETWEEN_REPEATS_MILLIS 70
+
+// Storage for the recorded code, pre-filled with NEC data
+IRRawDataType sDecodedRawDataArray[RAW_DATA_ARRAY_SIZE] = { 0x7B34ED12 }; // Initialize with NEC address 0x12 and command 0x34
+DistanceWidthTimingInfoStruct sDistanceWidthTimingInfo = { 9000, 4500, 560, 1690, 560, 560 }; // Initialize with NEC timing
+uint8_t sNumberOfBits = 32;
+
+bool sSendButtonWasActive;
+
+void setup() {
+ pinMode(SEND_BUTTON_PIN, INPUT);
+
+ Serial.begin(9600);
+ while (!Serial)
+ ; // Wait for Serial to become available. Is optimized away for some cores.
+
+ // Just to know which program is running on my Arduino
+ Serial.println(F("START " __FILE__ " from " __DATE__ "\r\nUsing library version " VERSION_IRREMOTE));
+
+ // Start the receiver and if not 3. parameter specified, take LED_BUILTIN pin from the internal boards definition as default feedback LED
+ IrReceiver.begin(IR_RECEIVE_PIN, ENABLE_LED_FEEDBACK);
+ Serial.println(F("Ready to receive pulse distance/width coded IR signals at pin " STR(IR_RECEIVE_PIN)));
+
+ IrSender.begin(); // Start with IR_SEND_PIN as send pin and enable feedback LED at default feedback LED pin
+ Serial.print(F("Ready to send IR signals at pin " STR(IR_SEND_PIN) " on press of button at pin "));
+ Serial.println(SEND_BUTTON_PIN);
+}
+
+void loop() {
+
+ // If button pressed, send the code.
+ bool tSendButtonIsActive = (digitalRead(SEND_BUTTON_PIN) == BTN_ACTIVE_STATE);
+
+ /*
+ * Check for current button state
+ */
+ if (tSendButtonIsActive) {
+ if (!sSendButtonWasActive) {
+ Serial.println(F("Stop receiving"));
+ IrReceiver.stop();
+ }
+ /*
+ * Button pressed -> send stored data
+ */
+ Serial.print(F("Button pressed, now sending "));
+ Serial.print(sNumberOfBits);
+ Serial.print(F(" bits 0x"));
+ Serial.print(sDecodedRawDataArray[0], HEX);
+ Serial.print(F(" with sendPulseDistanceWidthFromArray timing="));
+ IrReceiver.printDistanceWidthTimingInfo(&Serial, &sDistanceWidthTimingInfo);
+ Serial.println();
+ Serial.flush(); // To avoid disturbing the software PWM generation by serial output interrupts
+
+ IrSender.sendPulseDistanceWidthFromArray(38, &sDistanceWidthTimingInfo, &sDecodedRawDataArray[0], sNumberOfBits,
+#if defined(USE_MSB_DECODING_FOR_DISTANCE_DECODER)
+ PROTOCOL_IS_MSB_FIRST
+#else
+ PROTOCOL_IS_LSB_FIRST
+#endif
+ , 100, 0);
+
+ delay(DELAY_BETWEEN_REPEATS_MILLIS); // Wait a bit between retransmissions
+
+ } else if (sSendButtonWasActive) {
+ /*
+ * Button is just released -> activate receiving
+ */
+ // Restart receiver
+ Serial.println(F("Button released -> start receiving"));
+ IrReceiver.start();
+
+ } else if (IrReceiver.decode()) {
+ /*
+ * Button is not pressed and data available -> store received data and resume
+ * DistanceWidthTimingInfo and sNumberOfBits should be constant for all keys of the same IR remote / protocol
+ */
+ IrReceiver.printIRResultShort(&Serial);
+ if (IrReceiver.decodedIRData.protocol != UNKNOWN) {
+ IrReceiver.printIRSendUsage(&Serial);
+
+ if (memcmp(&sDistanceWidthTimingInfo, &IrReceiver.decodedIRData.DistanceWidthTimingInfo,
+ sizeof(sDistanceWidthTimingInfo)) != 0) {
+ Serial.print(F("Store new timing info data="));
+ IrReceiver.printDistanceWidthTimingInfo(&Serial, &IrReceiver.decodedIRData.DistanceWidthTimingInfo);
+ Serial.println();
+ sDistanceWidthTimingInfo = IrReceiver.decodedIRData.DistanceWidthTimingInfo; // copy content here
+ } else {
+ Serial.print(F("Timing did not change, so we can reuse already stored timing info."));
+ }
+ if (sNumberOfBits != IrReceiver.decodedIRData.numberOfBits) {
+ Serial.print(F("Store new numberOfBits="));
+ sNumberOfBits = IrReceiver.decodedIRData.numberOfBits;
+ Serial.println(IrReceiver.decodedIRData.numberOfBits);
+ }
+ if (sDecodedRawDataArray[0] != IrReceiver.decodedIRData.decodedRawDataArray[0]) {
+ *sDecodedRawDataArray = *IrReceiver.decodedIRData.decodedRawDataArray; // copy content here
+ Serial.print(F("Store new sDecodedRawDataArray[0]=0x"));
+ Serial.println(IrReceiver.decodedIRData.decodedRawDataArray[0], HEX);
+ }
+ }
+ IrReceiver.resume(); // resume receiver
+ Serial.println();
+ }
+
+ sSendButtonWasActive = tSendButtonIsActive;
+ delay(100);
+}
diff --git a/libraries/IRremote/examples/ReceiveDemo/IRremote_SendDemo_ReceiveDemo.log b/libraries/IRremote/examples/ReceiveDemo/IRremote_SendDemo_ReceiveDemo.log
new file mode 100644
index 0000000..d56a948
--- /dev/null
+++ b/libraries/IRremote/examples/ReceiveDemo/IRremote_SendDemo_ReceiveDemo.log
@@ -0,0 +1,178 @@
+START ../src/ReceiveDemo.cpp from Feb 24 2023
+Using library version 4.1.0
+Enabling IRin...
+Ready to receive IR signals of protocols: NEC/NEC2/Onkyo/Apple, Panasonic/Kaseikyo, Denon/Sharp, Sony, RC5, RC6, LG, JVC, Samsung, FAST, Whynter, Lego Power Functions, Bosewave , MagiQuest, Universal Pulse Distance Width, Hash at pin 2
+
+If you connect debug pin 5 to ground, raw data is always printed
+5000 us is the (minimum) gap, after which the start of a new IR packet is assumed
+20 us are subtracted from all marks and added to all spaces for decoding
+
+Protocol=NEC Address=0x2 Command=0x34 Raw-Data=0xCB34FD02 32 bits LSB first
+Send with: IrSender.sendNEC(0x2, 0x34, );
+
+Protocol=NEC Address=0x102 Command=0x34 Raw-Data=0xCB340102 32 bits LSB first
+Send with: IrSender.sendNEC(0x102, 0x34, );
+
+Protocol=NEC Address=0x102 Command=0x34 Raw-Data=0xCB340102 32 bits LSB first
+Send with: IrSender.sendNEC(0x102, 0x34, );
+
+Protocol=NEC Address=0x80 Command=0x45 Raw-Data=0xBA457F80 32 bits LSB first
+Send with: IrSender.sendNEC(0x80, 0x45, );
+
+Protocol=NEC Address=0x4 Command=0x8 Raw-Data=0xF708FB04 32 bits LSB first
+Send with: IrSender.sendNEC(0x4, 0x8, );
+
+Protocol=Onkyo Address=0x102 Command=0x304 Raw-Data=0x3040102 32 bits LSB first
+Send with: IrSender.sendOnkyo(0x102, 0x304, );
+
+Protocol=NEC Address=0x102 Command=0x34 Raw-Data=0xCB340102 32 bits LSB first
+Send with: IrSender.sendNEC(0x102, 0x34, );
+
+Protocol=Panasonic Address=0xB Command=0x10 Raw-Data=0xA01000B0 48 bits LSB first
+Send with: IrSender.sendPanasonic(0xB, 0x10, );
+
+Protocol=Panasonic Address=0xB Command=0x10 Raw-Data=0xA01000B0 48 bits LSB first
+Send with: IrSender.sendPanasonic(0xB, 0x10, );
+
+Protocol=Panasonic Address=0xB Command=0x10 Raw-Data=0xA01000B0 48 bits LSB first
+Send with: IrSender.sendPanasonic(0xB, 0x10, );
+
+Protocol=PulseDistance Raw-Data=0x5A 72 bits LSB first
+Send with:
+ uint32_t tRawData[]={0x87654321, 0xAFEDCBA9, 0x5A};
+ IrSender.sendPulseDistanceWidthFromArray(38, 8850, 4400, 550, 1700, 550, 600, &tRawData[0], 72, PROTOCOL_IS_LSB_FIRST, , );
+
+Protocol=PulseWidth Raw-Data=0xDCBA9 52 bits LSB first
+Send with:
+ uint32_t tRawData[]={0x87654321, 0xDCBA9};
+ IrSender.sendPulseDistanceWidthFromArray(38, 300, 600, 600, 300, 350, 600, &tRawData[0], 52, PROTOCOL_IS_LSB_FIRST, , );
+
+Protocol=PulseWidth Raw-Data=0x87654321 32 bits LSB first
+Send with: IrSender.sendPulseDistanceWidth(38, 1000, 500, 600, 300, 350, 300, 0x87654321, 32, PROTOCOL_IS_LSB_FIRST, , );
+
+Protocol=Onkyo Address=0x102 Command=0x5634 Raw-Data=0x56340102 32 bits LSB first
+Send with: IrSender.sendOnkyo(0x102, 0x5634, );
+
+Protocol=Apple Address=0x2 Command=0x34 Raw-Data=0x23487EE 32 bits LSB first
+Send with: IrSender.sendApple(0x2, 0x34, );
+
+Protocol=Panasonic Address=0x102 Command=0x34 Raw-Data=0x4341020 48 bits LSB first
+Send with: IrSender.sendPanasonic(0x102, 0x34, );
+
+Protocol=Kaseikyo Address=0x102 Command=0x34 Extra=0x4711 Raw-Data=0x7341023 48 bits LSB first
+Send with: IrSender.sendKaseikyo(0x102, 0x34, , 0x4711);
+
+Protocol=Kaseikyo_Denon Address=0x102 Command=0x34 Raw-Data=0x4341020 48 bits LSB first
+Send with: IrSender.sendKaseikyo_Denon(0x102, 0x34, );
+
+Protocol=Denon Address=0x2 Command=0x34 Raw-Data=0x682 15 bits LSB first
+Send with: IrSender.sendDenon(0x2, 0x34, );
+
+Protocol=Denon Address=0x2 Command=0x34 Auto-Repeat gap=45650us Raw-Data=0x7962 15 bits LSB first
+
+Protocol=Sharp Address=0x2 Command=0x34 Raw-Data=0x4682 15 bits LSB first
+Send with: IrSender.sendSharp(0x2, 0x34, );
+
+Protocol=Sharp Address=0x2 Command=0x34 Auto-Repeat gap=46400us Raw-Data=0x3962 15 bits LSB first
+
+Protocol=Sony Address=0x2 Command=0x34 Raw-Data=0x134 12 bits LSB first
+Send with: IrSender.sendSony(0x2, 0x34, 2, 12);
+
+Protocol=Sony Address=0x2 Command=0x34 Raw-Data=0x134 15 bits LSB first
+Send with: IrSender.sendSony(0x2, 0x34, 2, 15);
+
+Protocol=Sony Address=0x102 Command=0x34 Raw-Data=0x8134 20 bits LSB first
+Send with: IrSender.sendSony(0x102, 0x34, 2, 20);
+
+Protocol=Samsung Address=0x102 Command=0x34 Raw-Data=0xCB340102 32 bits LSB first
+Send with: IrSender.sendSamsung(0x102, 0x34, );
+
+Protocol=Samsung Address=0x102 Command=0x5634 Raw-Data=0x56340102 32 bits LSB first
+Send with: IrSender.sendSamsung(0x102, 0x5634, );
+
+Protocol=Samsung48 Address=0x102 Command=0x5634 Raw-Data=0xA956 48 bits LSB first
+Send with: IrSender.sendSamsung48(0x102, 0x5634, );
+
+Protocol=RC5 Address=0x2 Command=0x34 Raw-Data=0x10B4 13 bits MSB first
+Send with: IrSender.sendRC5(0x2, 0x34, );
+
+Protocol=RC5 Address=0x2 Command=0x74 Toggle=1 Raw-Data=0x8B4 13 bits MSB first
+Send with: IrSender.sendRC5(0x2, 0x74, );
+
+Protocol=RC6 Address=0x2 Command=0x34 Raw-Data=0x234 20 bits MSB first
+Send with: IrSender.sendRC6(0x2, 0x34, );
+
+Protocol=Samsung Address=0x102 Command=0x34 Raw-Data=0xCB340102 32 bits LSB first
+Send with: IrSender.sendSamsung(0x102, 0x34, );
+
+Protocol=JVC Address=0x2 Command=0x34 Raw-Data=0x3402 16 bits LSB first
+Send with: IrSender.sendJVC(0x2, 0x34, );
+
+Protocol=Samsung Address=0x102 Command=0x5634 Raw-Data=0x56340102 32 bits LSB first
+Send with: IrSender.sendSamsung(0x102, 0x5634, );
+
+Protocol=LG Address=0x2 Command=0x5634 Raw-Data=0x256342 28 bits MSB first
+Send with: IrSender.sendLG(0x2, 0x5634, );
+
+Protocol=MagiQuest Address=0x102 Command=0x34 Raw-Data=0x6BCD0102 56 bits MSB first
+Send with: IrSender.sendMagiQuest(0x6BCD0102, 0x34, );
+
+Protocol=BoseWave Address=0x0 Command=0x34 Raw-Data=0xCB34 16 bits LSB first
+Send with: IrSender.sendBoseWave(0x0, 0x34, );
+
+Protocol=FAST Address=0x0 Command=0x34 Raw-Data=0xCB34 16 bits LSB first
+Send with: IrSender.sendFAST(0x0, 0x34, );
+
+Protocol=Lego Address=0x2 Command=0x14 Raw-Data=0x2148 16 bits MSB first
+Send with: IrSender.sendLego(0x2, 0x14, );
+
+Protocol=Lego Address=0x2 Command=0x14 Auto-Repeat gap=180450us Raw-Data=0x2148 16 bits MSB first
+
+Protocol=Lego Address=0x2 Command=0x14 Auto-Repeat gap=179350us Raw-Data=0x2148 16 bits MSB first
+
+Protocol=Lego Address=0x2 Command=0x14 Auto-Repeat gap=179200us Raw-Data=0x2148 16 bits MSB first
+
+Protocol=Lego Address=0x2 Command=0x14 Auto-Repeat gap=179150us Raw-Data=0x2148 16 bits MSB first
+
+Overflow detected
+Try to increase the "RAW_BUFFER_LENGTH" value of 600 in ../src/ReceiveDemo.cpp
+
+Protocol=NEC Address=0x3 Command=0x45 Raw-Data=0xBA45FC03 32 bits LSB first
+Send with: IrSender.sendNEC(0x3, 0x45, );
+
+Protocol=NEC Address=0x3 Command=0x45 Repeat gap=43250us
+
+Protocol=NEC Address=0x203 Command=0x45 Raw-Data=0xBA450203 32 bits LSB first
+Send with: IrSender.sendNEC(0x203, 0x45, );
+
+Protocol=NEC Address=0x203 Command=0x45 Repeat gap=47550us
+
+Protocol=NEC Address=0x203 Command=0x45 Raw-Data=0xBA450203 32 bits LSB first
+Send with: IrSender.sendNEC(0x203, 0x45, );
+
+Protocol=NEC2 Address=0x203 Command=0x45 Repeat gap=46500us Raw-Data=0xBA450203 32 bits LSB first
+
+Protocol=Onkyo Address=0x203 Command=0x6745 Raw-Data=0x67450203 32 bits LSB first
+Send with: IrSender.sendOnkyo(0x203, 0x6745, );
+
+Protocol=Onkyo Address=0x203 Command=0x6745 Repeat gap=46550us
+
+Protocol=Apple Address=0x3 Command=0x45 Raw-Data=0x34587EE 32 bits LSB first
+Send with: IrSender.sendApple(0x3, 0x45, );
+
+Protocol=Apple Address=0x3 Command=0x45 Repeat gap=31550us
+
+Protocol=Panasonic Address=0x203 Command=0x45 Raw-Data=0x55452030 48 bits LSB first
+Send with: IrSender.sendPanasonic(0x203, 0x45, );
+
+Protocol=Panasonic Address=0x203 Command=0x45 Repeat gap=72550us Raw-Data=0x55452030 48 bits LSB first
+
+Protocol=Kaseikyo Address=0x203 Command=0x45 Extra=0x4711 Raw-Data=0x56452033 48 bits LSB first
+Send with: IrSender.sendKaseikyo(0x203, 0x45, , 0x4711);
+
+Protocol=Kaseikyo Address=0x203 Command=0x45 Extra=0x4711 Repeat gap=66750us Raw-Data=0x56452033 48 bits LSB first
+
+Protocol=Kaseikyo_Denon Address=0x203 Command=0x45 Raw-Data=0x55452030 48 bits LSB first
+Send with: IrSender.sendKaseikyo_Denon(0x203, 0x45, );
+
+Protocol=Kaseikyo_Denon Address=0x203 Command=0x45 Repeat gap=68300us Raw-Data=0x55452030 48 bits LSB first
\ No newline at end of file
diff --git a/libraries/IRremote/examples/ReceiveDemo/PinDefinitionsAndMore.h b/libraries/IRremote/examples/ReceiveDemo/PinDefinitionsAndMore.h
new file mode 100644
index 0000000..14573c7
--- /dev/null
+++ b/libraries/IRremote/examples/ReceiveDemo/PinDefinitionsAndMore.h
@@ -0,0 +1,349 @@
+/*
+ * PinDefinitionsAndMore.h
+ *
+ * Contains pin definitions for IRremote examples for various platforms
+ * as well as definitions for feedback LED and tone() and includes
+ *
+ * Copyright (C) 2021-2023 Armin Joachimsmeyer
+ * armin.joachimsmeyer@gmail.com
+ *
+ * This file is part of IRremote https://github.com/Arduino-IRremote/Arduino-IRremote.
+ *
+ * Arduino-IRremote is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
+ * See the GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see .
+ *
+ */
+
+/*
+ * Pin mapping table for different platforms
+ *
+ * Platform IR input IR output Tone Core/Pin schema
+ * --------------------------------------------------------------
+ * DEFAULT/AVR 2 3 4 Arduino
+ * ATtinyX5 0|PB0 4|PB4 3|PB3 ATTinyCore
+ * ATtiny167 3|PA3 2|PA2 7|PA7 ATTinyCore
+ * ATtiny167 9|PA3 8|PA2 5|PA7 Digispark original core
+ * ATtiny84 |PB2 |PA4 |PA3 ATTinyCore
+ * ATtiny88 3|PD3 4|PD4 9|PB1 ATTinyCore
+ * ATtiny3217 18|PA1 19|PA2 20|PA3 MegaTinyCore
+ * ATtiny1604 2 3|PA5 %
+ * ATtiny816 14|PA1 16|PA3 1|PA5 MegaTinyCore
+ * ATtiny1614 8|PA1 10|PA3 1|PA5 MegaTinyCore
+ * SAMD21 3 4 5
+ * ESP8266 14|D5 12|D6 %
+ * ESP32 15 4 27
+ * ESP32-C3 2 3 4
+ * BluePill PA6 PA7 PA3
+ * APOLLO3 11 12 5
+ * RP2040 3|GPIO15 4|GPIO16 5|GPIO17
+ */
+//#define _IR_MEASURE_TIMING // For debugging purposes.
+
+#if defined(__AVR__)
+#if defined(__AVR_ATtiny25__) || defined(__AVR_ATtiny45__) || defined(__AVR_ATtiny85__) // Digispark board. For use with ATTinyCore.
+#include "ATtinySerialOut.hpp" // TX is at pin 2 - Available as Arduino library "ATtinySerialOut". Saves 700 bytes program memory and 70 bytes RAM for ATtinyCore.
+#define IR_RECEIVE_PIN PIN_PB0
+#define IR_SEND_PIN PIN_PB4 // Pin 2 is serial output with ATtinySerialOut. Pin 1 is internal LED and Pin3 is USB+ with pullup on Digispark board.
+#define TONE_PIN PIN_PB3
+#define _IR_TIMING_TEST_PIN PIN_PB3
+
+# elif defined(__AVR_ATtiny87__) || defined(__AVR_ATtiny167__) // Digispark pro board
+#include "ATtinySerialOut.hpp" // Available as Arduino library "ATtinySerialOut"
+// For ATtiny167 Pins PB6 and PA3 are usable as interrupt source.
+# if defined(ARDUINO_AVR_DIGISPARKPRO)
+// For use with Digispark original core
+#define IR_RECEIVE_PIN 9 // PA3 - on Digispark board labeled as pin 9
+//#define IR_RECEIVE_PIN 14 // PB6 / INT0 is connected to USB+ on DigisparkPro boards
+#define IR_SEND_PIN 8 // PA2 - on Digispark board labeled as pin 8
+#define TONE_PIN 5 // PA7 - on Digispark board labeled as pin 5
+#define _IR_TIMING_TEST_PIN 10 // PA4
+# else
+// For use with ATTinyCore
+#define IR_RECEIVE_PIN PIN_PA3 // On Digispark board labeled as pin 9 - INT0 is connected to USB+ on DigisparkPro boards
+#define IR_SEND_PIN PIN_PA2 // On Digispark board labeled as pin 8
+#define TONE_PIN PIN_PA7 // On Digispark board labeled as pin 5
+# endif
+
+# elif defined(__AVR_ATtiny84__) // For use with ATTinyCore
+#include "ATtinySerialOut.hpp" // Available as Arduino library "ATtinySerialOut". Saves 128 bytes program memory.
+#define IR_RECEIVE_PIN PIN_PB2 // INT0
+#define IR_SEND_PIN PIN_PA4
+#define TONE_PIN PIN_PA3
+#define _IR_TIMING_TEST_PIN PIN_PA5
+
+# elif defined(__AVR_ATtiny88__) // MH-ET Tiny88 board. For use with ATTinyCore.
+#include "ATtinySerialOut.hpp" // Available as Arduino library "ATtinySerialOut". Saves 128 bytes program memory.
+// Pin 6 is TX, pin 7 is RX
+#define IR_RECEIVE_PIN PIN_PD3 // 3 - INT1
+#define IR_SEND_PIN PIN_PD4 // 4
+#define TONE_PIN PIN_PB1 // 9
+#define _IR_TIMING_TEST_PIN PIN_PB0 // 8
+
+# elif defined(__AVR_ATtiny1616__) || defined(__AVR_ATtiny3216__) || defined(__AVR_ATtiny3217__) // For use with megaTinyCore
+// Tiny Core Dev board
+// https://www.tindie.com/products/xkimi/tiny-core-16-dev-board-attiny1616/ - Out of Stock
+// https://www.tindie.com/products/xkimi/tiny-core-32-dev-board-attiny3217/ - Out of Stock
+#define IR_RECEIVE_PIN PIN_PA1 // use 18 instead of PIN_PA1 for TinyCore32
+#define IR_SEND_PIN PIN_PA2 // 19
+#define TONE_PIN PIN_PA3 // 20
+#define APPLICATION_PIN PIN_PA0 // 0
+#undef LED_BUILTIN // No LED available on the TinyCore 32 board, take the one on the programming board which is connected to the DAC output
+#define LED_BUILTIN PIN_PA6 // use 2 instead of PIN_PA6 for TinyCore32
+
+# elif defined(__AVR_ATtiny816__) // For use with megaTinyCore
+#define IR_RECEIVE_PIN PIN_PA1 // 14
+#define IR_SEND_PIN PIN_PA1 // 16
+#define TONE_PIN PIN_PA5 // 1
+#define APPLICATION_PIN PIN_PA4 // 0
+#undef LED_BUILTIN // No LED available, take the one which is connected to the DAC output
+#define LED_BUILTIN PIN_PB5 // 4
+
+# elif defined(__AVR_ATtiny1614__) // For use with megaTinyCore
+#define IR_RECEIVE_PIN PIN_PA1 // 8
+#define IR_SEND_PIN PIN_PA3 // 10
+#define TONE_PIN PIN_PA5 // 1
+#define APPLICATION_PIN PIN_PA4 // 0
+
+# elif defined(__AVR_ATtiny1604__) // For use with megaTinyCore
+#define IR_RECEIVE_PIN PIN_PA6 // 2 - To be compatible with interrupt example, pin 2 is chosen here.
+#define IR_SEND_PIN PIN_PA7 // 3
+#define APPLICATION_PIN PIN_PB2 // 5
+
+#define tone(...) void() // Define as void, since TCB0_INT_vect is also used by tone()
+#define noTone(a) void()
+#define TONE_PIN 42 // Dummy for examples using it
+
+# elif defined(__AVR_ATmega1284__) || defined(__AVR_ATmega1284P__) \
+|| defined(__AVR_ATmega644__) || defined(__AVR_ATmega644P__) \
+|| defined(__AVR_ATmega324P__) || defined(__AVR_ATmega324A__) \
+|| defined(__AVR_ATmega324PA__) || defined(__AVR_ATmega164A__) \
+|| defined(__AVR_ATmega164P__) || defined(__AVR_ATmega32__) \
+|| defined(__AVR_ATmega16__) || defined(__AVR_ATmega8535__) \
+|| defined(__AVR_ATmega64__) || defined(__AVR_ATmega128__) \
+|| defined(__AVR_ATmega1281__) || defined(__AVR_ATmega2561__) \
+|| defined(__AVR_ATmega8515__) || defined(__AVR_ATmega162__)
+#define IR_RECEIVE_PIN 2
+#define IR_SEND_PIN 13
+#define TONE_PIN 4
+#define APPLICATION_PIN 5
+#define ALTERNATIVE_IR_FEEDBACK_LED_PIN 6 // E.g. used for examples which use LED_BUILDIN for example output.
+#define _IR_TIMING_TEST_PIN 7
+
+# else // Default as for ATmega328 like on Uno, Nano, Leonardo, Teensy 2.0 etc.
+#define IR_RECEIVE_PIN 2 // To be compatible with interrupt example, pin 2 is chosen here.
+#define IR_SEND_PIN 3
+#define TONE_PIN 4
+#define APPLICATION_PIN 5
+#define ALTERNATIVE_IR_FEEDBACK_LED_PIN 6 // E.g. used for examples which use LED_BUILDIN for example output.
+#define _IR_TIMING_TEST_PIN 7
+
+# if defined(ARDUINO_AVR_PROMICRO) // Sparkfun Pro Micro is __AVR_ATmega32U4__ but has different external circuit
+// We have no built in LED at pin 13 -> reuse RX LED
+#undef LED_BUILTIN
+#define LED_BUILTIN LED_BUILTIN_RX
+# endif
+# endif // defined(__AVR_ATtiny25__)...
+
+#elif defined(ARDUINO_ARCH_RENESAS_UNO) // Uno R4
+// To be compatible with Uno R3.
+#define IR_RECEIVE_PIN 2
+#define IR_SEND_PIN 3
+#define TONE_PIN 4
+#define APPLICATION_PIN 5
+#define ALTERNATIVE_IR_FEEDBACK_LED_PIN 6 // E.g. used for examples which use LED_BUILDIN for example output.
+#define _IR_TIMING_TEST_PIN 7
+
+#elif defined(ESP8266)
+#define FEEDBACK_LED_IS_ACTIVE_LOW // The LED on my board (D4) is active LOW
+#define IR_RECEIVE_PIN 14 // D5
+#define IR_SEND_PIN 12 // D6 - D4/pin 2 is internal LED
+#define _IR_TIMING_TEST_PIN 2 // D4
+#define APPLICATION_PIN 13 // D7
+
+#define tone(...) void() // tone() inhibits receive timer
+#define noTone(a) void()
+#define TONE_PIN 42 // Dummy for examples using it#
+
+#elif defined(ARDUINO_NOLOGO_ESP32C3_SUPER_MINI)
+#define FEEDBACK_LED_IS_ACTIVE_LOW // The LED on my board (D8) is active LOW
+#define IR_RECEIVE_PIN 2
+#define IR_SEND_PIN 3
+#define TONE_PIN 4
+#define APPLICATION_PIN 10
+
+#elif defined(CONFIG_IDF_TARGET_ESP32C3) || defined(ARDUINO_ESP32C3_DEV)
+#define NO_LED_FEEDBACK_CODE // The WS2812 on pin 8 of AI-C3 board crashes if used as receive feedback LED, other I/O pins are working...
+#define IR_RECEIVE_PIN 6
+#define IR_SEND_PIN 7
+#define TONE_PIN 10
+#define APPLICATION_PIN 18
+
+#elif defined(ESP32)
+#include
+
+// tone() is included in ESP32 core since 2.0.2
+#if !defined(ESP_ARDUINO_VERSION_VAL)
+#define ESP_ARDUINO_VERSION_VAL(major, minor, patch) 12345678
+#endif
+#if ESP_ARDUINO_VERSION <= ESP_ARDUINO_VERSION_VAL(2, 0, 2)
+#define TONE_LEDC_CHANNEL 1 // Using channel 1 makes tone() independent of receiving timer -> No need to stop receiving timer.
+void tone(uint8_t aPinNumber, unsigned int aFrequency){
+ ledcAttachPin(aPinNumber, TONE_LEDC_CHANNEL);
+ ledcWriteTone(TONE_LEDC_CHANNEL, aFrequency);
+}
+void tone(uint8_t aPinNumber, unsigned int aFrequency, unsigned long aDuration){
+ ledcAttachPin(aPinNumber, TONE_LEDC_CHANNEL);
+ ledcWriteTone(TONE_LEDC_CHANNEL, aFrequency);
+ delay(aDuration);
+ ledcWriteTone(TONE_LEDC_CHANNEL, 0);
+}
+void noTone(uint8_t aPinNumber){
+ ledcWriteTone(TONE_LEDC_CHANNEL, 0);
+}
+#endif // ESP_ARDUINO_VERSION <= ESP_ARDUINO_VERSION_VAL(2, 0, 2)
+
+#define IR_RECEIVE_PIN 15 // D15
+#define IR_SEND_PIN 4 // D4
+#define TONE_PIN 27 // D27 25 & 26 are DAC0 and 1
+#define APPLICATION_PIN 16 // RX2 pin
+
+#elif defined(ARDUINO_ARCH_STM32) || defined(ARDUINO_ARCH_STM32F1) // BluePill
+// Timer 3 blocks PA6, PA7, PB0, PB1 for use by Servo or tone()
+#define IR_RECEIVE_PIN PA6
+#define IR_RECEIVE_PIN_STRING "PA6"
+#define IR_SEND_PIN PA7
+#define IR_SEND_PIN_STRING "PA7"
+#define TONE_PIN PA3
+#define _IR_TIMING_TEST_PIN PA5
+#define APPLICATION_PIN PA2
+#define APPLICATION_PIN_STRING "PA2"
+# if defined(ARDUINO_GENERIC_STM32F103C) || defined(ARDUINO_BLUEPILL_F103C8)
+// BluePill LED is active low
+#define FEEDBACK_LED_IS_ACTIVE_LOW
+# endif
+
+#elif defined(ARDUINO_ARCH_APOLLO3) // Sparkfun Apollo boards
+#define IR_RECEIVE_PIN 11
+#define IR_SEND_PIN 12
+#define TONE_PIN 5
+
+#elif defined(ARDUINO_ARCH_MBED) && defined(ARDUINO_ARCH_MBED_NANO) // Arduino Nano 33 BLE and Arduino Nano Connect layout for MBED
+// Must be before ARDUINO_ARCH_RP2040, since it is the layout for the MBED core of Arduino Nano Connect
+#define IR_RECEIVE_PIN 3 // GPIO15 Start with pin 3 since pin 2|GPIO25 is connected to LED on Pi pico
+#define IR_SEND_PIN 4 // GPIO16
+#define TONE_PIN 5
+#define APPLICATION_PIN 6
+#define ALTERNATIVE_IR_FEEDBACK_LED_PIN 7 // E.g. used for examples which use LED_BUILDIN for example output.
+#define _IR_TIMING_TEST_PIN 8
+
+#elif defined(ARDUINO_ARCH_RP2040) // Arduino Nano Connect, Pi Pico with arduino-pico core https://github.com/earlephilhower/arduino-pico
+#define IR_RECEIVE_PIN 15 // GPIO15 to be compatible with the Arduino Nano RP2040 Connect (pin3)
+#define IR_SEND_PIN 16 // GPIO16
+#define TONE_PIN 17
+#define APPLICATION_PIN 18
+#define ALTERNATIVE_IR_FEEDBACK_LED_PIN 19 // E.g. used for examples which use LED_BUILDIN for example output.
+#define _IR_TIMING_TEST_PIN 20
+
+// If you program the Nano RP2040 Connect with this core, then you must redefine LED_BUILTIN
+// and use the external reset with 1 kOhm to ground to enter UF2 mode
+#undef LED_BUILTIN
+#define LED_BUILTIN 6
+
+#elif defined(PARTICLE) // !!!UNTESTED!!!
+#define IR_RECEIVE_PIN A4
+#define IR_SEND_PIN A5 // Particle supports multiple pins
+
+#define LED_BUILTIN D7
+
+/*
+ * 4 times the same (default) layout for easy adaption in the future
+ */
+#elif defined(TEENSYDUINO) // Teensy 2.0 is handled at default for ATmega328 like on Uno, Nano, Leonardo etc.
+#define IR_RECEIVE_PIN 2
+#define IR_SEND_PIN 3
+#define TONE_PIN 4
+#define APPLICATION_PIN 5
+#define ALTERNATIVE_IR_FEEDBACK_LED_PIN 6 // E.g. used for examples which use LED_BUILDIN for example output.
+#define _IR_TIMING_TEST_PIN 7
+
+#elif defined(ARDUINO_ARCH_MBED) // Arduino Nano 33 BLE
+#define IR_RECEIVE_PIN 2
+#define IR_SEND_PIN 3
+#define TONE_PIN 4
+#define APPLICATION_PIN 5
+#define ALTERNATIVE_IR_FEEDBACK_LED_PIN 6 // E.g. used for examples which use LED_BUILDIN for example output.
+#define _IR_TIMING_TEST_PIN 7
+
+#elif defined(ARDUINO_ARCH_SAMD) || defined(ARDUINO_ARCH_SAM)
+#define IR_RECEIVE_PIN 2
+#define IR_SEND_PIN 3
+#define TONE_PIN 4
+#define APPLICATION_PIN 5
+#define ALTERNATIVE_IR_FEEDBACK_LED_PIN 6 // E.g. used for examples which use LED_BUILDIN for example output.
+#define _IR_TIMING_TEST_PIN 7
+
+#if !defined(ARDUINO_SAMD_ADAFRUIT) && !defined(ARDUINO_SEEED_XIAO_M0)
+// On the Zero and others we switch explicitly to SerialUSB
+#define Serial SerialUSB
+#endif
+
+// Definitions for the Chinese SAMD21 M0-Mini clone, which has no led connected to D13/PA17.
+// Attention!!! D2 and D4 are swapped on these boards!!!
+// If you connect the LED, it is on pin 24/PB11. In this case activate the next two lines.
+//#undef LED_BUILTIN
+//#define LED_BUILTIN 24 // PB11
+// As an alternative you can choose pin 25, it is the RX-LED pin (PB03), but active low.In this case activate the next 3 lines.
+//#undef LED_BUILTIN
+//#define LED_BUILTIN 25 // PB03
+//#define FEEDBACK_LED_IS_ACTIVE_LOW // The RX LED on the M0-Mini is active LOW
+
+#elif defined (NRF51) // BBC micro:bit
+#define IR_RECEIVE_PIN 2
+#define IR_SEND_PIN 3
+#define APPLICATION_PIN 1
+#define _IR_TIMING_TEST_PIN 4
+
+#define tone(...) void() // no tone() available
+#define noTone(a) void()
+#define TONE_PIN 42 // Dummy for examples using it
+
+#else
+#warning Board / CPU is not detected using pre-processor symbols -> using default values, which may not fit. Please extend PinDefinitionsAndMore.h.
+// Default valued for unidentified boards
+#define IR_RECEIVE_PIN 2
+#define IR_SEND_PIN 3
+#define TONE_PIN 4
+#define APPLICATION_PIN 5
+#define ALTERNATIVE_IR_FEEDBACK_LED_PIN 6 // E.g. used for examples which use LED_BUILDIN for example output.
+#define _IR_TIMING_TEST_PIN 7
+#endif // defined(ESP8266)
+
+#if defined(ESP32) || defined(ARDUINO_ARCH_RP2040) || defined(PARTICLE) || defined(ARDUINO_ARCH_MBED)
+#define SEND_PWM_BY_TIMER // We do not have pin restrictions for this CPU's, so lets use the hardware PWM for send carrier signal generation
+#else
+# if defined(SEND_PWM_BY_TIMER)
+#undef IR_SEND_PIN // SendPin is determined by timer! This avoids warnings in IRremote.hpp and IRTimer.hpp
+# endif
+#endif
+
+#if !defined (FLASHEND)
+#define FLASHEND 0xFFFF // Dummy value for platforms where FLASHEND is not defined
+#endif
+
+/*
+ * Helper macro for getting a macro definition as string
+ */
+#if !defined(STR_HELPER)
+#define STR_HELPER(x) #x
+#define STR(x) STR_HELPER(x)
+#endif
diff --git a/libraries/IRremote/examples/ReceiveDemo/ReceiveDemo.ino b/libraries/IRremote/examples/ReceiveDemo/ReceiveDemo.ino
new file mode 100644
index 0000000..ea8e6a6
--- /dev/null
+++ b/libraries/IRremote/examples/ReceiveDemo/ReceiveDemo.ino
@@ -0,0 +1,230 @@
+/*
+ * ReceiveDemo.cpp
+ *
+ * Demonstrates receiving IR codes with the IRremote library and the use of the Arduino tone() function with this library.
+ * Long press of one IR button (receiving of multiple repeats for one command) is detected.
+ * If debug button is pressed (pin connected to ground) a long output is generated, which may disturb detecting of repeats.
+ *
+ * This file is part of Arduino-IRremote https://github.com/Arduino-IRremote/Arduino-IRremote.
+ *
+ ************************************************************************************
+ * MIT License
+ *
+ * Copyright (c) 2020-2024 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.
+ *
+ ************************************************************************************
+ */
+
+#include
+
+/*
+ * Specify which protocol(s) should be used for decoding.
+ * If no protocol is defined, all protocols (except Bang&Olufsen) are active.
+ * This must be done before the #include
+ */
+//#define DECODE_DENON // Includes Sharp
+//#define DECODE_JVC
+//#define DECODE_KASEIKYO
+//#define DECODE_PANASONIC // alias for DECODE_KASEIKYO
+//#define DECODE_LG
+//#define DECODE_ONKYO // Decodes only Onkyo and not NEC or Apple
+//#define DECODE_NEC // Includes Apple and Onkyo
+//#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 // Universal decoder for pulse distance width protocols
+//#define DECODE_HASH // special decoder for all protocols
+//#define DECODE_BEO // This protocol must always be enabled manually, i.e. it is NOT enabled if no protocol is defined. It prevents decoding of SONY!
+// etc. see IRremote.hpp
+//
+
+
+//#define NO_LED_FEEDBACK_CODE // saves 92 bytes program memory
+//#define EXCLUDE_UNIVERSAL_PROTOCOLS // Saves up to 1000 bytes program memory.
+//#define EXCLUDE_EXOTIC_PROTOCOLS // saves around 650 bytes program memory if all other protocols are active
+//#define IR_REMOTE_DISABLE_RECEIVE_COMPLETE_CALLBACK // saves 32 bytes program memory
+
+// 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. See also IRremote.hpp line 142.
+//#define MARK_EXCESS_MICROS 20 // Adapt it to your IR receiver module. 40 is taken for the cheap VS1838 module her, since we have high intensity.
+
+#if defined(DECODE_BEO)
+#define RECORD_GAP_MICROS 16000 // always get the complete frame in the receive buffer, but this prevents decoding of SONY!
+#endif
+//#define RECORD_GAP_MICROS 12000 // Default is 8000. Activate it for some LG air conditioner protocols
+
+//#define DEBUG // Activate this for lots of lovely debug output from the decoders.
+
+#include
+
+#define STR_HELPER(x) #x
+#define STR(x) STR_HELPER(x)
+
+#define IR_RECEIVE_PIN 4 // P0_1
+
+
+void handleOverflow();
+bool detectLongPress(uint16_t aLongPressDurationMillis);
+
+void setup() {
+ Serial.begin(9600);
+ while (!Serial)
+ ; // Wait for Serial to become available. Is optimized away for some cores.
+
+ // Just to know which program is running on my Arduino
+ Serial.println(F("START " __FILE__ " from " __DATE__ "\r\nUsing library version " VERSION_IRREMOTE));
+
+ // In case the interrupt driver crashes on setup, give a clue
+ // to the user what's going on.
+ Serial.println(F("Enabling IRin..."));
+
+ // Start the receiver and if not 3. parameter specified, take LED_BUILTIN pin from the internal boards definition as default feedback LED
+ IrReceiver.begin(IR_RECEIVE_PIN, ENABLE_LED_FEEDBACK);
+
+ Serial.print(F("Ready to receive IR signals of protocols: "));
+ printActiveIRProtocols(&Serial);
+ Serial.println(F("at pin " STR(IR_RECEIVE_PIN)));
+
+ Serial.print(F("FeedbackLED at pin "));
+ Serial.println(LED_BUILTIN); // Works also for ESP32: static const uint8_t LED_BUILTIN = 8; #define LED_BUILTIN LED_BUILTIN
+
+ // infos for receive
+ Serial.print(RECORD_GAP_MICROS);
+ Serial.println(F(" us is the (minimum) gap, after which the start of a new IR packet is assumed"));
+ Serial.print(MARK_EXCESS_MICROS);
+ Serial.println(F(" us are subtracted from all marks and added to all spaces for decoding"));
+}
+
+void loop() {
+ /*
+ * Check if received data is available and if yes, try to decode it.
+ * Decoded result is in the IrReceiver.decodedIRData structure.
+ *
+ * E.g. command is in IrReceiver.decodedIRData.command
+ * address is in command is in IrReceiver.decodedIRData.address
+ * and up to 32 bit raw data in IrReceiver.decodedIRData.decodedRawData
+ */
+ if (IrReceiver.decode()) {
+ Serial.println();
+
+ if (IrReceiver.decodedIRData.flags & IRDATA_FLAGS_WAS_OVERFLOW) {
+ handleOverflow();
+ } else {
+ /*
+ * No overflow here.
+ * Stop receiver, print short info and send usage and start receiver again
+ */
+
+ if (IrReceiver.decodedIRData.protocol == UNKNOWN)
+ {
+ // We have debug enabled or an unknown protocol, print extended info
+ if (IrReceiver.decodedIRData.protocol == UNKNOWN) {
+ Serial.println(F("Received noise or an unknown (or not yet enabled) protocol"));
+ }
+ IrReceiver.printIRResultRawFormatted(&Serial, true);
+ }
+ if (IrReceiver.decodedIRData.protocol != UNKNOWN)
+ {
+ /*
+ * The info output for a successful receive
+ */
+ IrReceiver.printIRResultShort(&Serial);
+ IrReceiver.printIRSendUsage(&Serial);
+ }
+ }
+
+ /*
+ * !!!Important!!! Enable receiving of the next value, because receiving
+ * has stopped after the end of the current received data packet.
+ * Do it here, to preserve raw data for printing with printIRResultRawFormatted()
+ */
+ IrReceiver.resume();
+
+ /*
+ * Finally check the received data and perform actions according to the received address and commands
+ */
+ if (IrReceiver.decodedIRData.address == 0) {
+ if (IrReceiver.decodedIRData.command == 0x10) {
+ // do something
+ } else if (IrReceiver.decodedIRData.command == 0x11) {
+ // do something else
+ }
+ }
+
+ // Check if repeats of the IR command was sent for more than 1000 ms
+ if (detectLongPress(1000)) {
+ Serial.print(F("Command 0x"));
+ Serial.print(IrReceiver.decodedIRData.command, HEX);
+ Serial.println(F(" was repeated for more than 2 seconds"));
+ }
+ } // if (IrReceiver.decode())
+
+ /*
+ * Your code here
+ * For all users of the FastLed library, use this code for strip.show() to improve receiving performance (which is still not 100%):
+ * if (IrReceiver.isIdle()) {
+ * strip.show();
+ * }
+ */
+
+}
+
+void handleOverflow() {
+ Serial.println(F("Overflow detected"));
+ Serial.println(F("Try to increase the \"RAW_BUFFER_LENGTH\" value of " STR(RAW_BUFFER_LENGTH) " in " __FILE__));
+ // see also https://github.com/Arduino-IRremote/Arduino-IRremote#compile-options--macros-for-this-library
+
+ IrReceiver.stopTimer();
+ // tone(TONE_PIN, 1100, 10);
+ // delay(50);
+ // tone(TONE_PIN, 1100, 10);
+ delay(50);
+ IrReceiver.restartTimer();
+}
+
+unsigned long sMillisOfFirstReceive;
+bool sLongPressJustDetected;
+/**
+ * True once we received the consecutive repeats for more than aLongPressDurationMillis milliseconds.
+ * The first frame, which is no repeat, is NOT counted for the duration!
+ * @return true once after the repeated IR command was received for longer than aLongPressDurationMillis milliseconds, false otherwise.
+ */
+bool detectLongPress(uint16_t aLongPressDurationMillis) {
+ if (!sLongPressJustDetected && (IrReceiver.decodedIRData.flags & IRDATA_FLAGS_IS_REPEAT)) {
+ /*
+ * Here the repeat flag is set (which implies, that command is the same as the previous one)
+ */
+ if (millis() - aLongPressDurationMillis > sMillisOfFirstReceive) {
+ sLongPressJustDetected = true; // Long press here
+ }
+ } else {
+ // No repeat here
+ sMillisOfFirstReceive = millis();
+ sLongPressJustDetected = false;
+ }
+ return sLongPressJustDetected; // No long press here
+}
+
diff --git a/libraries/IRremote/examples/ReceiveDump/PinDefinitionsAndMore.h b/libraries/IRremote/examples/ReceiveDump/PinDefinitionsAndMore.h
new file mode 100644
index 0000000..14573c7
--- /dev/null
+++ b/libraries/IRremote/examples/ReceiveDump/PinDefinitionsAndMore.h
@@ -0,0 +1,349 @@
+/*
+ * PinDefinitionsAndMore.h
+ *
+ * Contains pin definitions for IRremote examples for various platforms
+ * as well as definitions for feedback LED and tone() and includes
+ *
+ * Copyright (C) 2021-2023 Armin Joachimsmeyer
+ * armin.joachimsmeyer@gmail.com
+ *
+ * This file is part of IRremote https://github.com/Arduino-IRremote/Arduino-IRremote.
+ *
+ * Arduino-IRremote is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
+ * See the GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see .
+ *
+ */
+
+/*
+ * Pin mapping table for different platforms
+ *
+ * Platform IR input IR output Tone Core/Pin schema
+ * --------------------------------------------------------------
+ * DEFAULT/AVR 2 3 4 Arduino
+ * ATtinyX5 0|PB0 4|PB4 3|PB3 ATTinyCore
+ * ATtiny167 3|PA3 2|PA2 7|PA7 ATTinyCore
+ * ATtiny167 9|PA3 8|PA2 5|PA7 Digispark original core
+ * ATtiny84 |PB2 |PA4 |PA3 ATTinyCore
+ * ATtiny88 3|PD3 4|PD4 9|PB1 ATTinyCore
+ * ATtiny3217 18|PA1 19|PA2 20|PA3 MegaTinyCore
+ * ATtiny1604 2 3|PA5 %
+ * ATtiny816 14|PA1 16|PA3 1|PA5 MegaTinyCore
+ * ATtiny1614 8|PA1 10|PA3 1|PA5 MegaTinyCore
+ * SAMD21 3 4 5
+ * ESP8266 14|D5 12|D6 %
+ * ESP32 15 4 27
+ * ESP32-C3 2 3 4
+ * BluePill PA6 PA7 PA3
+ * APOLLO3 11 12 5
+ * RP2040 3|GPIO15 4|GPIO16 5|GPIO17
+ */
+//#define _IR_MEASURE_TIMING // For debugging purposes.
+
+#if defined(__AVR__)
+#if defined(__AVR_ATtiny25__) || defined(__AVR_ATtiny45__) || defined(__AVR_ATtiny85__) // Digispark board. For use with ATTinyCore.
+#include "ATtinySerialOut.hpp" // TX is at pin 2 - Available as Arduino library "ATtinySerialOut". Saves 700 bytes program memory and 70 bytes RAM for ATtinyCore.
+#define IR_RECEIVE_PIN PIN_PB0
+#define IR_SEND_PIN PIN_PB4 // Pin 2 is serial output with ATtinySerialOut. Pin 1 is internal LED and Pin3 is USB+ with pullup on Digispark board.
+#define TONE_PIN PIN_PB3
+#define _IR_TIMING_TEST_PIN PIN_PB3
+
+# elif defined(__AVR_ATtiny87__) || defined(__AVR_ATtiny167__) // Digispark pro board
+#include "ATtinySerialOut.hpp" // Available as Arduino library "ATtinySerialOut"
+// For ATtiny167 Pins PB6 and PA3 are usable as interrupt source.
+# if defined(ARDUINO_AVR_DIGISPARKPRO)
+// For use with Digispark original core
+#define IR_RECEIVE_PIN 9 // PA3 - on Digispark board labeled as pin 9
+//#define IR_RECEIVE_PIN 14 // PB6 / INT0 is connected to USB+ on DigisparkPro boards
+#define IR_SEND_PIN 8 // PA2 - on Digispark board labeled as pin 8
+#define TONE_PIN 5 // PA7 - on Digispark board labeled as pin 5
+#define _IR_TIMING_TEST_PIN 10 // PA4
+# else
+// For use with ATTinyCore
+#define IR_RECEIVE_PIN PIN_PA3 // On Digispark board labeled as pin 9 - INT0 is connected to USB+ on DigisparkPro boards
+#define IR_SEND_PIN PIN_PA2 // On Digispark board labeled as pin 8
+#define TONE_PIN PIN_PA7 // On Digispark board labeled as pin 5
+# endif
+
+# elif defined(__AVR_ATtiny84__) // For use with ATTinyCore
+#include "ATtinySerialOut.hpp" // Available as Arduino library "ATtinySerialOut". Saves 128 bytes program memory.
+#define IR_RECEIVE_PIN PIN_PB2 // INT0
+#define IR_SEND_PIN PIN_PA4
+#define TONE_PIN PIN_PA3
+#define _IR_TIMING_TEST_PIN PIN_PA5
+
+# elif defined(__AVR_ATtiny88__) // MH-ET Tiny88 board. For use with ATTinyCore.
+#include "ATtinySerialOut.hpp" // Available as Arduino library "ATtinySerialOut". Saves 128 bytes program memory.
+// Pin 6 is TX, pin 7 is RX
+#define IR_RECEIVE_PIN PIN_PD3 // 3 - INT1
+#define IR_SEND_PIN PIN_PD4 // 4
+#define TONE_PIN PIN_PB1 // 9
+#define _IR_TIMING_TEST_PIN PIN_PB0 // 8
+
+# elif defined(__AVR_ATtiny1616__) || defined(__AVR_ATtiny3216__) || defined(__AVR_ATtiny3217__) // For use with megaTinyCore
+// Tiny Core Dev board
+// https://www.tindie.com/products/xkimi/tiny-core-16-dev-board-attiny1616/ - Out of Stock
+// https://www.tindie.com/products/xkimi/tiny-core-32-dev-board-attiny3217/ - Out of Stock
+#define IR_RECEIVE_PIN PIN_PA1 // use 18 instead of PIN_PA1 for TinyCore32
+#define IR_SEND_PIN PIN_PA2 // 19
+#define TONE_PIN PIN_PA3 // 20
+#define APPLICATION_PIN PIN_PA0 // 0
+#undef LED_BUILTIN // No LED available on the TinyCore 32 board, take the one on the programming board which is connected to the DAC output
+#define LED_BUILTIN PIN_PA6 // use 2 instead of PIN_PA6 for TinyCore32
+
+# elif defined(__AVR_ATtiny816__) // For use with megaTinyCore
+#define IR_RECEIVE_PIN PIN_PA1 // 14
+#define IR_SEND_PIN PIN_PA1 // 16
+#define TONE_PIN PIN_PA5 // 1
+#define APPLICATION_PIN PIN_PA4 // 0
+#undef LED_BUILTIN // No LED available, take the one which is connected to the DAC output
+#define LED_BUILTIN PIN_PB5 // 4
+
+# elif defined(__AVR_ATtiny1614__) // For use with megaTinyCore
+#define IR_RECEIVE_PIN PIN_PA1 // 8
+#define IR_SEND_PIN PIN_PA3 // 10
+#define TONE_PIN PIN_PA5 // 1
+#define APPLICATION_PIN PIN_PA4 // 0
+
+# elif defined(__AVR_ATtiny1604__) // For use with megaTinyCore
+#define IR_RECEIVE_PIN PIN_PA6 // 2 - To be compatible with interrupt example, pin 2 is chosen here.
+#define IR_SEND_PIN PIN_PA7 // 3
+#define APPLICATION_PIN PIN_PB2 // 5
+
+#define tone(...) void() // Define as void, since TCB0_INT_vect is also used by tone()
+#define noTone(a) void()
+#define TONE_PIN 42 // Dummy for examples using it
+
+# elif defined(__AVR_ATmega1284__) || defined(__AVR_ATmega1284P__) \
+|| defined(__AVR_ATmega644__) || defined(__AVR_ATmega644P__) \
+|| defined(__AVR_ATmega324P__) || defined(__AVR_ATmega324A__) \
+|| defined(__AVR_ATmega324PA__) || defined(__AVR_ATmega164A__) \
+|| defined(__AVR_ATmega164P__) || defined(__AVR_ATmega32__) \
+|| defined(__AVR_ATmega16__) || defined(__AVR_ATmega8535__) \
+|| defined(__AVR_ATmega64__) || defined(__AVR_ATmega128__) \
+|| defined(__AVR_ATmega1281__) || defined(__AVR_ATmega2561__) \
+|| defined(__AVR_ATmega8515__) || defined(__AVR_ATmega162__)
+#define IR_RECEIVE_PIN 2
+#define IR_SEND_PIN 13
+#define TONE_PIN 4
+#define APPLICATION_PIN 5
+#define ALTERNATIVE_IR_FEEDBACK_LED_PIN 6 // E.g. used for examples which use LED_BUILDIN for example output.
+#define _IR_TIMING_TEST_PIN 7
+
+# else // Default as for ATmega328 like on Uno, Nano, Leonardo, Teensy 2.0 etc.
+#define IR_RECEIVE_PIN 2 // To be compatible with interrupt example, pin 2 is chosen here.
+#define IR_SEND_PIN 3
+#define TONE_PIN 4
+#define APPLICATION_PIN 5
+#define ALTERNATIVE_IR_FEEDBACK_LED_PIN 6 // E.g. used for examples which use LED_BUILDIN for example output.
+#define _IR_TIMING_TEST_PIN 7
+
+# if defined(ARDUINO_AVR_PROMICRO) // Sparkfun Pro Micro is __AVR_ATmega32U4__ but has different external circuit
+// We have no built in LED at pin 13 -> reuse RX LED
+#undef LED_BUILTIN
+#define LED_BUILTIN LED_BUILTIN_RX
+# endif
+# endif // defined(__AVR_ATtiny25__)...
+
+#elif defined(ARDUINO_ARCH_RENESAS_UNO) // Uno R4
+// To be compatible with Uno R3.
+#define IR_RECEIVE_PIN 2
+#define IR_SEND_PIN 3
+#define TONE_PIN 4
+#define APPLICATION_PIN 5
+#define ALTERNATIVE_IR_FEEDBACK_LED_PIN 6 // E.g. used for examples which use LED_BUILDIN for example output.
+#define _IR_TIMING_TEST_PIN 7
+
+#elif defined(ESP8266)
+#define FEEDBACK_LED_IS_ACTIVE_LOW // The LED on my board (D4) is active LOW
+#define IR_RECEIVE_PIN 14 // D5
+#define IR_SEND_PIN 12 // D6 - D4/pin 2 is internal LED
+#define _IR_TIMING_TEST_PIN 2 // D4
+#define APPLICATION_PIN 13 // D7
+
+#define tone(...) void() // tone() inhibits receive timer
+#define noTone(a) void()
+#define TONE_PIN 42 // Dummy for examples using it#
+
+#elif defined(ARDUINO_NOLOGO_ESP32C3_SUPER_MINI)
+#define FEEDBACK_LED_IS_ACTIVE_LOW // The LED on my board (D8) is active LOW
+#define IR_RECEIVE_PIN 2
+#define IR_SEND_PIN 3
+#define TONE_PIN 4
+#define APPLICATION_PIN 10
+
+#elif defined(CONFIG_IDF_TARGET_ESP32C3) || defined(ARDUINO_ESP32C3_DEV)
+#define NO_LED_FEEDBACK_CODE // The WS2812 on pin 8 of AI-C3 board crashes if used as receive feedback LED, other I/O pins are working...
+#define IR_RECEIVE_PIN 6
+#define IR_SEND_PIN 7
+#define TONE_PIN 10
+#define APPLICATION_PIN 18
+
+#elif defined(ESP32)
+#include
+
+// tone() is included in ESP32 core since 2.0.2
+#if !defined(ESP_ARDUINO_VERSION_VAL)
+#define ESP_ARDUINO_VERSION_VAL(major, minor, patch) 12345678
+#endif
+#if ESP_ARDUINO_VERSION <= ESP_ARDUINO_VERSION_VAL(2, 0, 2)
+#define TONE_LEDC_CHANNEL 1 // Using channel 1 makes tone() independent of receiving timer -> No need to stop receiving timer.
+void tone(uint8_t aPinNumber, unsigned int aFrequency){
+ ledcAttachPin(aPinNumber, TONE_LEDC_CHANNEL);
+ ledcWriteTone(TONE_LEDC_CHANNEL, aFrequency);
+}
+void tone(uint8_t aPinNumber, unsigned int aFrequency, unsigned long aDuration){
+ ledcAttachPin(aPinNumber, TONE_LEDC_CHANNEL);
+ ledcWriteTone(TONE_LEDC_CHANNEL, aFrequency);
+ delay(aDuration);
+ ledcWriteTone(TONE_LEDC_CHANNEL, 0);
+}
+void noTone(uint8_t aPinNumber){
+ ledcWriteTone(TONE_LEDC_CHANNEL, 0);
+}
+#endif // ESP_ARDUINO_VERSION <= ESP_ARDUINO_VERSION_VAL(2, 0, 2)
+
+#define IR_RECEIVE_PIN 15 // D15
+#define IR_SEND_PIN 4 // D4
+#define TONE_PIN 27 // D27 25 & 26 are DAC0 and 1
+#define APPLICATION_PIN 16 // RX2 pin
+
+#elif defined(ARDUINO_ARCH_STM32) || defined(ARDUINO_ARCH_STM32F1) // BluePill
+// Timer 3 blocks PA6, PA7, PB0, PB1 for use by Servo or tone()
+#define IR_RECEIVE_PIN PA6
+#define IR_RECEIVE_PIN_STRING "PA6"
+#define IR_SEND_PIN PA7
+#define IR_SEND_PIN_STRING "PA7"
+#define TONE_PIN PA3
+#define _IR_TIMING_TEST_PIN PA5
+#define APPLICATION_PIN PA2
+#define APPLICATION_PIN_STRING "PA2"
+# if defined(ARDUINO_GENERIC_STM32F103C) || defined(ARDUINO_BLUEPILL_F103C8)
+// BluePill LED is active low
+#define FEEDBACK_LED_IS_ACTIVE_LOW
+# endif
+
+#elif defined(ARDUINO_ARCH_APOLLO3) // Sparkfun Apollo boards
+#define IR_RECEIVE_PIN 11
+#define IR_SEND_PIN 12
+#define TONE_PIN 5
+
+#elif defined(ARDUINO_ARCH_MBED) && defined(ARDUINO_ARCH_MBED_NANO) // Arduino Nano 33 BLE and Arduino Nano Connect layout for MBED
+// Must be before ARDUINO_ARCH_RP2040, since it is the layout for the MBED core of Arduino Nano Connect
+#define IR_RECEIVE_PIN 3 // GPIO15 Start with pin 3 since pin 2|GPIO25 is connected to LED on Pi pico
+#define IR_SEND_PIN 4 // GPIO16
+#define TONE_PIN 5
+#define APPLICATION_PIN 6
+#define ALTERNATIVE_IR_FEEDBACK_LED_PIN 7 // E.g. used for examples which use LED_BUILDIN for example output.
+#define _IR_TIMING_TEST_PIN 8
+
+#elif defined(ARDUINO_ARCH_RP2040) // Arduino Nano Connect, Pi Pico with arduino-pico core https://github.com/earlephilhower/arduino-pico
+#define IR_RECEIVE_PIN 15 // GPIO15 to be compatible with the Arduino Nano RP2040 Connect (pin3)
+#define IR_SEND_PIN 16 // GPIO16
+#define TONE_PIN 17
+#define APPLICATION_PIN 18
+#define ALTERNATIVE_IR_FEEDBACK_LED_PIN 19 // E.g. used for examples which use LED_BUILDIN for example output.
+#define _IR_TIMING_TEST_PIN 20
+
+// If you program the Nano RP2040 Connect with this core, then you must redefine LED_BUILTIN
+// and use the external reset with 1 kOhm to ground to enter UF2 mode
+#undef LED_BUILTIN
+#define LED_BUILTIN 6
+
+#elif defined(PARTICLE) // !!!UNTESTED!!!
+#define IR_RECEIVE_PIN A4
+#define IR_SEND_PIN A5 // Particle supports multiple pins
+
+#define LED_BUILTIN D7
+
+/*
+ * 4 times the same (default) layout for easy adaption in the future
+ */
+#elif defined(TEENSYDUINO) // Teensy 2.0 is handled at default for ATmega328 like on Uno, Nano, Leonardo etc.
+#define IR_RECEIVE_PIN 2
+#define IR_SEND_PIN 3
+#define TONE_PIN 4
+#define APPLICATION_PIN 5
+#define ALTERNATIVE_IR_FEEDBACK_LED_PIN 6 // E.g. used for examples which use LED_BUILDIN for example output.
+#define _IR_TIMING_TEST_PIN 7
+
+#elif defined(ARDUINO_ARCH_MBED) // Arduino Nano 33 BLE
+#define IR_RECEIVE_PIN 2
+#define IR_SEND_PIN 3
+#define TONE_PIN 4
+#define APPLICATION_PIN 5
+#define ALTERNATIVE_IR_FEEDBACK_LED_PIN 6 // E.g. used for examples which use LED_BUILDIN for example output.
+#define _IR_TIMING_TEST_PIN 7
+
+#elif defined(ARDUINO_ARCH_SAMD) || defined(ARDUINO_ARCH_SAM)
+#define IR_RECEIVE_PIN 2
+#define IR_SEND_PIN 3
+#define TONE_PIN 4
+#define APPLICATION_PIN 5
+#define ALTERNATIVE_IR_FEEDBACK_LED_PIN 6 // E.g. used for examples which use LED_BUILDIN for example output.
+#define _IR_TIMING_TEST_PIN 7
+
+#if !defined(ARDUINO_SAMD_ADAFRUIT) && !defined(ARDUINO_SEEED_XIAO_M0)
+// On the Zero and others we switch explicitly to SerialUSB
+#define Serial SerialUSB
+#endif
+
+// Definitions for the Chinese SAMD21 M0-Mini clone, which has no led connected to D13/PA17.
+// Attention!!! D2 and D4 are swapped on these boards!!!
+// If you connect the LED, it is on pin 24/PB11. In this case activate the next two lines.
+//#undef LED_BUILTIN
+//#define LED_BUILTIN 24 // PB11
+// As an alternative you can choose pin 25, it is the RX-LED pin (PB03), but active low.In this case activate the next 3 lines.
+//#undef LED_BUILTIN
+//#define LED_BUILTIN 25 // PB03
+//#define FEEDBACK_LED_IS_ACTIVE_LOW // The RX LED on the M0-Mini is active LOW
+
+#elif defined (NRF51) // BBC micro:bit
+#define IR_RECEIVE_PIN 2
+#define IR_SEND_PIN 3
+#define APPLICATION_PIN 1
+#define _IR_TIMING_TEST_PIN 4
+
+#define tone(...) void() // no tone() available
+#define noTone(a) void()
+#define TONE_PIN 42 // Dummy for examples using it
+
+#else
+#warning Board / CPU is not detected using pre-processor symbols -> using default values, which may not fit. Please extend PinDefinitionsAndMore.h.
+// Default valued for unidentified boards
+#define IR_RECEIVE_PIN 2
+#define IR_SEND_PIN 3
+#define TONE_PIN 4
+#define APPLICATION_PIN 5
+#define ALTERNATIVE_IR_FEEDBACK_LED_PIN 6 // E.g. used for examples which use LED_BUILDIN for example output.
+#define _IR_TIMING_TEST_PIN 7
+#endif // defined(ESP8266)
+
+#if defined(ESP32) || defined(ARDUINO_ARCH_RP2040) || defined(PARTICLE) || defined(ARDUINO_ARCH_MBED)
+#define SEND_PWM_BY_TIMER // We do not have pin restrictions for this CPU's, so lets use the hardware PWM for send carrier signal generation
+#else
+# if defined(SEND_PWM_BY_TIMER)
+#undef IR_SEND_PIN // SendPin is determined by timer! This avoids warnings in IRremote.hpp and IRTimer.hpp
+# endif
+#endif
+
+#if !defined (FLASHEND)
+#define FLASHEND 0xFFFF // Dummy value for platforms where FLASHEND is not defined
+#endif
+
+/*
+ * Helper macro for getting a macro definition as string
+ */
+#if !defined(STR_HELPER)
+#define STR_HELPER(x) #x
+#define STR(x) STR_HELPER(x)
+#endif
diff --git a/libraries/IRremote/examples/ReceiveDump/ReceiveDump.ino b/libraries/IRremote/examples/ReceiveDump/ReceiveDump.ino
new file mode 100644
index 0000000..5ff24d5
--- /dev/null
+++ b/libraries/IRremote/examples/ReceiveDump/ReceiveDump.ino
@@ -0,0 +1,161 @@
+/*
+ * ReceiveDump.cpp
+ *
+ * Dumps the received signal in different flavors.
+ * Since the printing takes so much time (200 ms @115200 for NEC protocol, 70ms for NEC repeat),
+ * repeat signals may be skipped or interpreted as UNKNOWN.
+ *
+ * This file is part of Arduino-IRremote https://github.com/Arduino-IRremote/Arduino-IRremote.
+ *
+ ************************************************************************************
+ * MIT License
+ *
+ * Copyright (c) 2020-2024 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.
+ *
+ ************************************************************************************
+ */
+#include
+
+// #include "PinDefinitionsAndMore.h" // Define macros for input and output pin etc.
+/*
+ * Helper macro for getting a macro definition as string
+ */
+#if !defined(STR_HELPER)
+#define STR_HELPER(x) #x
+#define STR(x) STR_HELPER(x)
+#endif
+
+#define IR_RECEIVE_PIN 4 // P0_1
+
+
+#if !defined(RAW_BUFFER_LENGTH)
+// For air condition remotes it requires 750. Default is 200.
+#define RAW_BUFFER_LENGTH 730 // this allows usage of 16 bit raw buffer, for RECORD_GAP_MICROS > 20000
+
+#endif
+
+/*
+ * 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. See also IRremote.hpp line 142.
+ *
+ * You can change this value accordingly to the receiver module you use.
+ * The required value can be derived from the timings printed here.
+ * Keep in mind that the timings may change with the distance
+ * between sender and receiver as well as with the ambient light intensity.
+ */
+#define MARK_EXCESS_MICROS 20 // Adapt it to your IR receiver module. 20 is recommended for the cheap VS1838 modules.
+
+//#define RECORD_GAP_MICROS 12000 // Default is 8000. Activate it for some LG air conditioner protocols
+//#define DEBUG // Activate this for lots of lovely debug output from the decoders.
+
+#include
+
+//+=============================================================================
+// Configure the Arduino
+//
+void setup() {
+ pinMode(LED_BUILTIN, OUTPUT);
+
+ Serial.begin(9600); // Status message will be sent to PC at 9600 baud
+ while (!Serial)
+ ; // Wait for Serial to become available. Is optimized away for some cores.
+
+ // Just to know which program is running on my Arduino
+ Serial.println(F("START " __FILE__ " from " __DATE__ "\r\nUsing library version " VERSION_IRREMOTE));
+
+ // Start the receiver and if not 3. parameter specified, take LED_BUILTIN pin from the internal boards definition as default feedback LED
+ IrReceiver.begin(IR_RECEIVE_PIN, ENABLE_LED_FEEDBACK);
+
+ Serial.print(F("Ready to receive IR signals of protocols: "));
+ printActiveIRProtocols(&Serial);
+ Serial.println(F("at pin " STR(IR_RECEIVE_PIN)));
+
+ // infos for receive
+ Serial.print(RECORD_GAP_MICROS);
+ Serial.println(F(" us is the (minimum) gap, after which the start of a new IR packet is assumed"));
+ Serial.print(MARK_EXCESS_MICROS);
+ Serial.println();
+ Serial.println(F("Because of the verbose output (>200 ms at 115200 baud), repeats are not dumped correctly!"));
+ Serial.println();
+ Serial.println(
+ F(
+ "If you receive protocol NEC, Samsung or LG, run also ReceiveDemo to check if your actual protocol is eventually NEC2 or SamsungLG, which is determined by the repeats"));
+ Serial.println();
+
+}
+
+//+=============================================================================
+// The repeating section of the code
+//
+void loop() {
+ if (IrReceiver.decode()) { // Grab an IR code
+ // At 115200 baud, printing takes 200 ms for NEC protocol and 70 ms for NEC repeat
+ Serial.println(); // blank line between entries
+ Serial.println(); // 2 blank lines between entries
+ IrReceiver.printIRResultShort(&Serial);
+ // Check if the buffer overflowed
+ if (IrReceiver.decodedIRData.flags & IRDATA_FLAGS_WAS_OVERFLOW) {
+ Serial.println(F("Try to increase the \"RAW_BUFFER_LENGTH\" value of " STR(RAW_BUFFER_LENGTH) " in " __FILE__));
+ // see also https://github.com/Arduino-IRremote/Arduino-IRremote#compile-options--macros-for-this-library
+ } else {
+ if (IrReceiver.decodedIRData.protocol == UNKNOWN) {
+ Serial.println(F("Received noise or an unknown (or not yet enabled) protocol"));
+ }
+ Serial.println();
+ IrReceiver.printIRSendUsage(&Serial);
+ Serial.println();
+ Serial.println(F("Raw result in internal ticks (50 us) - with leading gap"));
+ IrReceiver.printIRResultRawFormatted(&Serial, false); // Output the results in RAW format
+ Serial.println(F("Raw result in microseconds - with leading gap"));
+ IrReceiver.printIRResultRawFormatted(&Serial, true); // Output the results in RAW format
+ Serial.println(); // blank line between entries
+ Serial.print(F("Result as internal 8bit ticks (50 us) array - compensated with MARK_EXCESS_MICROS="));
+ Serial.println(MARK_EXCESS_MICROS);
+ IrReceiver.compensateAndPrintIRResultAsCArray(&Serial, false); // Output the results as uint8_t source code array of ticks
+ Serial.print(F("Result as microseconds array - compensated with MARK_EXCESS_MICROS="));
+ Serial.println(MARK_EXCESS_MICROS);
+ IrReceiver.compensateAndPrintIRResultAsCArray(&Serial, true); // Output the results as uint16_t source code array of micros
+ IrReceiver.printIRResultAsCVariables(&Serial); // Output address and data as source code variables
+ Serial.println(); // blank line between entries
+
+ IrReceiver.compensateAndPrintIRResultAsPronto(&Serial);
+
+ /*
+ * Example for using the compensateAndStorePronto() function.
+ * Creating this String requires 2210 bytes program memory and 10 bytes RAM for the String class.
+ * The String object itself requires additional 440 bytes RAM from the heap.
+ * This values are for an Arduino Uno.
+ */
+// Serial.println(); // blank line between entries
+// String ProntoHEX = F("Pronto HEX contains: "); // Assign string to ProtoHex string object
+// if (int size = IrReceiver.compensateAndStorePronto(&ProntoHEX)) { // Dump the content of the IReceiver Pronto HEX to the String object
+// // Append compensateAndStorePronto() size information to the String object (requires 50 bytes heap)
+// ProntoHEX += F("\r\nProntoHEX is "); // Add codes size information to the String object
+// ProntoHEX += size;
+// ProntoHEX += F(" characters long and contains "); // Add codes count information to the String object
+// ProntoHEX += size / 5;
+// ProntoHEX += F(" codes");
+// Serial.println(ProntoHEX.c_str()); // Print to the serial console the whole String object
+// Serial.println(); // blank line between entries
+// }
+ }
+ IrReceiver.resume(); // Prepare for the next IR frame
+ }
+}
diff --git a/libraries/IRremote/examples/ReceiveDump/ReceiveDump.log b/libraries/IRremote/examples/ReceiveDump/ReceiveDump.log
new file mode 100644
index 0000000..ae16f33
--- /dev/null
+++ b/libraries/IRremote/examples/ReceiveDump/ReceiveDump.log
@@ -0,0 +1,52 @@
+START ../src/ReceiveDump.cpp from Nov 12 2022
+Using library version 4.0.0
+Ready to receive IR signals of protocols: NEC/NEC2/Onkyo/Apple, Panasonic/Kaseikyo, Denon/Sharp, Sony, RC5, RC6, LG, JVC, Samsung, Whynter, Lego Power Functions, Bosewave , MagiQuest, Universal Pulse Distance Width, Hash at pin 2
+5000 us is the (minimum) gap, after which the start of a new IR packet is assumed
+20 us are subtracted from all marks and added to all spaces for decoding
+
+
+Protocol=Samsung Address=0x707 Command=0x4 Raw-Data=0xFB040707 32 bits LSB first
+
+Send with: IrSender.sendSamsung(0x707, 0x4, );
+
+Raw result in internal ticks (50 us) - with leading gap
+rawData[68]:
+ -27948
+ +90,-84
+ +12,-32 +12,-32 +12,-32 +12,-11
+ +11,-11 +11,-11 +11,-11 +11,-11
+ +12,-32 +12,-32 +12,-32 +12,-10
+ +12,-10 +12,-10 +12,-10 +12,-11
+ +11,-11 +11,-11 +11,-33 +11,-11
+ +11,-11 +11,-11 +11,-11 +11,-11
+ +12,-32 +12,-32 +12,-10 +12,-32
+ +12,-32 +12,-32 +12,-32 +12,-32
+ +12
+Sum: 1200
+Raw result in microseconds - with leading gap
+rawData[68]:
+ -1397400
+ +4500,-4200
+ + 600,-1600 + 600,-1600 + 600,-1600 + 600,- 550
+ + 550,- 550 + 550,- 550 + 550,- 550 + 550,- 550
+ + 600,-1600 + 600,-1600 + 600,-1600 + 600,- 500
+ + 600,- 500 + 600,- 500 + 600,- 500 + 600,- 550
+ + 550,- 550 + 550,- 550 + 550,-1650 + 550,- 550
+ + 550,- 550 + 550,- 550 + 550,- 550 + 550,- 550
+ + 600,-1600 + 600,-1600 + 600,- 500 + 600,-1600
+ + 600,-1600 + 600,-1600 + 600,-1600 + 600,-1600
+ + 600
+Sum: 60000
+
+Result as internal ticks (50 us) array - compensated with MARK_EXCESS_MICROS=20
+uint8_t rawTicks[67] = {90,84, 12,32, 12,32, 12,32, 12,11, 11,11, 11,11, 11,11, 11,11, 12,32, 12,32, 12,32, 12,10, 12,10, 12,10, 12,10, 12,11, 11,11, 11,11, 11,33, 11,11, 11,11, 11,11, 11,11, 11,11, 12,32, 12,32, 12,10, 12,32, 12,32, 12,32, 12,32, 12,32, 12}; // Protocol=Samsung Address=0x707 Command=0x4 Raw-Data=0xFB040707 32 bits LSB first
+
+Result as microseconds array - compensated with MARK_EXCESS_MICROS=20
+uint16_t rawData[67] = {4480,4220, 580,1620, 580,1620, 580,1620, 580,570, 530,570, 530,570, 530,570, 530,570, 580,1620, 580,1620, 580,1620, 580,520, 580,520, 580,520, 580,520, 580,570, 530,570, 530,570, 530,1670, 530,570, 530,570, 530,570, 530,570, 530,570, 580,1620, 580,1620, 580,520, 580,1620, 580,1620, 580,1620, 580,1620, 580,1620, 580}; // Protocol=Samsung Address=0x707 Command=0x4 Raw-Data=0xFB040707 32 bits LSB first
+
+uint16_t address = 0x707;
+uint16_t command = 0x4;
+uint32_t data = 0xFB040707;
+
+Pronto Hex as string
+char prontoData[] = "0000 006D 0022 0000 00AE 00A1 0018 003D 0018 003D 0018 003D 0018 0014 0016 0014 0016 0014 0016 0014 0016 0014 0018 003D 0018 003D 0018 003D 0018 0012 0018 0012 0018 0012 0018 0012 0018 0014 0016 0014 0016 0014 0016 003F 0016 0014 0016 0014 0016 0014 0016 0014 0016 0014 0018 003D 0018 003D 0018 0012 0018 003D 0018 003D 0018 003D 0018 003D 0018 003D 0018 06C3 ";
diff --git a/libraries/IRremote/examples/ReceiveOneAndSendMultiple/PinDefinitionsAndMore.h b/libraries/IRremote/examples/ReceiveOneAndSendMultiple/PinDefinitionsAndMore.h
new file mode 100644
index 0000000..14573c7
--- /dev/null
+++ b/libraries/IRremote/examples/ReceiveOneAndSendMultiple/PinDefinitionsAndMore.h
@@ -0,0 +1,349 @@
+/*
+ * PinDefinitionsAndMore.h
+ *
+ * Contains pin definitions for IRremote examples for various platforms
+ * as well as definitions for feedback LED and tone() and includes
+ *
+ * Copyright (C) 2021-2023 Armin Joachimsmeyer
+ * armin.joachimsmeyer@gmail.com
+ *
+ * This file is part of IRremote https://github.com/Arduino-IRremote/Arduino-IRremote.
+ *
+ * Arduino-IRremote is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
+ * See the GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see .
+ *
+ */
+
+/*
+ * Pin mapping table for different platforms
+ *
+ * Platform IR input IR output Tone Core/Pin schema
+ * --------------------------------------------------------------
+ * DEFAULT/AVR 2 3 4 Arduino
+ * ATtinyX5 0|PB0 4|PB4 3|PB3 ATTinyCore
+ * ATtiny167 3|PA3 2|PA2 7|PA7 ATTinyCore
+ * ATtiny167 9|PA3 8|PA2 5|PA7 Digispark original core
+ * ATtiny84 |PB2 |PA4 |PA3 ATTinyCore
+ * ATtiny88 3|PD3 4|PD4 9|PB1 ATTinyCore
+ * ATtiny3217 18|PA1 19|PA2 20|PA3 MegaTinyCore
+ * ATtiny1604 2 3|PA5 %
+ * ATtiny816 14|PA1 16|PA3 1|PA5 MegaTinyCore
+ * ATtiny1614 8|PA1 10|PA3 1|PA5 MegaTinyCore
+ * SAMD21 3 4 5
+ * ESP8266 14|D5 12|D6 %
+ * ESP32 15 4 27
+ * ESP32-C3 2 3 4
+ * BluePill PA6 PA7 PA3
+ * APOLLO3 11 12 5
+ * RP2040 3|GPIO15 4|GPIO16 5|GPIO17
+ */
+//#define _IR_MEASURE_TIMING // For debugging purposes.
+
+#if defined(__AVR__)
+#if defined(__AVR_ATtiny25__) || defined(__AVR_ATtiny45__) || defined(__AVR_ATtiny85__) // Digispark board. For use with ATTinyCore.
+#include "ATtinySerialOut.hpp" // TX is at pin 2 - Available as Arduino library "ATtinySerialOut". Saves 700 bytes program memory and 70 bytes RAM for ATtinyCore.
+#define IR_RECEIVE_PIN PIN_PB0
+#define IR_SEND_PIN PIN_PB4 // Pin 2 is serial output with ATtinySerialOut. Pin 1 is internal LED and Pin3 is USB+ with pullup on Digispark board.
+#define TONE_PIN PIN_PB3
+#define _IR_TIMING_TEST_PIN PIN_PB3
+
+# elif defined(__AVR_ATtiny87__) || defined(__AVR_ATtiny167__) // Digispark pro board
+#include "ATtinySerialOut.hpp" // Available as Arduino library "ATtinySerialOut"
+// For ATtiny167 Pins PB6 and PA3 are usable as interrupt source.
+# if defined(ARDUINO_AVR_DIGISPARKPRO)
+// For use with Digispark original core
+#define IR_RECEIVE_PIN 9 // PA3 - on Digispark board labeled as pin 9
+//#define IR_RECEIVE_PIN 14 // PB6 / INT0 is connected to USB+ on DigisparkPro boards
+#define IR_SEND_PIN 8 // PA2 - on Digispark board labeled as pin 8
+#define TONE_PIN 5 // PA7 - on Digispark board labeled as pin 5
+#define _IR_TIMING_TEST_PIN 10 // PA4
+# else
+// For use with ATTinyCore
+#define IR_RECEIVE_PIN PIN_PA3 // On Digispark board labeled as pin 9 - INT0 is connected to USB+ on DigisparkPro boards
+#define IR_SEND_PIN PIN_PA2 // On Digispark board labeled as pin 8
+#define TONE_PIN PIN_PA7 // On Digispark board labeled as pin 5
+# endif
+
+# elif defined(__AVR_ATtiny84__) // For use with ATTinyCore
+#include "ATtinySerialOut.hpp" // Available as Arduino library "ATtinySerialOut". Saves 128 bytes program memory.
+#define IR_RECEIVE_PIN PIN_PB2 // INT0
+#define IR_SEND_PIN PIN_PA4
+#define TONE_PIN PIN_PA3
+#define _IR_TIMING_TEST_PIN PIN_PA5
+
+# elif defined(__AVR_ATtiny88__) // MH-ET Tiny88 board. For use with ATTinyCore.
+#include "ATtinySerialOut.hpp" // Available as Arduino library "ATtinySerialOut". Saves 128 bytes program memory.
+// Pin 6 is TX, pin 7 is RX
+#define IR_RECEIVE_PIN PIN_PD3 // 3 - INT1
+#define IR_SEND_PIN PIN_PD4 // 4
+#define TONE_PIN PIN_PB1 // 9
+#define _IR_TIMING_TEST_PIN PIN_PB0 // 8
+
+# elif defined(__AVR_ATtiny1616__) || defined(__AVR_ATtiny3216__) || defined(__AVR_ATtiny3217__) // For use with megaTinyCore
+// Tiny Core Dev board
+// https://www.tindie.com/products/xkimi/tiny-core-16-dev-board-attiny1616/ - Out of Stock
+// https://www.tindie.com/products/xkimi/tiny-core-32-dev-board-attiny3217/ - Out of Stock
+#define IR_RECEIVE_PIN PIN_PA1 // use 18 instead of PIN_PA1 for TinyCore32
+#define IR_SEND_PIN PIN_PA2 // 19
+#define TONE_PIN PIN_PA3 // 20
+#define APPLICATION_PIN PIN_PA0 // 0
+#undef LED_BUILTIN // No LED available on the TinyCore 32 board, take the one on the programming board which is connected to the DAC output
+#define LED_BUILTIN PIN_PA6 // use 2 instead of PIN_PA6 for TinyCore32
+
+# elif defined(__AVR_ATtiny816__) // For use with megaTinyCore
+#define IR_RECEIVE_PIN PIN_PA1 // 14
+#define IR_SEND_PIN PIN_PA1 // 16
+#define TONE_PIN PIN_PA5 // 1
+#define APPLICATION_PIN PIN_PA4 // 0
+#undef LED_BUILTIN // No LED available, take the one which is connected to the DAC output
+#define LED_BUILTIN PIN_PB5 // 4
+
+# elif defined(__AVR_ATtiny1614__) // For use with megaTinyCore
+#define IR_RECEIVE_PIN PIN_PA1 // 8
+#define IR_SEND_PIN PIN_PA3 // 10
+#define TONE_PIN PIN_PA5 // 1
+#define APPLICATION_PIN PIN_PA4 // 0
+
+# elif defined(__AVR_ATtiny1604__) // For use with megaTinyCore
+#define IR_RECEIVE_PIN PIN_PA6 // 2 - To be compatible with interrupt example, pin 2 is chosen here.
+#define IR_SEND_PIN PIN_PA7 // 3
+#define APPLICATION_PIN PIN_PB2 // 5
+
+#define tone(...) void() // Define as void, since TCB0_INT_vect is also used by tone()
+#define noTone(a) void()
+#define TONE_PIN 42 // Dummy for examples using it
+
+# elif defined(__AVR_ATmega1284__) || defined(__AVR_ATmega1284P__) \
+|| defined(__AVR_ATmega644__) || defined(__AVR_ATmega644P__) \
+|| defined(__AVR_ATmega324P__) || defined(__AVR_ATmega324A__) \
+|| defined(__AVR_ATmega324PA__) || defined(__AVR_ATmega164A__) \
+|| defined(__AVR_ATmega164P__) || defined(__AVR_ATmega32__) \
+|| defined(__AVR_ATmega16__) || defined(__AVR_ATmega8535__) \
+|| defined(__AVR_ATmega64__) || defined(__AVR_ATmega128__) \
+|| defined(__AVR_ATmega1281__) || defined(__AVR_ATmega2561__) \
+|| defined(__AVR_ATmega8515__) || defined(__AVR_ATmega162__)
+#define IR_RECEIVE_PIN 2
+#define IR_SEND_PIN 13
+#define TONE_PIN 4
+#define APPLICATION_PIN 5
+#define ALTERNATIVE_IR_FEEDBACK_LED_PIN 6 // E.g. used for examples which use LED_BUILDIN for example output.
+#define _IR_TIMING_TEST_PIN 7
+
+# else // Default as for ATmega328 like on Uno, Nano, Leonardo, Teensy 2.0 etc.
+#define IR_RECEIVE_PIN 2 // To be compatible with interrupt example, pin 2 is chosen here.
+#define IR_SEND_PIN 3
+#define TONE_PIN 4
+#define APPLICATION_PIN 5
+#define ALTERNATIVE_IR_FEEDBACK_LED_PIN 6 // E.g. used for examples which use LED_BUILDIN for example output.
+#define _IR_TIMING_TEST_PIN 7
+
+# if defined(ARDUINO_AVR_PROMICRO) // Sparkfun Pro Micro is __AVR_ATmega32U4__ but has different external circuit
+// We have no built in LED at pin 13 -> reuse RX LED
+#undef LED_BUILTIN
+#define LED_BUILTIN LED_BUILTIN_RX
+# endif
+# endif // defined(__AVR_ATtiny25__)...
+
+#elif defined(ARDUINO_ARCH_RENESAS_UNO) // Uno R4
+// To be compatible with Uno R3.
+#define IR_RECEIVE_PIN 2
+#define IR_SEND_PIN 3
+#define TONE_PIN 4
+#define APPLICATION_PIN 5
+#define ALTERNATIVE_IR_FEEDBACK_LED_PIN 6 // E.g. used for examples which use LED_BUILDIN for example output.
+#define _IR_TIMING_TEST_PIN 7
+
+#elif defined(ESP8266)
+#define FEEDBACK_LED_IS_ACTIVE_LOW // The LED on my board (D4) is active LOW
+#define IR_RECEIVE_PIN 14 // D5
+#define IR_SEND_PIN 12 // D6 - D4/pin 2 is internal LED
+#define _IR_TIMING_TEST_PIN 2 // D4
+#define APPLICATION_PIN 13 // D7
+
+#define tone(...) void() // tone() inhibits receive timer
+#define noTone(a) void()
+#define TONE_PIN 42 // Dummy for examples using it#
+
+#elif defined(ARDUINO_NOLOGO_ESP32C3_SUPER_MINI)
+#define FEEDBACK_LED_IS_ACTIVE_LOW // The LED on my board (D8) is active LOW
+#define IR_RECEIVE_PIN 2
+#define IR_SEND_PIN 3
+#define TONE_PIN 4
+#define APPLICATION_PIN 10
+
+#elif defined(CONFIG_IDF_TARGET_ESP32C3) || defined(ARDUINO_ESP32C3_DEV)
+#define NO_LED_FEEDBACK_CODE // The WS2812 on pin 8 of AI-C3 board crashes if used as receive feedback LED, other I/O pins are working...
+#define IR_RECEIVE_PIN 6
+#define IR_SEND_PIN 7
+#define TONE_PIN 10
+#define APPLICATION_PIN 18
+
+#elif defined(ESP32)
+#include
+
+// tone() is included in ESP32 core since 2.0.2
+#if !defined(ESP_ARDUINO_VERSION_VAL)
+#define ESP_ARDUINO_VERSION_VAL(major, minor, patch) 12345678
+#endif
+#if ESP_ARDUINO_VERSION <= ESP_ARDUINO_VERSION_VAL(2, 0, 2)
+#define TONE_LEDC_CHANNEL 1 // Using channel 1 makes tone() independent of receiving timer -> No need to stop receiving timer.
+void tone(uint8_t aPinNumber, unsigned int aFrequency){
+ ledcAttachPin(aPinNumber, TONE_LEDC_CHANNEL);
+ ledcWriteTone(TONE_LEDC_CHANNEL, aFrequency);
+}
+void tone(uint8_t aPinNumber, unsigned int aFrequency, unsigned long aDuration){
+ ledcAttachPin(aPinNumber, TONE_LEDC_CHANNEL);
+ ledcWriteTone(TONE_LEDC_CHANNEL, aFrequency);
+ delay(aDuration);
+ ledcWriteTone(TONE_LEDC_CHANNEL, 0);
+}
+void noTone(uint8_t aPinNumber){
+ ledcWriteTone(TONE_LEDC_CHANNEL, 0);
+}
+#endif // ESP_ARDUINO_VERSION <= ESP_ARDUINO_VERSION_VAL(2, 0, 2)
+
+#define IR_RECEIVE_PIN 15 // D15
+#define IR_SEND_PIN 4 // D4
+#define TONE_PIN 27 // D27 25 & 26 are DAC0 and 1
+#define APPLICATION_PIN 16 // RX2 pin
+
+#elif defined(ARDUINO_ARCH_STM32) || defined(ARDUINO_ARCH_STM32F1) // BluePill
+// Timer 3 blocks PA6, PA7, PB0, PB1 for use by Servo or tone()
+#define IR_RECEIVE_PIN PA6
+#define IR_RECEIVE_PIN_STRING "PA6"
+#define IR_SEND_PIN PA7
+#define IR_SEND_PIN_STRING "PA7"
+#define TONE_PIN PA3
+#define _IR_TIMING_TEST_PIN PA5
+#define APPLICATION_PIN PA2
+#define APPLICATION_PIN_STRING "PA2"
+# if defined(ARDUINO_GENERIC_STM32F103C) || defined(ARDUINO_BLUEPILL_F103C8)
+// BluePill LED is active low
+#define FEEDBACK_LED_IS_ACTIVE_LOW
+# endif
+
+#elif defined(ARDUINO_ARCH_APOLLO3) // Sparkfun Apollo boards
+#define IR_RECEIVE_PIN 11
+#define IR_SEND_PIN 12
+#define TONE_PIN 5
+
+#elif defined(ARDUINO_ARCH_MBED) && defined(ARDUINO_ARCH_MBED_NANO) // Arduino Nano 33 BLE and Arduino Nano Connect layout for MBED
+// Must be before ARDUINO_ARCH_RP2040, since it is the layout for the MBED core of Arduino Nano Connect
+#define IR_RECEIVE_PIN 3 // GPIO15 Start with pin 3 since pin 2|GPIO25 is connected to LED on Pi pico
+#define IR_SEND_PIN 4 // GPIO16
+#define TONE_PIN 5
+#define APPLICATION_PIN 6
+#define ALTERNATIVE_IR_FEEDBACK_LED_PIN 7 // E.g. used for examples which use LED_BUILDIN for example output.
+#define _IR_TIMING_TEST_PIN 8
+
+#elif defined(ARDUINO_ARCH_RP2040) // Arduino Nano Connect, Pi Pico with arduino-pico core https://github.com/earlephilhower/arduino-pico
+#define IR_RECEIVE_PIN 15 // GPIO15 to be compatible with the Arduino Nano RP2040 Connect (pin3)
+#define IR_SEND_PIN 16 // GPIO16
+#define TONE_PIN 17
+#define APPLICATION_PIN 18
+#define ALTERNATIVE_IR_FEEDBACK_LED_PIN 19 // E.g. used for examples which use LED_BUILDIN for example output.
+#define _IR_TIMING_TEST_PIN 20
+
+// If you program the Nano RP2040 Connect with this core, then you must redefine LED_BUILTIN
+// and use the external reset with 1 kOhm to ground to enter UF2 mode
+#undef LED_BUILTIN
+#define LED_BUILTIN 6
+
+#elif defined(PARTICLE) // !!!UNTESTED!!!
+#define IR_RECEIVE_PIN A4
+#define IR_SEND_PIN A5 // Particle supports multiple pins
+
+#define LED_BUILTIN D7
+
+/*
+ * 4 times the same (default) layout for easy adaption in the future
+ */
+#elif defined(TEENSYDUINO) // Teensy 2.0 is handled at default for ATmega328 like on Uno, Nano, Leonardo etc.
+#define IR_RECEIVE_PIN 2
+#define IR_SEND_PIN 3
+#define TONE_PIN 4
+#define APPLICATION_PIN 5
+#define ALTERNATIVE_IR_FEEDBACK_LED_PIN 6 // E.g. used for examples which use LED_BUILDIN for example output.
+#define _IR_TIMING_TEST_PIN 7
+
+#elif defined(ARDUINO_ARCH_MBED) // Arduino Nano 33 BLE
+#define IR_RECEIVE_PIN 2
+#define IR_SEND_PIN 3
+#define TONE_PIN 4
+#define APPLICATION_PIN 5
+#define ALTERNATIVE_IR_FEEDBACK_LED_PIN 6 // E.g. used for examples which use LED_BUILDIN for example output.
+#define _IR_TIMING_TEST_PIN 7
+
+#elif defined(ARDUINO_ARCH_SAMD) || defined(ARDUINO_ARCH_SAM)
+#define IR_RECEIVE_PIN 2
+#define IR_SEND_PIN 3
+#define TONE_PIN 4
+#define APPLICATION_PIN 5
+#define ALTERNATIVE_IR_FEEDBACK_LED_PIN 6 // E.g. used for examples which use LED_BUILDIN for example output.
+#define _IR_TIMING_TEST_PIN 7
+
+#if !defined(ARDUINO_SAMD_ADAFRUIT) && !defined(ARDUINO_SEEED_XIAO_M0)
+// On the Zero and others we switch explicitly to SerialUSB
+#define Serial SerialUSB
+#endif
+
+// Definitions for the Chinese SAMD21 M0-Mini clone, which has no led connected to D13/PA17.
+// Attention!!! D2 and D4 are swapped on these boards!!!
+// If you connect the LED, it is on pin 24/PB11. In this case activate the next two lines.
+//#undef LED_BUILTIN
+//#define LED_BUILTIN 24 // PB11
+// As an alternative you can choose pin 25, it is the RX-LED pin (PB03), but active low.In this case activate the next 3 lines.
+//#undef LED_BUILTIN
+//#define LED_BUILTIN 25 // PB03
+//#define FEEDBACK_LED_IS_ACTIVE_LOW // The RX LED on the M0-Mini is active LOW
+
+#elif defined (NRF51) // BBC micro:bit
+#define IR_RECEIVE_PIN 2
+#define IR_SEND_PIN 3
+#define APPLICATION_PIN 1
+#define _IR_TIMING_TEST_PIN 4
+
+#define tone(...) void() // no tone() available
+#define noTone(a) void()
+#define TONE_PIN 42 // Dummy for examples using it
+
+#else
+#warning Board / CPU is not detected using pre-processor symbols -> using default values, which may not fit. Please extend PinDefinitionsAndMore.h.
+// Default valued for unidentified boards
+#define IR_RECEIVE_PIN 2
+#define IR_SEND_PIN 3
+#define TONE_PIN 4
+#define APPLICATION_PIN 5
+#define ALTERNATIVE_IR_FEEDBACK_LED_PIN 6 // E.g. used for examples which use LED_BUILDIN for example output.
+#define _IR_TIMING_TEST_PIN 7
+#endif // defined(ESP8266)
+
+#if defined(ESP32) || defined(ARDUINO_ARCH_RP2040) || defined(PARTICLE) || defined(ARDUINO_ARCH_MBED)
+#define SEND_PWM_BY_TIMER // We do not have pin restrictions for this CPU's, so lets use the hardware PWM for send carrier signal generation
+#else
+# if defined(SEND_PWM_BY_TIMER)
+#undef IR_SEND_PIN // SendPin is determined by timer! This avoids warnings in IRremote.hpp and IRTimer.hpp
+# endif
+#endif
+
+#if !defined (FLASHEND)
+#define FLASHEND 0xFFFF // Dummy value for platforms where FLASHEND is not defined
+#endif
+
+/*
+ * Helper macro for getting a macro definition as string
+ */
+#if !defined(STR_HELPER)
+#define STR_HELPER(x) #x
+#define STR(x) STR_HELPER(x)
+#endif
diff --git a/libraries/IRremote/examples/ReceiveOneAndSendMultiple/ReceiveOneAndSendMultiple.ino b/libraries/IRremote/examples/ReceiveOneAndSendMultiple/ReceiveOneAndSendMultiple.ino
new file mode 100644
index 0000000..1f250fb
--- /dev/null
+++ b/libraries/IRremote/examples/ReceiveOneAndSendMultiple/ReceiveOneAndSendMultiple.ino
@@ -0,0 +1,264 @@
+/*
+ * ReceiveOneAndSendMultiple.cpp
+ *
+ * Serves as a IR remote macro expander
+ * Receives Samsung32 protocol and on receiving a specified input frame,
+ * it sends multiple Samsung32 frames with appropriate delays in between.
+ * This serves as a Netflix-key emulation for my old Samsung H5273 TV.
+ *
+ * Tested on a digispark ATTiny85 board using AttinyCore https://github.com/SpenceKonde/ATTinyCore
+ *
+ * This file is part of Arduino-IRremote https://github.com/Arduino-IRremote/Arduino-IRremote.
+ *
+ ************************************************************************************
+ * MIT License
+ *
+ * Copyright (c) 2020-2024 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.
+ *
+ ************************************************************************************
+ */
+
+// Digispark ATMEL ATTINY85
+// Piezo speaker must have a 270 ohm resistor in series for USB programming and running at the Samsung TV.
+// IR LED has a 270 ohm resistor in series.
+// +-\/-+
+// !RESET (5) PB5 1| |8 Vcc
+// USB+ 3.6V Z-Diode, 1.5kOhm to VCC Piezo (3) PB3 2| |7 PB2 (2) TX Debug output
+// USB- 3.6V Z-Diode IR Output (4) PB4 3| |6 PB1 (1) Feedback LED
+// GND 4| |5 PB0 (0) IR Input
+// +----+
+/* SAUMSUMG REMOTE CODES (Model: BN59-01180A) - Address is 0x07
+ * Power Button - 0x2
+ * Power Off - 0x98
+ * 1 - 0x4
+ * 2 - 0x5
+ * 3 - 0x6
+ * 4 - 0x8
+ * 5 - 0x9
+ * 6 - 0xa
+ * 7 - 0xc
+ * 8 - 0xd
+ * 9 - 0xe
+ * CH List - 0x6b
+ * Vol + - 0x7
+ * Vol - - 0xb
+ * Mute - 0xf
+ * Source - 0x1
+ * Ch + - 0x12
+ * Ch - - 0x10
+ * Menu - 0x1a
+ * Home - 0x79
+ * MagicInfo Player - 0x30
+ * Tools - 0x4b
+ * Info - 0x1f
+ * Up arrow - 0x60
+ * Left arrow - 0x65
+ * Right arrow - 0x62
+ * Down arrow - 0x61
+ * Return - 0x58
+ * Exit - 0x2d
+ * A - 0x6c
+ * B - 0x14
+ * C - 0x15
+ * D - 0x16
+ * Set - 0xab
+ * Unset - 0xac
+ * Lock - 0x77
+ * Stop (square) - 0x46
+ * Rewind (arrows) - 0x45
+ * Play (triangle) - 0x47
+ * Pause (bars) - 0x4a
+ * Fast Forward (arrows) - 0x48
+ */
+
+#include
+
+// select only Samsung protocol for sending and receiving
+#define DECODE_SAMSUNG
+#define ADDRESS_OF_SAMSUNG_REMOTE 0x07 // The value you see as address in printIRResultShort()
+
+#define TONE_PIN 5 // P0_2
+#define IR_RECEIVE_PIN 4 // P0_1
+#define IR_SEND_PIN 3 // P0_0
+
+/*
+ * Helper macro for getting a macro definition as string
+ */
+#if !defined(STR_HELPER)
+#define STR_HELPER(x) #x
+#define STR(x) STR_HELPER(x)
+#endif
+
+#include
+
+void sendSamsungSmartHubMacro(bool aDoSelect);
+void IRSendWithDelay(uint8_t aCommand, uint16_t aDelayMillis);
+
+void setup() {
+ pinMode(LED_BUILTIN, OUTPUT);
+
+ Serial.begin(9600);
+ while (!Serial)
+ ; // Wait for Serial to become available. Is optimized away for some cores.
+
+ // Just to know which program is running on my Arduino
+ Serial.println(F("START " __FILE__ " from " __DATE__ "\r\nUsing library version " VERSION_IRREMOTE));
+
+ // tone before IR setup, since it kills the IR timer settings
+ tone(TONE_PIN, 2200, 400);
+ digitalWrite(LED_BUILTIN, HIGH);
+ delay(400);
+ digitalWrite(LED_BUILTIN, LOW);
+
+ // Start the receiver and if not 3. parameter specified, take LED_BUILTIN pin from the internal boards definition as default feedback LED
+ IrReceiver.begin(IR_RECEIVE_PIN, ENABLE_LED_FEEDBACK);
+
+ Serial.print(F("Ready to receive IR signals of protocols: "));
+ printActiveIRProtocols(&Serial);
+ Serial.println(F("at pin " STR(IR_RECEIVE_PIN)));
+
+ IrSender.begin(); // Start with IR_SEND_PIN -which is defined in PinDefinitionsAndMore.h- as send pin and enable feedback LED at default feedback LED pin
+ Serial.println(F("Ready to send IR signals at pin " STR(IR_SEND_PIN)));
+}
+
+void loop() {
+ /*
+ * Check if new data available and get them
+ */
+ if (IrReceiver.decode()) {
+ // Print a short summary of received data
+ IrReceiver.printIRResultShort(&Serial);
+ IrReceiver.printIRSendUsage(&Serial);
+ Serial.println();
+
+ /*
+ * Here data is available -> evaluate IR command
+ */
+ switch (IrReceiver.decodedIRData.command) {
+ case 0x47: // The play key on the bottom of my Samsung remote
+ Serial.println(F("Play key detected, open Netflix"));
+ sendSamsungSmartHubMacro(true);
+ break;
+
+ case 0x4A: // The pause key on the bottom of my Samsung remote
+ Serial.println(F("Pause key detected, open SmartHub"));
+ sendSamsungSmartHubMacro(false);
+ break;
+
+ default:
+ break;
+ }
+
+ /*
+ * !!!Important!!! Enable receiving of the next value,
+ * since receiving has stopped after the end of the current received data packet.
+ */
+ IrReceiver.restartAfterSend(); // Is a NOP if sending does not require a timer.
+ IrReceiver.resume(); // Enable receiving of the next value
+ }
+}
+
+void IRSendWithDelay(uint8_t aCommand, uint16_t aDelayMillis) {
+ IrSender.sendSamsung(ADDRESS_OF_SAMSUNG_REMOTE, aCommand, 1); // send with one repeat
+ Serial.print(F("Send Samsung command 0x"));
+ Serial.println(aCommand);
+ delay(aDelayMillis);
+}
+
+bool sMacroWasCalledBefore = false;
+#define INITIAL_WAIT_TIME_APPS_READY_MILLIS 70000 // Time to let the TV load all software before Netflix can be started without an error
+#define INITIAL_WAIT_TIME_SMARTHUB_READY_MILLIS 20000 // Time to let the TV load all software before SmartHub manu can be displayed
+
+/*
+ * This macro calls the last SmartHub application you selected manually
+ *
+ * @param aDoSelect - if true select the current app (needs longer initial wait time) else show smarthub menu
+ *
+ */
+void sendSamsungSmartHubMacro(bool aDoSelect) {
+ uint32_t tWaitTimeAfterBoot;
+ if (aDoSelect) {
+ tWaitTimeAfterBoot = INITIAL_WAIT_TIME_APPS_READY_MILLIS;
+ } else {
+ tWaitTimeAfterBoot = INITIAL_WAIT_TIME_SMARTHUB_READY_MILLIS;
+ }
+
+ IrReceiver.stopTimer();
+ if (millis() < tWaitTimeAfterBoot) {
+ // division by 1000 and printing requires much (8%) program memory
+ Serial.print(F("It is "));
+ Serial.print(millis() / 1000);
+ Serial.print(F(" seconds after boot, Samsung H5273 TV requires "));
+ Serial.print(tWaitTimeAfterBoot / 1000);
+ Serial.println(F(" seconds after boot to be ready for the command"));
+
+ tone(TONE_PIN, 2200, 100);
+ delay(200);
+ tone(TONE_PIN, 2200, 100);
+ delay(100);
+
+ if (millis() < tWaitTimeAfterBoot) {
+ Serial.print(F("Now do a blocking wait for "));
+ Serial.print(tWaitTimeAfterBoot - millis());
+ Serial.println(F(" milliseconds"));
+ delay(tWaitTimeAfterBoot - millis());
+ }
+ }
+
+ // Do beep feedback for special key to be received
+ tone(TONE_PIN, 2200, 200);
+ delay(200);
+
+ IrReceiver.restartTimer(); // Restart IR timer.
+
+ Serial.println(F("Wait for \"not supported\" to disappear"));
+ delay(2000);
+
+ Serial.println(F("Start sending of Samsung IR macro"));
+
+ IRSendWithDelay(0x1A, 2000); // Menu and wait for the Menu to pop up
+
+ Serial.println(F("Wait for the menu to pop up"));
+ if (!sMacroWasCalledBefore) {
+ delay(2000); // wait additional time for the Menu load
+ }
+
+ for (uint_fast8_t i = 0; i < 4; ++i) {
+ IRSendWithDelay(0x61, 250); // Down arrow. For my Samsung, the high byte of the command is the inverse of the low byte
+ }
+
+ IRSendWithDelay(0x62, 400); // Right arrow
+ for (uint_fast8_t i = 0; i < 2; ++i) {
+ IRSendWithDelay(0x61, 250); // Down arrow
+ }
+
+ delay(250);
+ IRSendWithDelay(0x68, 1); // Enter for SmartHub
+
+ if (aDoSelect) {
+ Serial.println(F("Wait for SmartHub to show up, before entering current application"));
+ delay(10000); // Wait not longer than 12 seconds, because smarthub menu then disappears
+ IRSendWithDelay(0x68, 1); // Enter for last application (e.g. Netflix or Amazon)
+ }
+
+ sMacroWasCalledBefore = true;
+ Serial.println(F("Done"));
+
+}
diff --git a/libraries/IRremote/examples/ReceiverTimingAnalysis/ReceiverTimingAnalysis.ino b/libraries/IRremote/examples/ReceiverTimingAnalysis/ReceiverTimingAnalysis.ino
new file mode 100644
index 0000000..ee1551a
--- /dev/null
+++ b/libraries/IRremote/examples/ReceiverTimingAnalysis/ReceiverTimingAnalysis.ino
@@ -0,0 +1,210 @@
+/*
+ * ReceiverTimingAnalysis.cpp
+ *
+ * This program enables the pin change interrupt at pin 3 and waits for NEC (or other Pulse-Distance-Coding) IR Signal.
+ * It measures the pulse and pause times of the incoming signal and computes some statistics for it.
+ *
+ * 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 to +50 us
+ * TSOP31238 Mark Excess 0 to +50
+ *
+ *
+ * Copyright (C) 2019-2020 Armin Joachimsmeyer
+ * armin.joachimsmeyer@gmail.com
+ *
+ * This file is part of IRMP https://github.com/IRMP-org/IRMP.
+ * This file is part of Arduino-IRremote https://github.com/Arduino-IRremote/Arduino-IRremote.
+ *
+ * IRMP is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
+ * See the GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see .
+ *
+ */
+
+#include
+
+#define IR_RECEIVE_PIN 4 // P0_1
+
+/*
+ * Helper macro for getting a macro definition as string
+ */
+#define STR_HELPER(x) #x
+#define STR(x) STR_HELPER(x)
+
+void measureTimingISR(void);
+
+void setup() {
+ pinMode(LED_BUILTIN, OUTPUT);
+ Serial.begin(9600);
+ while (!Serial)
+ ; // Wait for Serial to become available. Is optimized away for some cores.
+
+ // Just to know which program is running on my Arduino
+ Serial.println(F("START " __FILE__ " from " __DATE__));
+ attachInterrupt(digitalPinToInterrupt(IR_RECEIVE_PIN), measureTimingISR, CHANGE);
+ Serial.println(F("Ready to analyze NEC IR signal at pin " STR(IR_RECEIVE_PIN)));
+ Serial.println();
+}
+
+uint8_t ISREdgeCounter = 0;
+volatile uint32_t LastMicros;
+struct timingStruct {
+ uint16_t minimum;
+ uint8_t indexOfMinimum;
+ uint16_t maximum;
+ uint8_t indexOfMaximum;
+ uint16_t average;
+
+ uint16_t SumForAverage;
+ uint8_t SampleCount;
+// uint8_t LastPrintedCount;
+};
+
+struct timingStruct Mark;
+struct timingStruct ShortSpace;
+struct timingStruct LongSpace;
+
+/*
+ * Compute minimum, maximum and average
+ */
+void processTmingValue(struct timingStruct *aTimingStruct, uint16_t aValue) {
+ if (aTimingStruct->SampleCount == 0) {
+ // initialize values
+ aTimingStruct->minimum = UINT16_MAX;
+ aTimingStruct->maximum = 0;
+ aTimingStruct->SumForAverage = 0;
+ }
+
+ if (aTimingStruct->minimum > aValue) {
+ aTimingStruct->minimum = aValue;
+ aTimingStruct->indexOfMinimum = aTimingStruct->SampleCount;
+ }
+ if (aTimingStruct->maximum < aValue) {
+ aTimingStruct->maximum = aValue;
+ aTimingStruct->indexOfMaximum = aTimingStruct->SampleCount;
+ }
+
+ aTimingStruct->SampleCount++;
+ aTimingStruct->SumForAverage += aValue;
+ aTimingStruct->average = (aTimingStruct->SumForAverage + (aTimingStruct->SampleCount / 2)) / aTimingStruct->SampleCount;
+
+}
+
+void printTimingValues(struct timingStruct *aTimingStruct, const char *aCaption) {
+// if (aTimingStruct->LastPrintedCount != aTimingStruct->SampleCount)
+// {
+// aTimingStruct->LastPrintedCount = aTimingStruct->SampleCount;
+ Serial.print(aCaption);
+ Serial.print(F(": SampleCount="));
+ Serial.print(aTimingStruct->SampleCount);
+ Serial.print(F(" Minimum="));
+ Serial.print(aTimingStruct->minimum);
+ Serial.print(F(" @"));
+ Serial.print(aTimingStruct->indexOfMinimum);
+ Serial.print(F(" Maximum="));
+ Serial.print(aTimingStruct->maximum);
+ Serial.print(F(" @"));
+ Serial.print(aTimingStruct->indexOfMaximum);
+ Serial.print(F(" Delta="));
+ Serial.print(aTimingStruct->maximum - aTimingStruct->minimum);
+ Serial.print(F(" Average="));
+ Serial.print(aTimingStruct->average);
+
+ Serial.println();
+// }
+}
+
+void loop() {
+ if (Mark.SampleCount >= 32) {
+ /*
+ * This check enables statistics for longer protocols like Kaseikyo/Panasonics
+ */
+ noInterrupts();
+ uint32_t tLastMicros = LastMicros;
+ interrupts();
+ uint32_t tMicrosDelta = micros() - tLastMicros;
+
+ if (tMicrosDelta > 10000) {
+ // NEC signal ended just now
+ Serial.println();
+ printTimingValues(&Mark, "Mark ");
+ printTimingValues(&ShortSpace, "ShortSpace");
+ printTimingValues(&LongSpace, "LongSpace ");
+
+ /*
+ * Print analysis of mark and short spaces
+ */
+ Serial.println(F("Analysis :"));
+ Serial.print(F(" (Average of mark + short space)/2 = "));
+ int16_t MarkAndShortSpaceAverage = (Mark.average + ShortSpace.average) / 2;
+ Serial.print(MarkAndShortSpaceAverage);
+ Serial.print(F(" us\r\n Delta (to NEC standard 560) = "));
+ Serial.print(MarkAndShortSpaceAverage - 560);
+ Serial.print(F("us\r\n MARK_EXCESS_MICROS = (Average of mark - Average of mark and short space) = "));
+ Serial.print((int16_t) Mark.average - MarkAndShortSpaceAverage);
+ Serial.print(F("us"));
+ Serial.println();
+ Serial.println();
+
+ Mark.SampleCount = 0; // used as flag for not printing the results more than once
+ }
+ }
+}
+
+/*
+ * The interrupt handler.
+ * Just add to the appropriate timing structure.
+ */
+void measureTimingISR()
+{
+ uint32_t tMicros = micros();
+ uint32_t tMicrosDelta = tMicros - LastMicros;
+ LastMicros = tMicros;
+ /*
+ * read level and give feedback
+ */
+ uint8_t tInputLevel = digitalRead(IR_RECEIVE_PIN);
+ digitalWrite(LED_BUILTIN, !tInputLevel);
+
+ if (tMicrosDelta > 10000) {
+ // gap > 10 ms detected, reset counter to first detected edge and initialize timing structures
+ ISREdgeCounter = 1;
+ LongSpace.SampleCount = 0;
+ ShortSpace.SampleCount = 0;
+ Mark.SampleCount = 0;
+ } else {
+ ISREdgeCounter++;
+ }
+
+ /*
+ * Skip header mark and space and first bit mark and space
+ */
+ if (ISREdgeCounter > 4) {
+ if (tInputLevel != LOW) {
+ // Mark ended
+ processTmingValue(&Mark, tMicrosDelta);
+// Serial.print('M');
+ } else {
+ // Space ended
+ if (tMicrosDelta > 1000) {
+ // long space - logical 1
+ processTmingValue(&LongSpace, tMicrosDelta);
+ Serial.print('1');
+ } else {
+ // short space - logical 0
+ processTmingValue(&ShortSpace, tMicrosDelta);
+ Serial.print('0');
+ }
+ }
+ }
+}
diff --git a/libraries/IRremote/examples/SendAndReceive/PinDefinitionsAndMore.h b/libraries/IRremote/examples/SendAndReceive/PinDefinitionsAndMore.h
new file mode 100644
index 0000000..14573c7
--- /dev/null
+++ b/libraries/IRremote/examples/SendAndReceive/PinDefinitionsAndMore.h
@@ -0,0 +1,349 @@
+/*
+ * PinDefinitionsAndMore.h
+ *
+ * Contains pin definitions for IRremote examples for various platforms
+ * as well as definitions for feedback LED and tone() and includes
+ *
+ * Copyright (C) 2021-2023 Armin Joachimsmeyer
+ * armin.joachimsmeyer@gmail.com
+ *
+ * This file is part of IRremote https://github.com/Arduino-IRremote/Arduino-IRremote.
+ *
+ * Arduino-IRremote is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
+ * See the GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see .
+ *
+ */
+
+/*
+ * Pin mapping table for different platforms
+ *
+ * Platform IR input IR output Tone Core/Pin schema
+ * --------------------------------------------------------------
+ * DEFAULT/AVR 2 3 4 Arduino
+ * ATtinyX5 0|PB0 4|PB4 3|PB3 ATTinyCore
+ * ATtiny167 3|PA3 2|PA2 7|PA7 ATTinyCore
+ * ATtiny167 9|PA3 8|PA2 5|PA7 Digispark original core
+ * ATtiny84 |PB2 |PA4 |PA3 ATTinyCore
+ * ATtiny88 3|PD3 4|PD4 9|PB1 ATTinyCore
+ * ATtiny3217 18|PA1 19|PA2 20|PA3 MegaTinyCore
+ * ATtiny1604 2 3|PA5 %
+ * ATtiny816 14|PA1 16|PA3 1|PA5 MegaTinyCore
+ * ATtiny1614 8|PA1 10|PA3 1|PA5 MegaTinyCore
+ * SAMD21 3 4 5
+ * ESP8266 14|D5 12|D6 %
+ * ESP32 15 4 27
+ * ESP32-C3 2 3 4
+ * BluePill PA6 PA7 PA3
+ * APOLLO3 11 12 5
+ * RP2040 3|GPIO15 4|GPIO16 5|GPIO17
+ */
+//#define _IR_MEASURE_TIMING // For debugging purposes.
+
+#if defined(__AVR__)
+#if defined(__AVR_ATtiny25__) || defined(__AVR_ATtiny45__) || defined(__AVR_ATtiny85__) // Digispark board. For use with ATTinyCore.
+#include "ATtinySerialOut.hpp" // TX is at pin 2 - Available as Arduino library "ATtinySerialOut". Saves 700 bytes program memory and 70 bytes RAM for ATtinyCore.
+#define IR_RECEIVE_PIN PIN_PB0
+#define IR_SEND_PIN PIN_PB4 // Pin 2 is serial output with ATtinySerialOut. Pin 1 is internal LED and Pin3 is USB+ with pullup on Digispark board.
+#define TONE_PIN PIN_PB3
+#define _IR_TIMING_TEST_PIN PIN_PB3
+
+# elif defined(__AVR_ATtiny87__) || defined(__AVR_ATtiny167__) // Digispark pro board
+#include "ATtinySerialOut.hpp" // Available as Arduino library "ATtinySerialOut"
+// For ATtiny167 Pins PB6 and PA3 are usable as interrupt source.
+# if defined(ARDUINO_AVR_DIGISPARKPRO)
+// For use with Digispark original core
+#define IR_RECEIVE_PIN 9 // PA3 - on Digispark board labeled as pin 9
+//#define IR_RECEIVE_PIN 14 // PB6 / INT0 is connected to USB+ on DigisparkPro boards
+#define IR_SEND_PIN 8 // PA2 - on Digispark board labeled as pin 8
+#define TONE_PIN 5 // PA7 - on Digispark board labeled as pin 5
+#define _IR_TIMING_TEST_PIN 10 // PA4
+# else
+// For use with ATTinyCore
+#define IR_RECEIVE_PIN PIN_PA3 // On Digispark board labeled as pin 9 - INT0 is connected to USB+ on DigisparkPro boards
+#define IR_SEND_PIN PIN_PA2 // On Digispark board labeled as pin 8
+#define TONE_PIN PIN_PA7 // On Digispark board labeled as pin 5
+# endif
+
+# elif defined(__AVR_ATtiny84__) // For use with ATTinyCore
+#include "ATtinySerialOut.hpp" // Available as Arduino library "ATtinySerialOut". Saves 128 bytes program memory.
+#define IR_RECEIVE_PIN PIN_PB2 // INT0
+#define IR_SEND_PIN PIN_PA4
+#define TONE_PIN PIN_PA3
+#define _IR_TIMING_TEST_PIN PIN_PA5
+
+# elif defined(__AVR_ATtiny88__) // MH-ET Tiny88 board. For use with ATTinyCore.
+#include "ATtinySerialOut.hpp" // Available as Arduino library "ATtinySerialOut". Saves 128 bytes program memory.
+// Pin 6 is TX, pin 7 is RX
+#define IR_RECEIVE_PIN PIN_PD3 // 3 - INT1
+#define IR_SEND_PIN PIN_PD4 // 4
+#define TONE_PIN PIN_PB1 // 9
+#define _IR_TIMING_TEST_PIN PIN_PB0 // 8
+
+# elif defined(__AVR_ATtiny1616__) || defined(__AVR_ATtiny3216__) || defined(__AVR_ATtiny3217__) // For use with megaTinyCore
+// Tiny Core Dev board
+// https://www.tindie.com/products/xkimi/tiny-core-16-dev-board-attiny1616/ - Out of Stock
+// https://www.tindie.com/products/xkimi/tiny-core-32-dev-board-attiny3217/ - Out of Stock
+#define IR_RECEIVE_PIN PIN_PA1 // use 18 instead of PIN_PA1 for TinyCore32
+#define IR_SEND_PIN PIN_PA2 // 19
+#define TONE_PIN PIN_PA3 // 20
+#define APPLICATION_PIN PIN_PA0 // 0
+#undef LED_BUILTIN // No LED available on the TinyCore 32 board, take the one on the programming board which is connected to the DAC output
+#define LED_BUILTIN PIN_PA6 // use 2 instead of PIN_PA6 for TinyCore32
+
+# elif defined(__AVR_ATtiny816__) // For use with megaTinyCore
+#define IR_RECEIVE_PIN PIN_PA1 // 14
+#define IR_SEND_PIN PIN_PA1 // 16
+#define TONE_PIN PIN_PA5 // 1
+#define APPLICATION_PIN PIN_PA4 // 0
+#undef LED_BUILTIN // No LED available, take the one which is connected to the DAC output
+#define LED_BUILTIN PIN_PB5 // 4
+
+# elif defined(__AVR_ATtiny1614__) // For use with megaTinyCore
+#define IR_RECEIVE_PIN PIN_PA1 // 8
+#define IR_SEND_PIN PIN_PA3 // 10
+#define TONE_PIN PIN_PA5 // 1
+#define APPLICATION_PIN PIN_PA4 // 0
+
+# elif defined(__AVR_ATtiny1604__) // For use with megaTinyCore
+#define IR_RECEIVE_PIN PIN_PA6 // 2 - To be compatible with interrupt example, pin 2 is chosen here.
+#define IR_SEND_PIN PIN_PA7 // 3
+#define APPLICATION_PIN PIN_PB2 // 5
+
+#define tone(...) void() // Define as void, since TCB0_INT_vect is also used by tone()
+#define noTone(a) void()
+#define TONE_PIN 42 // Dummy for examples using it
+
+# elif defined(__AVR_ATmega1284__) || defined(__AVR_ATmega1284P__) \
+|| defined(__AVR_ATmega644__) || defined(__AVR_ATmega644P__) \
+|| defined(__AVR_ATmega324P__) || defined(__AVR_ATmega324A__) \
+|| defined(__AVR_ATmega324PA__) || defined(__AVR_ATmega164A__) \
+|| defined(__AVR_ATmega164P__) || defined(__AVR_ATmega32__) \
+|| defined(__AVR_ATmega16__) || defined(__AVR_ATmega8535__) \
+|| defined(__AVR_ATmega64__) || defined(__AVR_ATmega128__) \
+|| defined(__AVR_ATmega1281__) || defined(__AVR_ATmega2561__) \
+|| defined(__AVR_ATmega8515__) || defined(__AVR_ATmega162__)
+#define IR_RECEIVE_PIN 2
+#define IR_SEND_PIN 13
+#define TONE_PIN 4
+#define APPLICATION_PIN 5
+#define ALTERNATIVE_IR_FEEDBACK_LED_PIN 6 // E.g. used for examples which use LED_BUILDIN for example output.
+#define _IR_TIMING_TEST_PIN 7
+
+# else // Default as for ATmega328 like on Uno, Nano, Leonardo, Teensy 2.0 etc.
+#define IR_RECEIVE_PIN 2 // To be compatible with interrupt example, pin 2 is chosen here.
+#define IR_SEND_PIN 3
+#define TONE_PIN 4
+#define APPLICATION_PIN 5
+#define ALTERNATIVE_IR_FEEDBACK_LED_PIN 6 // E.g. used for examples which use LED_BUILDIN for example output.
+#define _IR_TIMING_TEST_PIN 7
+
+# if defined(ARDUINO_AVR_PROMICRO) // Sparkfun Pro Micro is __AVR_ATmega32U4__ but has different external circuit
+// We have no built in LED at pin 13 -> reuse RX LED
+#undef LED_BUILTIN
+#define LED_BUILTIN LED_BUILTIN_RX
+# endif
+# endif // defined(__AVR_ATtiny25__)...
+
+#elif defined(ARDUINO_ARCH_RENESAS_UNO) // Uno R4
+// To be compatible with Uno R3.
+#define IR_RECEIVE_PIN 2
+#define IR_SEND_PIN 3
+#define TONE_PIN 4
+#define APPLICATION_PIN 5
+#define ALTERNATIVE_IR_FEEDBACK_LED_PIN 6 // E.g. used for examples which use LED_BUILDIN for example output.
+#define _IR_TIMING_TEST_PIN 7
+
+#elif defined(ESP8266)
+#define FEEDBACK_LED_IS_ACTIVE_LOW // The LED on my board (D4) is active LOW
+#define IR_RECEIVE_PIN 14 // D5
+#define IR_SEND_PIN 12 // D6 - D4/pin 2 is internal LED
+#define _IR_TIMING_TEST_PIN 2 // D4
+#define APPLICATION_PIN 13 // D7
+
+#define tone(...) void() // tone() inhibits receive timer
+#define noTone(a) void()
+#define TONE_PIN 42 // Dummy for examples using it#
+
+#elif defined(ARDUINO_NOLOGO_ESP32C3_SUPER_MINI)
+#define FEEDBACK_LED_IS_ACTIVE_LOW // The LED on my board (D8) is active LOW
+#define IR_RECEIVE_PIN 2
+#define IR_SEND_PIN 3
+#define TONE_PIN 4
+#define APPLICATION_PIN 10
+
+#elif defined(CONFIG_IDF_TARGET_ESP32C3) || defined(ARDUINO_ESP32C3_DEV)
+#define NO_LED_FEEDBACK_CODE // The WS2812 on pin 8 of AI-C3 board crashes if used as receive feedback LED, other I/O pins are working...
+#define IR_RECEIVE_PIN 6
+#define IR_SEND_PIN 7
+#define TONE_PIN 10
+#define APPLICATION_PIN 18
+
+#elif defined(ESP32)
+#include
+
+// tone() is included in ESP32 core since 2.0.2
+#if !defined(ESP_ARDUINO_VERSION_VAL)
+#define ESP_ARDUINO_VERSION_VAL(major, minor, patch) 12345678
+#endif
+#if ESP_ARDUINO_VERSION <= ESP_ARDUINO_VERSION_VAL(2, 0, 2)
+#define TONE_LEDC_CHANNEL 1 // Using channel 1 makes tone() independent of receiving timer -> No need to stop receiving timer.
+void tone(uint8_t aPinNumber, unsigned int aFrequency){
+ ledcAttachPin(aPinNumber, TONE_LEDC_CHANNEL);
+ ledcWriteTone(TONE_LEDC_CHANNEL, aFrequency);
+}
+void tone(uint8_t aPinNumber, unsigned int aFrequency, unsigned long aDuration){
+ ledcAttachPin(aPinNumber, TONE_LEDC_CHANNEL);
+ ledcWriteTone(TONE_LEDC_CHANNEL, aFrequency);
+ delay(aDuration);
+ ledcWriteTone(TONE_LEDC_CHANNEL, 0);
+}
+void noTone(uint8_t aPinNumber){
+ ledcWriteTone(TONE_LEDC_CHANNEL, 0);
+}
+#endif // ESP_ARDUINO_VERSION <= ESP_ARDUINO_VERSION_VAL(2, 0, 2)
+
+#define IR_RECEIVE_PIN 15 // D15
+#define IR_SEND_PIN 4 // D4
+#define TONE_PIN 27 // D27 25 & 26 are DAC0 and 1
+#define APPLICATION_PIN 16 // RX2 pin
+
+#elif defined(ARDUINO_ARCH_STM32) || defined(ARDUINO_ARCH_STM32F1) // BluePill
+// Timer 3 blocks PA6, PA7, PB0, PB1 for use by Servo or tone()
+#define IR_RECEIVE_PIN PA6
+#define IR_RECEIVE_PIN_STRING "PA6"
+#define IR_SEND_PIN PA7
+#define IR_SEND_PIN_STRING "PA7"
+#define TONE_PIN PA3
+#define _IR_TIMING_TEST_PIN PA5
+#define APPLICATION_PIN PA2
+#define APPLICATION_PIN_STRING "PA2"
+# if defined(ARDUINO_GENERIC_STM32F103C) || defined(ARDUINO_BLUEPILL_F103C8)
+// BluePill LED is active low
+#define FEEDBACK_LED_IS_ACTIVE_LOW
+# endif
+
+#elif defined(ARDUINO_ARCH_APOLLO3) // Sparkfun Apollo boards
+#define IR_RECEIVE_PIN 11
+#define IR_SEND_PIN 12
+#define TONE_PIN 5
+
+#elif defined(ARDUINO_ARCH_MBED) && defined(ARDUINO_ARCH_MBED_NANO) // Arduino Nano 33 BLE and Arduino Nano Connect layout for MBED
+// Must be before ARDUINO_ARCH_RP2040, since it is the layout for the MBED core of Arduino Nano Connect
+#define IR_RECEIVE_PIN 3 // GPIO15 Start with pin 3 since pin 2|GPIO25 is connected to LED on Pi pico
+#define IR_SEND_PIN 4 // GPIO16
+#define TONE_PIN 5
+#define APPLICATION_PIN 6
+#define ALTERNATIVE_IR_FEEDBACK_LED_PIN 7 // E.g. used for examples which use LED_BUILDIN for example output.
+#define _IR_TIMING_TEST_PIN 8
+
+#elif defined(ARDUINO_ARCH_RP2040) // Arduino Nano Connect, Pi Pico with arduino-pico core https://github.com/earlephilhower/arduino-pico
+#define IR_RECEIVE_PIN 15 // GPIO15 to be compatible with the Arduino Nano RP2040 Connect (pin3)
+#define IR_SEND_PIN 16 // GPIO16
+#define TONE_PIN 17
+#define APPLICATION_PIN 18
+#define ALTERNATIVE_IR_FEEDBACK_LED_PIN 19 // E.g. used for examples which use LED_BUILDIN for example output.
+#define _IR_TIMING_TEST_PIN 20
+
+// If you program the Nano RP2040 Connect with this core, then you must redefine LED_BUILTIN
+// and use the external reset with 1 kOhm to ground to enter UF2 mode
+#undef LED_BUILTIN
+#define LED_BUILTIN 6
+
+#elif defined(PARTICLE) // !!!UNTESTED!!!
+#define IR_RECEIVE_PIN A4
+#define IR_SEND_PIN A5 // Particle supports multiple pins
+
+#define LED_BUILTIN D7
+
+/*
+ * 4 times the same (default) layout for easy adaption in the future
+ */
+#elif defined(TEENSYDUINO) // Teensy 2.0 is handled at default for ATmega328 like on Uno, Nano, Leonardo etc.
+#define IR_RECEIVE_PIN 2
+#define IR_SEND_PIN 3
+#define TONE_PIN 4
+#define APPLICATION_PIN 5
+#define ALTERNATIVE_IR_FEEDBACK_LED_PIN 6 // E.g. used for examples which use LED_BUILDIN for example output.
+#define _IR_TIMING_TEST_PIN 7
+
+#elif defined(ARDUINO_ARCH_MBED) // Arduino Nano 33 BLE
+#define IR_RECEIVE_PIN 2
+#define IR_SEND_PIN 3
+#define TONE_PIN 4
+#define APPLICATION_PIN 5
+#define ALTERNATIVE_IR_FEEDBACK_LED_PIN 6 // E.g. used for examples which use LED_BUILDIN for example output.
+#define _IR_TIMING_TEST_PIN 7
+
+#elif defined(ARDUINO_ARCH_SAMD) || defined(ARDUINO_ARCH_SAM)
+#define IR_RECEIVE_PIN 2
+#define IR_SEND_PIN 3
+#define TONE_PIN 4
+#define APPLICATION_PIN 5
+#define ALTERNATIVE_IR_FEEDBACK_LED_PIN 6 // E.g. used for examples which use LED_BUILDIN for example output.
+#define _IR_TIMING_TEST_PIN 7
+
+#if !defined(ARDUINO_SAMD_ADAFRUIT) && !defined(ARDUINO_SEEED_XIAO_M0)
+// On the Zero and others we switch explicitly to SerialUSB
+#define Serial SerialUSB
+#endif
+
+// Definitions for the Chinese SAMD21 M0-Mini clone, which has no led connected to D13/PA17.
+// Attention!!! D2 and D4 are swapped on these boards!!!
+// If you connect the LED, it is on pin 24/PB11. In this case activate the next two lines.
+//#undef LED_BUILTIN
+//#define LED_BUILTIN 24 // PB11
+// As an alternative you can choose pin 25, it is the RX-LED pin (PB03), but active low.In this case activate the next 3 lines.
+//#undef LED_BUILTIN
+//#define LED_BUILTIN 25 // PB03
+//#define FEEDBACK_LED_IS_ACTIVE_LOW // The RX LED on the M0-Mini is active LOW
+
+#elif defined (NRF51) // BBC micro:bit
+#define IR_RECEIVE_PIN 2
+#define IR_SEND_PIN 3
+#define APPLICATION_PIN 1
+#define _IR_TIMING_TEST_PIN 4
+
+#define tone(...) void() // no tone() available
+#define noTone(a) void()
+#define TONE_PIN 42 // Dummy for examples using it
+
+#else
+#warning Board / CPU is not detected using pre-processor symbols -> using default values, which may not fit. Please extend PinDefinitionsAndMore.h.
+// Default valued for unidentified boards
+#define IR_RECEIVE_PIN 2
+#define IR_SEND_PIN 3
+#define TONE_PIN 4
+#define APPLICATION_PIN 5
+#define ALTERNATIVE_IR_FEEDBACK_LED_PIN 6 // E.g. used for examples which use LED_BUILDIN for example output.
+#define _IR_TIMING_TEST_PIN 7
+#endif // defined(ESP8266)
+
+#if defined(ESP32) || defined(ARDUINO_ARCH_RP2040) || defined(PARTICLE) || defined(ARDUINO_ARCH_MBED)
+#define SEND_PWM_BY_TIMER // We do not have pin restrictions for this CPU's, so lets use the hardware PWM for send carrier signal generation
+#else
+# if defined(SEND_PWM_BY_TIMER)
+#undef IR_SEND_PIN // SendPin is determined by timer! This avoids warnings in IRremote.hpp and IRTimer.hpp
+# endif
+#endif
+
+#if !defined (FLASHEND)
+#define FLASHEND 0xFFFF // Dummy value for platforms where FLASHEND is not defined
+#endif
+
+/*
+ * Helper macro for getting a macro definition as string
+ */
+#if !defined(STR_HELPER)
+#define STR_HELPER(x) #x
+#define STR(x) STR_HELPER(x)
+#endif
diff --git a/libraries/IRremote/examples/SendAndReceive/SendAndReceive.ino b/libraries/IRremote/examples/SendAndReceive/SendAndReceive.ino
new file mode 100644
index 0000000..68d43d8
--- /dev/null
+++ b/libraries/IRremote/examples/SendAndReceive/SendAndReceive.ino
@@ -0,0 +1,166 @@
+/*
+ * SendAndReceive.cpp
+ *
+ * Demonstrates sending IR codes and receiving it simultaneously
+ *
+ * This file is part of Arduino-IRremote https://github.com/Arduino-IRremote/Arduino-IRremote.
+ *
+ ************************************************************************************
+ * MIT License
+ *
+ * Copyright (c) 2021-2023 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.
+ *
+ ************************************************************************************
+ */
+
+#include
+
+// select only NEC and the universal decoder for pulse distance protocols
+#define DECODE_NEC // Includes Apple and Onkyo
+#define DECODE_DISTANCE_WIDTH // In case NEC is not received correctly. Universal decoder for pulse distance width protocols
+
+//#define EXCLUDE_UNIVERSAL_PROTOCOLS // Saves up to 1000 bytes program memory.
+//#define EXCLUDE_EXOTIC_PROTOCOLS // saves around 650 bytes program memory if all other protocols are active
+//#define NO_LED_FEEDBACK_CODE // saves 92 bytes program memory
+//#define RECORD_GAP_MICROS 12000 // Default is 8000. Activate it for some LG air conditioner protocols
+#define SEND_PWM_BY_TIMER // Disable carrier PWM generation in software and use (restricted) hardware PWM.
+//#define USE_NO_SEND_PWM // Use no carrier PWM, just simulate an active low receiver signal. Overrides SEND_PWM_BY_TIMER definition
+
+//#define DEBUG // Activate this for lots of lovely debug output from the decoders.
+
+#define IR_RECEIVE_PIN 4
+#ifndef IR_SEND_PIN
+#define IR_SEND_PIN 3 // P0_0
+#endif
+
+/*
+ * Helper macro for getting a macro definition as string
+ */
+#if !defined(STR_HELPER)
+#define STR_HELPER(x) #x
+#define STR(x) STR_HELPER(x)
+#endif
+
+#include
+
+#define DELAY_AFTER_SEND 2000
+#define DELAY_AFTER_LOOP 5000
+
+void setup() {
+ Serial.begin(9600);
+ while (!Serial)
+ ; // Wait for Serial to become available. Is optimized away for some cores.
+
+ // Just to know which program is running on my Arduino
+ Serial.println(F("START " __FILE__ " from " __DATE__ "\r\nUsing library version " VERSION_IRREMOTE));
+
+ // Start the receiver and if not 3. parameter specified, take LED_BUILTIN pin from the internal boards definition as default feedback LED
+ IrReceiver.begin(IR_RECEIVE_PIN, ENABLE_LED_FEEDBACK);
+
+ Serial.print(F("Ready to receive IR signals of protocols: "));
+ printActiveIRProtocols(&Serial);
+ Serial.println(F("at pin " STR(IR_RECEIVE_PIN)));
+ IrSender.begin(); // Start with IR_SEND_PIN as send pin and enable feedback LED at default feedback LED pin
+ Serial.println(F("Send IR signals at pin " STR(IR_SEND_PIN)));
+
+# if !defined(SEND_PWM_BY_TIMER) && !defined(USE_NO_SEND_PWM)
+ /*
+ * Print internal software PWM generation info
+ */
+ IrSender.enableIROut(38); // Call it with 38 kHz to initialize the values printed below
+ Serial.print(F("Send signal mark duration is "));
+ Serial.print(IrSender.periodOnTimeMicros);
+ Serial.print(F(" us, pulse correction is "));
+ Serial.print(IrSender.getPulseCorrectionNanos());
+ Serial.print(F(" ns, total period is "));
+ Serial.print(IrSender.periodTimeMicros);
+ Serial.println(F(" us"));
+# endif
+
+ // infos for receive
+ Serial.print(RECORD_GAP_MICROS);
+ Serial.println(F(" us is the (minimum) gap, after which the start of a new IR packet is assumed"));
+ Serial.print(MARK_EXCESS_MICROS);
+ Serial.println(F(" us are subtracted from all marks and added to all spaces for decoding"));
+}
+
+uint16_t sAddress = 0x0102;
+uint8_t sCommand = 0x34;
+uint8_t sRepeats = 1;
+
+/*
+ * Send NEC IR protocol
+ */
+void send_ir_data() {
+ Serial.print(F("Sending: 0x"));
+ Serial.print(sAddress, HEX);
+ Serial.print(sCommand, HEX);
+ Serial.println(sRepeats, HEX);
+ Serial.flush(); // To avoid disturbing the software PWM generation by serial output interrupts
+
+ // clip repeats at 4
+ if (sRepeats > 4) {
+ sRepeats = 4;
+ }
+ // Results for the first loop to: Protocol=NEC Address=0x102 Command=0x34 Raw-Data=0xCB340102 (32 bits)
+ IrSender.sendNEC(sAddress, sCommand, sRepeats);
+}
+
+void receive_ir_data() {
+ if (IrReceiver.decode()) {
+ Serial.print(F("Decoded protocol: "));
+ Serial.print(getProtocolString(IrReceiver.decodedIRData.protocol));
+ Serial.print(F(", decoded raw data: "));
+ Serial.print(IrReceiver.decodedIRData.decodedRawData, HEX);
+ Serial.print(F(", decoded address: "));
+ Serial.print(IrReceiver.decodedIRData.address, HEX);
+ Serial.print(F(", decoded command: "));
+ Serial.println(IrReceiver.decodedIRData.command, HEX);
+ IrReceiver.resume();
+ }
+}
+
+void loop() {
+ /*
+ * Print loop values
+ */
+ Serial.println();
+ Serial.print(F("address=0x"));
+ Serial.print(sAddress, HEX);
+ Serial.print(F(" command=0x"));
+ Serial.print(sCommand, HEX);
+ Serial.print(F(" repeats="));
+ Serial.println(sRepeats);
+ Serial.flush();
+
+ send_ir_data();
+ IrReceiver.restartAfterSend(); // Is a NOP if sending does not require a timer.
+
+ // wait for the receiver state machine to detect the end of a protocol
+ delay((RECORD_GAP_MICROS / 1000) + 5);
+ receive_ir_data();
+
+ // Prepare data for next loop
+ sAddress += 0x0101;
+ sCommand += 0x11;
+ sRepeats++;
+
+ delay(500); // Loop delay
+}
diff --git a/libraries/IRremote/examples/SendAndReceive/SendAndReceive.log b/libraries/IRremote/examples/SendAndReceive/SendAndReceive.log
new file mode 100644
index 0000000..ec6dc73
--- /dev/null
+++ b/libraries/IRremote/examples/SendAndReceive/SendAndReceive.log
@@ -0,0 +1,39 @@
+START ../src/SendAndReceive.cpp from Feb 24 2023
+Using library version 4.1.0
+Ready to receive IR signals of protocols: NEC/NEC2/Onkyo/Apple, Universal Pulse Distance Width, at pin 2
+Send IR signals at pin 3
+Send signal mark duration is 8 us, pulse correction is 3000 ns, total period is 26 us
+5000 us is the (minimum) gap, after which the start of a new IR packet is assumed
+20 us are subtracted from all marks and added to all spaces for decoding
+
+address=0x102 command=0x34 repeats=1
+Sending: 0x102341
+Decoded protocol: NEC2, decoded raw data: CB340102, decoded address: 102, decoded command: 34
+
+address=0x203 command=0x45 repeats=2
+Sending: 0x203452
+Decoded protocol: NEC, decoded raw data: BA450203, decoded address: 203, decoded command: 45
+
+address=0x304 command=0x56 repeats=3
+Sending: 0x304563
+Decoded protocol: NEC, decoded raw data: A9560304, decoded address: 304, decoded command: 56
+
+address=0x405 command=0x67 repeats=4
+Sending: 0x405674
+Decoded protocol: NEC, decoded raw data: 98670405, decoded address: 405, decoded command: 67
+
+address=0x506 command=0x78 repeats=5
+Sending: 0x506785
+Decoded protocol: NEC, decoded raw data: 87780506, decoded address: 506, decoded command: 78
+
+address=0x607 command=0x89 repeats=5
+Sending: 0x607895
+Decoded protocol: NEC, decoded raw data: 76890607, decoded address: 607, decoded command: 89
+
+address=0x708 command=0x9A repeats=5
+Sending: 0x7089A5
+Decoded protocol: NEC, decoded raw data: 659A0708, decoded address: 708, decoded command: 9A
+
+address=0x809 command=0xAB repeats=5
+Sending: 0x809AB5
+Decoded protocol: NEC, decoded raw data: 54AB0809, decoded address: 809, decoded command: AB
diff --git a/libraries/IRremote/examples/SendBoseWaveDemo/PinDefinitionsAndMore.h b/libraries/IRremote/examples/SendBoseWaveDemo/PinDefinitionsAndMore.h
new file mode 100644
index 0000000..14573c7
--- /dev/null
+++ b/libraries/IRremote/examples/SendBoseWaveDemo/PinDefinitionsAndMore.h
@@ -0,0 +1,349 @@
+/*
+ * PinDefinitionsAndMore.h
+ *
+ * Contains pin definitions for IRremote examples for various platforms
+ * as well as definitions for feedback LED and tone() and includes
+ *
+ * Copyright (C) 2021-2023 Armin Joachimsmeyer
+ * armin.joachimsmeyer@gmail.com
+ *
+ * This file is part of IRremote https://github.com/Arduino-IRremote/Arduino-IRremote.
+ *
+ * Arduino-IRremote is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
+ * See the GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see .
+ *
+ */
+
+/*
+ * Pin mapping table for different platforms
+ *
+ * Platform IR input IR output Tone Core/Pin schema
+ * --------------------------------------------------------------
+ * DEFAULT/AVR 2 3 4 Arduino
+ * ATtinyX5 0|PB0 4|PB4 3|PB3 ATTinyCore
+ * ATtiny167 3|PA3 2|PA2 7|PA7 ATTinyCore
+ * ATtiny167 9|PA3 8|PA2 5|PA7 Digispark original core
+ * ATtiny84 |PB2 |PA4 |PA3 ATTinyCore
+ * ATtiny88 3|PD3 4|PD4 9|PB1 ATTinyCore
+ * ATtiny3217 18|PA1 19|PA2 20|PA3 MegaTinyCore
+ * ATtiny1604 2 3|PA5 %
+ * ATtiny816 14|PA1 16|PA3 1|PA5 MegaTinyCore
+ * ATtiny1614 8|PA1 10|PA3 1|PA5 MegaTinyCore
+ * SAMD21 3 4 5
+ * ESP8266 14|D5 12|D6 %
+ * ESP32 15 4 27
+ * ESP32-C3 2 3 4
+ * BluePill PA6 PA7 PA3
+ * APOLLO3 11 12 5
+ * RP2040 3|GPIO15 4|GPIO16 5|GPIO17
+ */
+//#define _IR_MEASURE_TIMING // For debugging purposes.
+
+#if defined(__AVR__)
+#if defined(__AVR_ATtiny25__) || defined(__AVR_ATtiny45__) || defined(__AVR_ATtiny85__) // Digispark board. For use with ATTinyCore.
+#include "ATtinySerialOut.hpp" // TX is at pin 2 - Available as Arduino library "ATtinySerialOut". Saves 700 bytes program memory and 70 bytes RAM for ATtinyCore.
+#define IR_RECEIVE_PIN PIN_PB0
+#define IR_SEND_PIN PIN_PB4 // Pin 2 is serial output with ATtinySerialOut. Pin 1 is internal LED and Pin3 is USB+ with pullup on Digispark board.
+#define TONE_PIN PIN_PB3
+#define _IR_TIMING_TEST_PIN PIN_PB3
+
+# elif defined(__AVR_ATtiny87__) || defined(__AVR_ATtiny167__) // Digispark pro board
+#include "ATtinySerialOut.hpp" // Available as Arduino library "ATtinySerialOut"
+// For ATtiny167 Pins PB6 and PA3 are usable as interrupt source.
+# if defined(ARDUINO_AVR_DIGISPARKPRO)
+// For use with Digispark original core
+#define IR_RECEIVE_PIN 9 // PA3 - on Digispark board labeled as pin 9
+//#define IR_RECEIVE_PIN 14 // PB6 / INT0 is connected to USB+ on DigisparkPro boards
+#define IR_SEND_PIN 8 // PA2 - on Digispark board labeled as pin 8
+#define TONE_PIN 5 // PA7 - on Digispark board labeled as pin 5
+#define _IR_TIMING_TEST_PIN 10 // PA4
+# else
+// For use with ATTinyCore
+#define IR_RECEIVE_PIN PIN_PA3 // On Digispark board labeled as pin 9 - INT0 is connected to USB+ on DigisparkPro boards
+#define IR_SEND_PIN PIN_PA2 // On Digispark board labeled as pin 8
+#define TONE_PIN PIN_PA7 // On Digispark board labeled as pin 5
+# endif
+
+# elif defined(__AVR_ATtiny84__) // For use with ATTinyCore
+#include "ATtinySerialOut.hpp" // Available as Arduino library "ATtinySerialOut". Saves 128 bytes program memory.
+#define IR_RECEIVE_PIN PIN_PB2 // INT0
+#define IR_SEND_PIN PIN_PA4
+#define TONE_PIN PIN_PA3
+#define _IR_TIMING_TEST_PIN PIN_PA5
+
+# elif defined(__AVR_ATtiny88__) // MH-ET Tiny88 board. For use with ATTinyCore.
+#include "ATtinySerialOut.hpp" // Available as Arduino library "ATtinySerialOut". Saves 128 bytes program memory.
+// Pin 6 is TX, pin 7 is RX
+#define IR_RECEIVE_PIN PIN_PD3 // 3 - INT1
+#define IR_SEND_PIN PIN_PD4 // 4
+#define TONE_PIN PIN_PB1 // 9
+#define _IR_TIMING_TEST_PIN PIN_PB0 // 8
+
+# elif defined(__AVR_ATtiny1616__) || defined(__AVR_ATtiny3216__) || defined(__AVR_ATtiny3217__) // For use with megaTinyCore
+// Tiny Core Dev board
+// https://www.tindie.com/products/xkimi/tiny-core-16-dev-board-attiny1616/ - Out of Stock
+// https://www.tindie.com/products/xkimi/tiny-core-32-dev-board-attiny3217/ - Out of Stock
+#define IR_RECEIVE_PIN PIN_PA1 // use 18 instead of PIN_PA1 for TinyCore32
+#define IR_SEND_PIN PIN_PA2 // 19
+#define TONE_PIN PIN_PA3 // 20
+#define APPLICATION_PIN PIN_PA0 // 0
+#undef LED_BUILTIN // No LED available on the TinyCore 32 board, take the one on the programming board which is connected to the DAC output
+#define LED_BUILTIN PIN_PA6 // use 2 instead of PIN_PA6 for TinyCore32
+
+# elif defined(__AVR_ATtiny816__) // For use with megaTinyCore
+#define IR_RECEIVE_PIN PIN_PA1 // 14
+#define IR_SEND_PIN PIN_PA1 // 16
+#define TONE_PIN PIN_PA5 // 1
+#define APPLICATION_PIN PIN_PA4 // 0
+#undef LED_BUILTIN // No LED available, take the one which is connected to the DAC output
+#define LED_BUILTIN PIN_PB5 // 4
+
+# elif defined(__AVR_ATtiny1614__) // For use with megaTinyCore
+#define IR_RECEIVE_PIN PIN_PA1 // 8
+#define IR_SEND_PIN PIN_PA3 // 10
+#define TONE_PIN PIN_PA5 // 1
+#define APPLICATION_PIN PIN_PA4 // 0
+
+# elif defined(__AVR_ATtiny1604__) // For use with megaTinyCore
+#define IR_RECEIVE_PIN PIN_PA6 // 2 - To be compatible with interrupt example, pin 2 is chosen here.
+#define IR_SEND_PIN PIN_PA7 // 3
+#define APPLICATION_PIN PIN_PB2 // 5
+
+#define tone(...) void() // Define as void, since TCB0_INT_vect is also used by tone()
+#define noTone(a) void()
+#define TONE_PIN 42 // Dummy for examples using it
+
+# elif defined(__AVR_ATmega1284__) || defined(__AVR_ATmega1284P__) \
+|| defined(__AVR_ATmega644__) || defined(__AVR_ATmega644P__) \
+|| defined(__AVR_ATmega324P__) || defined(__AVR_ATmega324A__) \
+|| defined(__AVR_ATmega324PA__) || defined(__AVR_ATmega164A__) \
+|| defined(__AVR_ATmega164P__) || defined(__AVR_ATmega32__) \
+|| defined(__AVR_ATmega16__) || defined(__AVR_ATmega8535__) \
+|| defined(__AVR_ATmega64__) || defined(__AVR_ATmega128__) \
+|| defined(__AVR_ATmega1281__) || defined(__AVR_ATmega2561__) \
+|| defined(__AVR_ATmega8515__) || defined(__AVR_ATmega162__)
+#define IR_RECEIVE_PIN 2
+#define IR_SEND_PIN 13
+#define TONE_PIN 4
+#define APPLICATION_PIN 5
+#define ALTERNATIVE_IR_FEEDBACK_LED_PIN 6 // E.g. used for examples which use LED_BUILDIN for example output.
+#define _IR_TIMING_TEST_PIN 7
+
+# else // Default as for ATmega328 like on Uno, Nano, Leonardo, Teensy 2.0 etc.
+#define IR_RECEIVE_PIN 2 // To be compatible with interrupt example, pin 2 is chosen here.
+#define IR_SEND_PIN 3
+#define TONE_PIN 4
+#define APPLICATION_PIN 5
+#define ALTERNATIVE_IR_FEEDBACK_LED_PIN 6 // E.g. used for examples which use LED_BUILDIN for example output.
+#define _IR_TIMING_TEST_PIN 7
+
+# if defined(ARDUINO_AVR_PROMICRO) // Sparkfun Pro Micro is __AVR_ATmega32U4__ but has different external circuit
+// We have no built in LED at pin 13 -> reuse RX LED
+#undef LED_BUILTIN
+#define LED_BUILTIN LED_BUILTIN_RX
+# endif
+# endif // defined(__AVR_ATtiny25__)...
+
+#elif defined(ARDUINO_ARCH_RENESAS_UNO) // Uno R4
+// To be compatible with Uno R3.
+#define IR_RECEIVE_PIN 2
+#define IR_SEND_PIN 3
+#define TONE_PIN 4
+#define APPLICATION_PIN 5
+#define ALTERNATIVE_IR_FEEDBACK_LED_PIN 6 // E.g. used for examples which use LED_BUILDIN for example output.
+#define _IR_TIMING_TEST_PIN 7
+
+#elif defined(ESP8266)
+#define FEEDBACK_LED_IS_ACTIVE_LOW // The LED on my board (D4) is active LOW
+#define IR_RECEIVE_PIN 14 // D5
+#define IR_SEND_PIN 12 // D6 - D4/pin 2 is internal LED
+#define _IR_TIMING_TEST_PIN 2 // D4
+#define APPLICATION_PIN 13 // D7
+
+#define tone(...) void() // tone() inhibits receive timer
+#define noTone(a) void()
+#define TONE_PIN 42 // Dummy for examples using it#
+
+#elif defined(ARDUINO_NOLOGO_ESP32C3_SUPER_MINI)
+#define FEEDBACK_LED_IS_ACTIVE_LOW // The LED on my board (D8) is active LOW
+#define IR_RECEIVE_PIN 2
+#define IR_SEND_PIN 3
+#define TONE_PIN 4
+#define APPLICATION_PIN 10
+
+#elif defined(CONFIG_IDF_TARGET_ESP32C3) || defined(ARDUINO_ESP32C3_DEV)
+#define NO_LED_FEEDBACK_CODE // The WS2812 on pin 8 of AI-C3 board crashes if used as receive feedback LED, other I/O pins are working...
+#define IR_RECEIVE_PIN 6
+#define IR_SEND_PIN 7
+#define TONE_PIN 10
+#define APPLICATION_PIN 18
+
+#elif defined(ESP32)
+#include
+
+// tone() is included in ESP32 core since 2.0.2
+#if !defined(ESP_ARDUINO_VERSION_VAL)
+#define ESP_ARDUINO_VERSION_VAL(major, minor, patch) 12345678
+#endif
+#if ESP_ARDUINO_VERSION <= ESP_ARDUINO_VERSION_VAL(2, 0, 2)
+#define TONE_LEDC_CHANNEL 1 // Using channel 1 makes tone() independent of receiving timer -> No need to stop receiving timer.
+void tone(uint8_t aPinNumber, unsigned int aFrequency){
+ ledcAttachPin(aPinNumber, TONE_LEDC_CHANNEL);
+ ledcWriteTone(TONE_LEDC_CHANNEL, aFrequency);
+}
+void tone(uint8_t aPinNumber, unsigned int aFrequency, unsigned long aDuration){
+ ledcAttachPin(aPinNumber, TONE_LEDC_CHANNEL);
+ ledcWriteTone(TONE_LEDC_CHANNEL, aFrequency);
+ delay(aDuration);
+ ledcWriteTone(TONE_LEDC_CHANNEL, 0);
+}
+void noTone(uint8_t aPinNumber){
+ ledcWriteTone(TONE_LEDC_CHANNEL, 0);
+}
+#endif // ESP_ARDUINO_VERSION <= ESP_ARDUINO_VERSION_VAL(2, 0, 2)
+
+#define IR_RECEIVE_PIN 15 // D15
+#define IR_SEND_PIN 4 // D4
+#define TONE_PIN 27 // D27 25 & 26 are DAC0 and 1
+#define APPLICATION_PIN 16 // RX2 pin
+
+#elif defined(ARDUINO_ARCH_STM32) || defined(ARDUINO_ARCH_STM32F1) // BluePill
+// Timer 3 blocks PA6, PA7, PB0, PB1 for use by Servo or tone()
+#define IR_RECEIVE_PIN PA6
+#define IR_RECEIVE_PIN_STRING "PA6"
+#define IR_SEND_PIN PA7
+#define IR_SEND_PIN_STRING "PA7"
+#define TONE_PIN PA3
+#define _IR_TIMING_TEST_PIN PA5
+#define APPLICATION_PIN PA2
+#define APPLICATION_PIN_STRING "PA2"
+# if defined(ARDUINO_GENERIC_STM32F103C) || defined(ARDUINO_BLUEPILL_F103C8)
+// BluePill LED is active low
+#define FEEDBACK_LED_IS_ACTIVE_LOW
+# endif
+
+#elif defined(ARDUINO_ARCH_APOLLO3) // Sparkfun Apollo boards
+#define IR_RECEIVE_PIN 11
+#define IR_SEND_PIN 12
+#define TONE_PIN 5
+
+#elif defined(ARDUINO_ARCH_MBED) && defined(ARDUINO_ARCH_MBED_NANO) // Arduino Nano 33 BLE and Arduino Nano Connect layout for MBED
+// Must be before ARDUINO_ARCH_RP2040, since it is the layout for the MBED core of Arduino Nano Connect
+#define IR_RECEIVE_PIN 3 // GPIO15 Start with pin 3 since pin 2|GPIO25 is connected to LED on Pi pico
+#define IR_SEND_PIN 4 // GPIO16
+#define TONE_PIN 5
+#define APPLICATION_PIN 6
+#define ALTERNATIVE_IR_FEEDBACK_LED_PIN 7 // E.g. used for examples which use LED_BUILDIN for example output.
+#define _IR_TIMING_TEST_PIN 8
+
+#elif defined(ARDUINO_ARCH_RP2040) // Arduino Nano Connect, Pi Pico with arduino-pico core https://github.com/earlephilhower/arduino-pico
+#define IR_RECEIVE_PIN 15 // GPIO15 to be compatible with the Arduino Nano RP2040 Connect (pin3)
+#define IR_SEND_PIN 16 // GPIO16
+#define TONE_PIN 17
+#define APPLICATION_PIN 18
+#define ALTERNATIVE_IR_FEEDBACK_LED_PIN 19 // E.g. used for examples which use LED_BUILDIN for example output.
+#define _IR_TIMING_TEST_PIN 20
+
+// If you program the Nano RP2040 Connect with this core, then you must redefine LED_BUILTIN
+// and use the external reset with 1 kOhm to ground to enter UF2 mode
+#undef LED_BUILTIN
+#define LED_BUILTIN 6
+
+#elif defined(PARTICLE) // !!!UNTESTED!!!
+#define IR_RECEIVE_PIN A4
+#define IR_SEND_PIN A5 // Particle supports multiple pins
+
+#define LED_BUILTIN D7
+
+/*
+ * 4 times the same (default) layout for easy adaption in the future
+ */
+#elif defined(TEENSYDUINO) // Teensy 2.0 is handled at default for ATmega328 like on Uno, Nano, Leonardo etc.
+#define IR_RECEIVE_PIN 2
+#define IR_SEND_PIN 3
+#define TONE_PIN 4
+#define APPLICATION_PIN 5
+#define ALTERNATIVE_IR_FEEDBACK_LED_PIN 6 // E.g. used for examples which use LED_BUILDIN for example output.
+#define _IR_TIMING_TEST_PIN 7
+
+#elif defined(ARDUINO_ARCH_MBED) // Arduino Nano 33 BLE
+#define IR_RECEIVE_PIN 2
+#define IR_SEND_PIN 3
+#define TONE_PIN 4
+#define APPLICATION_PIN 5
+#define ALTERNATIVE_IR_FEEDBACK_LED_PIN 6 // E.g. used for examples which use LED_BUILDIN for example output.
+#define _IR_TIMING_TEST_PIN 7
+
+#elif defined(ARDUINO_ARCH_SAMD) || defined(ARDUINO_ARCH_SAM)
+#define IR_RECEIVE_PIN 2
+#define IR_SEND_PIN 3
+#define TONE_PIN 4
+#define APPLICATION_PIN 5
+#define ALTERNATIVE_IR_FEEDBACK_LED_PIN 6 // E.g. used for examples which use LED_BUILDIN for example output.
+#define _IR_TIMING_TEST_PIN 7
+
+#if !defined(ARDUINO_SAMD_ADAFRUIT) && !defined(ARDUINO_SEEED_XIAO_M0)
+// On the Zero and others we switch explicitly to SerialUSB
+#define Serial SerialUSB
+#endif
+
+// Definitions for the Chinese SAMD21 M0-Mini clone, which has no led connected to D13/PA17.
+// Attention!!! D2 and D4 are swapped on these boards!!!
+// If you connect the LED, it is on pin 24/PB11. In this case activate the next two lines.
+//#undef LED_BUILTIN
+//#define LED_BUILTIN 24 // PB11
+// As an alternative you can choose pin 25, it is the RX-LED pin (PB03), but active low.In this case activate the next 3 lines.
+//#undef LED_BUILTIN
+//#define LED_BUILTIN 25 // PB03
+//#define FEEDBACK_LED_IS_ACTIVE_LOW // The RX LED on the M0-Mini is active LOW
+
+#elif defined (NRF51) // BBC micro:bit
+#define IR_RECEIVE_PIN 2
+#define IR_SEND_PIN 3
+#define APPLICATION_PIN 1
+#define _IR_TIMING_TEST_PIN 4
+
+#define tone(...) void() // no tone() available
+#define noTone(a) void()
+#define TONE_PIN 42 // Dummy for examples using it
+
+#else
+#warning Board / CPU is not detected using pre-processor symbols -> using default values, which may not fit. Please extend PinDefinitionsAndMore.h.
+// Default valued for unidentified boards
+#define IR_RECEIVE_PIN 2
+#define IR_SEND_PIN 3
+#define TONE_PIN 4
+#define APPLICATION_PIN 5
+#define ALTERNATIVE_IR_FEEDBACK_LED_PIN 6 // E.g. used for examples which use LED_BUILDIN for example output.
+#define _IR_TIMING_TEST_PIN 7
+#endif // defined(ESP8266)
+
+#if defined(ESP32) || defined(ARDUINO_ARCH_RP2040) || defined(PARTICLE) || defined(ARDUINO_ARCH_MBED)
+#define SEND_PWM_BY_TIMER // We do not have pin restrictions for this CPU's, so lets use the hardware PWM for send carrier signal generation
+#else
+# if defined(SEND_PWM_BY_TIMER)
+#undef IR_SEND_PIN // SendPin is determined by timer! This avoids warnings in IRremote.hpp and IRTimer.hpp
+# endif
+#endif
+
+#if !defined (FLASHEND)
+#define FLASHEND 0xFFFF // Dummy value for platforms where FLASHEND is not defined
+#endif
+
+/*
+ * Helper macro for getting a macro definition as string
+ */
+#if !defined(STR_HELPER)
+#define STR_HELPER(x) #x
+#define STR(x) STR_HELPER(x)
+#endif
diff --git a/libraries/IRremote/examples/SendBoseWaveDemo/SendBoseWaveDemo.ino b/libraries/IRremote/examples/SendBoseWaveDemo/SendBoseWaveDemo.ino
new file mode 100644
index 0000000..77ca234
--- /dev/null
+++ b/libraries/IRremote/examples/SendBoseWaveDemo/SendBoseWaveDemo.ino
@@ -0,0 +1,217 @@
+/*
+ * SendBoseWaveDemo.cpp
+ *
+ * Prompt user for a code to send. Make sure your 940-950nm IR LED is
+ * connected to the default digital output. Place your Bose Wave Radio
+ * CD in the line of sight of your LED, and send commands!
+ *
+ * This file is part of Arduino-IRremote https://github.com/Arduino-IRremote/Arduino-IRremote.
+ *
+ ************************************************************************************
+ * MIT License
+ *
+ * Copyright (c) 2020 Thomas Koch - 2022 AJ converted to inverted bits
+ *
+ * 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.
+ *
+ ************************************************************************************
+ */
+#include
+
+/*
+ * Helper macro for getting a macro definition as string
+ */
+#if !defined(STR_HELPER)
+#define STR_HELPER(x) #x
+#define STR(x) STR_HELPER(x)
+#endif
+
+#if !defined(IR_SEND_PIN)
+#define IR_SEND_PIN 3 // P0_0
+#endif
+
+#include
+
+
+
+//......................................................................
+//
+// Bose Wave Radio CD Remote Control
+// |-------------------------------------|
+// | On/Off Sleep VolUp |
+// | Play/Pause Stop VolDown |
+// | FM AM Aux |
+// | Tune Down Tune Up Mute |
+// | 1 2 3 |
+// | 4 5 6 |
+// |-------------------------------------|
+#define BOSE_CMD_ON_OFF 0x00
+#define BOSE_CMD_MUTE 0x01
+#define BOSE_CMD_VOL_UP 0x02
+#define BOSE_CMD_VOL_DOWN 0x03
+#define BOSE_CMD_PRESET_6 0x04
+#define BOSE_CMD_SLEEP 0x05
+#define BOSE_CMD_FM 0x06
+#define BOSE_CMD_AUX 0x07
+#define BOSE_CMD_AM 0x08
+#define BOSE_CMD_PLAY_PAUSE 0x09
+#define BOSE_CMD_STOP 0x0A
+#define BOSE_CMD_TUNE_UP 0x0B
+#define BOSE_CMD_TUNE_DOWN 0x0C
+#define BOSE_CMD_PRESET_1 0x0D
+#define BOSE_CMD_PRESET_2 0x0E
+#define BOSE_CMD_PRESET_3 0x0F
+#define BOSE_CMD_PRESET_4 0x10
+#define BOSE_CMD_PRESET_5 0x11
+
+// Codes for Wave Music System
+// https://github.com/Arduino-IRremote/Arduino-IRremote/blob/master/pictures/BoseWaveMusicSystem.jpg)
+//#define BOSE_CMD_ON_OFF 0x4C
+//#define BOSE_CMD_MUTE 0x01
+//#define BOSE_CMD_VOL_UP 0x03
+//#define BOSE_CMD_VOL_DOWN 0x02
+//#define BOSE_CMD_SLEEP 0x54
+//#define BOSE_CMD_FM_AM 0x06
+//#define BOSE_CMD_CD 0x53
+//#define BOSE_CMD_AUX 0x0F
+//#define BOSE_CMD_TRACK_BW 0x18
+//#define BOSE_CMD_TRACK_FW 0x19
+//#define BOSE_CMD_PLAY_PAUSE 0x1B
+//#define BOSE_CMD_STOP_EJECT 0x1A
+//#define BOSE_CMD_TUNE_UP 0x58
+//#define BOSE_CMD_TUNE_DOWN 0x57
+//#define BOSE_CMD_PRESET_1 0x07
+//#define BOSE_CMD_PRESET_2 0x08
+//#define BOSE_CMD_PRESET_3 0x09
+//#define BOSE_CMD_PRESET_4 0x0A
+//#define BOSE_CMD_PRESET_5 0x0B
+//#define BOSE_CMD_PRESET_6 0x0C
+//#define BOSE_CMD_TIME_MINUS 0x9E
+//#define BOSE_CMD_TIME_PLUS 0x24
+//#define BOSE_CMD_PLAY_MODE 0x21
+//#define BOSE_CMD_ALARM_ON_OFF 0x22
+//#define BOSE_CMD_ALARM_WAKE_TO 0x70
+//#define BOSE_CMD_ALARM_TIME 0x23
+// Different last 3 codes for Wave Sound Touch IV
+//#define BOSE_CMD_ALARM_1 0x22
+//#define BOSE_CMD_ALARM_2 0x62
+//#define BOSE_CMD_ALARM_SETUP 0xA2
+
+bool sPrintMenu;
+void printMenu();
+
+void setup() {
+ pinMode(LED_BUILTIN, OUTPUT);
+
+ Serial.begin(9600);
+ while (!Serial)
+ ; // Wait for Serial to become available. Is optimized away for some cores.
+
+ // Just to know which program is running on my Arduino
+ Serial.println(F("START " __FILE__ " from " __DATE__ "\r\nUsing library version " VERSION_IRREMOTE));
+
+#if defined(IR_SEND_PIN)
+ IrSender.begin(); // Start with IR_SEND_PIN as send pin and enable feedback LED at default feedback LED pin
+ Serial.println(F("Send IR signals at pin " STR(IR_SEND_PIN)));
+#else
+ uint8_t tSendPin = 3;
+ IrSender.begin(tSendPin, ENABLE_LED_FEEDBACK, USE_DEFAULT_FEEDBACK_LED_PIN); // Specify send pin and enable feedback LED at default feedback LED pin
+ // You can change send pin later with IrSender.setSendPin();
+
+ Serial.print(F("Send IR signals at pin "));
+ Serial.println(tSendPin);
+#endif
+
+ sPrintMenu = true;
+}
+
+void loop() {
+ if (sPrintMenu) {
+ sPrintMenu = false;
+ printMenu();
+ }
+ int tSerialCommandCharacter;
+
+ if (Serial.available()) {
+ tSerialCommandCharacter = Serial.read();
+ sPrintMenu = true;
+ if (tSerialCommandCharacter == -1) {
+ Serial.print(F("available() was true, but no character read")); // should not happen
+ } else if (tSerialCommandCharacter == 48) { // 0
+ IrSender.sendBoseWave(BOSE_CMD_ON_OFF); // On/Off
+ } else if (tSerialCommandCharacter == 49) { // 1
+ IrSender.sendBoseWave(BOSE_CMD_VOL_UP); // Volume Up
+ } else if (tSerialCommandCharacter == 50) { // 2
+ IrSender.sendBoseWave(BOSE_CMD_VOL_DOWN); // Volume Down
+ } else if (tSerialCommandCharacter == 51) { // 3
+ IrSender.sendBoseWave(BOSE_CMD_TUNE_UP); // Tune Up
+ } else if (tSerialCommandCharacter == 52) { // 4
+ IrSender.sendBoseWave(BOSE_CMD_TUNE_DOWN); // Tune Down
+ } else if (tSerialCommandCharacter == 53) { // 5
+ IrSender.sendBoseWave(BOSE_CMD_AM); // AM
+ } else if (tSerialCommandCharacter == 54) { // 6
+ IrSender.sendBoseWave(BOSE_CMD_FM); // FM
+ } else if (tSerialCommandCharacter == 55) { // 7
+ IrSender.sendBoseWave(BOSE_CMD_PRESET_1); // Preset 1
+ } else if (tSerialCommandCharacter == 56) { // 8
+ IrSender.sendBoseWave(BOSE_CMD_PRESET_2); // Preset 2
+ } else if (tSerialCommandCharacter == 57) { // 9
+ IrSender.sendBoseWave(BOSE_CMD_PRESET_3); // Preset 3
+ } else if (tSerialCommandCharacter == 97) { // a
+ IrSender.sendBoseWave(BOSE_CMD_PRESET_4); // Preset 4
+ } else if (tSerialCommandCharacter == 98) { // b
+ IrSender.sendBoseWave(BOSE_CMD_PRESET_5); // Preset 5
+ } else if (tSerialCommandCharacter == 99) { // c
+ IrSender.sendBoseWave(BOSE_CMD_PRESET_6); // Preset 6
+ } else if (tSerialCommandCharacter == 100) { // d
+ IrSender.sendBoseWave(BOSE_CMD_MUTE); // Mute
+ } else if (tSerialCommandCharacter == 101) { // e
+ IrSender.sendBoseWave(BOSE_CMD_PLAY_PAUSE); // Pause
+ } else if (tSerialCommandCharacter == 102) { // f
+ IrSender.sendBoseWave(BOSE_CMD_STOP); // Stop
+ } else if (tSerialCommandCharacter == 103) { // g
+ IrSender.sendBoseWave(BOSE_CMD_AUX); // Aux
+ } else if (tSerialCommandCharacter == 104) { // h
+ IrSender.sendBoseWave(BOSE_CMD_SLEEP); // Sleep
+ } else {
+ sPrintMenu = false;
+ }
+ delay(300);
+ }
+}
+
+void printMenu() {
+ Serial.println("0: On / Off");
+ Serial.println("1: Volume Up");
+ Serial.println("2: Volume Down");
+ Serial.println("3: Tune Up");
+ Serial.println("4: Tune Down");
+ Serial.println("5: AM");
+ Serial.println("6: FM");
+ Serial.println("7: Preset 1");
+ Serial.println("8: Preset 2");
+ Serial.println("9: Preset 3");
+ Serial.println("a: Preset 4");
+ Serial.println("b: Preset 5");
+ Serial.println("c: Preset 6");
+ Serial.println("d: Mute");
+ Serial.println("e: Play/Pause");
+ Serial.println("f: Stop");
+ Serial.println("g: Aux");
+ Serial.println("h: Sleep");
+}
diff --git a/libraries/IRremote/examples/SendDemo/IRremote_SendDemo_ReceiveDemo.log b/libraries/IRremote/examples/SendDemo/IRremote_SendDemo_ReceiveDemo.log
new file mode 100644
index 0000000..d56a948
--- /dev/null
+++ b/libraries/IRremote/examples/SendDemo/IRremote_SendDemo_ReceiveDemo.log
@@ -0,0 +1,178 @@
+START ../src/ReceiveDemo.cpp from Feb 24 2023
+Using library version 4.1.0
+Enabling IRin...
+Ready to receive IR signals of protocols: NEC/NEC2/Onkyo/Apple, Panasonic/Kaseikyo, Denon/Sharp, Sony, RC5, RC6, LG, JVC, Samsung, FAST, Whynter, Lego Power Functions, Bosewave , MagiQuest, Universal Pulse Distance Width, Hash at pin 2
+
+If you connect debug pin 5 to ground, raw data is always printed
+5000 us is the (minimum) gap, after which the start of a new IR packet is assumed
+20 us are subtracted from all marks and added to all spaces for decoding
+
+Protocol=NEC Address=0x2 Command=0x34 Raw-Data=0xCB34FD02 32 bits LSB first
+Send with: IrSender.sendNEC(0x2, 0x34, );
+
+Protocol=NEC Address=0x102 Command=0x34 Raw-Data=0xCB340102 32 bits LSB first
+Send with: IrSender.sendNEC(0x102, 0x34, );
+
+Protocol=NEC Address=0x102 Command=0x34 Raw-Data=0xCB340102 32 bits LSB first
+Send with: IrSender.sendNEC(0x102, 0x34, );
+
+Protocol=NEC Address=0x80 Command=0x45 Raw-Data=0xBA457F80 32 bits LSB first
+Send with: IrSender.sendNEC(0x80, 0x45, );
+
+Protocol=NEC Address=0x4 Command=0x8 Raw-Data=0xF708FB04 32 bits LSB first
+Send with: IrSender.sendNEC(0x4, 0x8, );
+
+Protocol=Onkyo Address=0x102 Command=0x304 Raw-Data=0x3040102 32 bits LSB first
+Send with: IrSender.sendOnkyo(0x102, 0x304, );
+
+Protocol=NEC Address=0x102 Command=0x34 Raw-Data=0xCB340102 32 bits LSB first
+Send with: IrSender.sendNEC(0x102, 0x34, );
+
+Protocol=Panasonic Address=0xB Command=0x10 Raw-Data=0xA01000B0 48 bits LSB first
+Send with: IrSender.sendPanasonic(0xB, 0x10, );
+
+Protocol=Panasonic Address=0xB Command=0x10 Raw-Data=0xA01000B0 48 bits LSB first
+Send with: IrSender.sendPanasonic(0xB, 0x10, );
+
+Protocol=Panasonic Address=0xB Command=0x10 Raw-Data=0xA01000B0 48 bits LSB first
+Send with: IrSender.sendPanasonic(0xB, 0x10, );
+
+Protocol=PulseDistance Raw-Data=0x5A 72 bits LSB first
+Send with:
+ uint32_t tRawData[]={0x87654321, 0xAFEDCBA9, 0x5A};
+ IrSender.sendPulseDistanceWidthFromArray(38, 8850, 4400, 550, 1700, 550, 600, &tRawData[0], 72, PROTOCOL_IS_LSB_FIRST, , );
+
+Protocol=PulseWidth Raw-Data=0xDCBA9 52 bits LSB first
+Send with:
+ uint32_t tRawData[]={0x87654321, 0xDCBA9};
+ IrSender.sendPulseDistanceWidthFromArray(38, 300, 600, 600, 300, 350, 600, &tRawData[0], 52, PROTOCOL_IS_LSB_FIRST, , );
+
+Protocol=PulseWidth Raw-Data=0x87654321 32 bits LSB first
+Send with: IrSender.sendPulseDistanceWidth(38, 1000, 500, 600, 300, 350, 300, 0x87654321, 32, PROTOCOL_IS_LSB_FIRST, , );
+
+Protocol=Onkyo Address=0x102 Command=0x5634 Raw-Data=0x56340102 32 bits LSB first
+Send with: IrSender.sendOnkyo(0x102, 0x5634, );
+
+Protocol=Apple Address=0x2 Command=0x34 Raw-Data=0x23487EE 32 bits LSB first
+Send with: IrSender.sendApple(0x2, 0x34, );
+
+Protocol=Panasonic Address=0x102 Command=0x34 Raw-Data=0x4341020 48 bits LSB first
+Send with: IrSender.sendPanasonic(0x102, 0x34, );
+
+Protocol=Kaseikyo Address=0x102 Command=0x34 Extra=0x4711 Raw-Data=0x7341023 48 bits LSB first
+Send with: IrSender.sendKaseikyo(0x102, 0x34, , 0x4711);
+
+Protocol=Kaseikyo_Denon Address=0x102 Command=0x34 Raw-Data=0x4341020 48 bits LSB first
+Send with: IrSender.sendKaseikyo_Denon(0x102, 0x34, );
+
+Protocol=Denon Address=0x2 Command=0x34 Raw-Data=0x682 15 bits LSB first
+Send with: IrSender.sendDenon(0x2, 0x34, );
+
+Protocol=Denon Address=0x2 Command=0x34 Auto-Repeat gap=45650us Raw-Data=0x7962 15 bits LSB first
+
+Protocol=Sharp Address=0x2 Command=0x34 Raw-Data=0x4682 15 bits LSB first
+Send with: IrSender.sendSharp(0x2, 0x34, );
+
+Protocol=Sharp Address=0x2 Command=0x34 Auto-Repeat gap=46400us Raw-Data=0x3962 15 bits LSB first
+
+Protocol=Sony Address=0x2 Command=0x34 Raw-Data=0x134 12 bits LSB first
+Send with: IrSender.sendSony(0x2, 0x34, 2, 12);
+
+Protocol=Sony Address=0x2 Command=0x34 Raw-Data=0x134 15 bits LSB first
+Send with: IrSender.sendSony(0x2, 0x34, 2, 15);
+
+Protocol=Sony Address=0x102 Command=0x34 Raw-Data=0x8134 20 bits LSB first
+Send with: IrSender.sendSony(0x102, 0x34, 2, 20);
+
+Protocol=Samsung Address=0x102 Command=0x34 Raw-Data=0xCB340102 32 bits LSB first
+Send with: IrSender.sendSamsung(0x102, 0x34, );
+
+Protocol=Samsung Address=0x102 Command=0x5634 Raw-Data=0x56340102 32 bits LSB first
+Send with: IrSender.sendSamsung(0x102, 0x5634, );
+
+Protocol=Samsung48 Address=0x102 Command=0x5634 Raw-Data=0xA956 48 bits LSB first
+Send with: IrSender.sendSamsung48(0x102, 0x5634, );
+
+Protocol=RC5 Address=0x2 Command=0x34 Raw-Data=0x10B4 13 bits MSB first
+Send with: IrSender.sendRC5(0x2, 0x34, );
+
+Protocol=RC5 Address=0x2 Command=0x74 Toggle=1 Raw-Data=0x8B4 13 bits MSB first
+Send with: IrSender.sendRC5(0x2, 0x74, );
+
+Protocol=RC6 Address=0x2 Command=0x34 Raw-Data=0x234 20 bits MSB first
+Send with: IrSender.sendRC6(0x2, 0x34, );
+
+Protocol=Samsung Address=0x102 Command=0x34 Raw-Data=0xCB340102 32 bits LSB first
+Send with: IrSender.sendSamsung(0x102, 0x34, );
+
+Protocol=JVC Address=0x2 Command=0x34 Raw-Data=0x3402 16 bits LSB first
+Send with: IrSender.sendJVC(0x2, 0x34, );
+
+Protocol=Samsung Address=0x102 Command=0x5634 Raw-Data=0x56340102 32 bits LSB first
+Send with: IrSender.sendSamsung(0x102, 0x5634, );
+
+Protocol=LG Address=0x2 Command=0x5634 Raw-Data=0x256342 28 bits MSB first
+Send with: IrSender.sendLG(0x2, 0x5634, );
+
+Protocol=MagiQuest Address=0x102 Command=0x34 Raw-Data=0x6BCD0102 56 bits MSB first
+Send with: IrSender.sendMagiQuest(0x6BCD0102, 0x34, );
+
+Protocol=BoseWave Address=0x0 Command=0x34 Raw-Data=0xCB34 16 bits LSB first
+Send with: IrSender.sendBoseWave(0x0, 0x34, );
+
+Protocol=FAST Address=0x0 Command=0x34 Raw-Data=0xCB34 16 bits LSB first
+Send with: IrSender.sendFAST(0x0, 0x34, );
+
+Protocol=Lego Address=0x2 Command=0x14 Raw-Data=0x2148 16 bits MSB first
+Send with: IrSender.sendLego(0x2, 0x14, );
+
+Protocol=Lego Address=0x2 Command=0x14 Auto-Repeat gap=180450us Raw-Data=0x2148 16 bits MSB first
+
+Protocol=Lego Address=0x2 Command=0x14 Auto-Repeat gap=179350us Raw-Data=0x2148 16 bits MSB first
+
+Protocol=Lego Address=0x2 Command=0x14 Auto-Repeat gap=179200us Raw-Data=0x2148 16 bits MSB first
+
+Protocol=Lego Address=0x2 Command=0x14 Auto-Repeat gap=179150us Raw-Data=0x2148 16 bits MSB first
+
+Overflow detected
+Try to increase the "RAW_BUFFER_LENGTH" value of 600 in ../src/ReceiveDemo.cpp
+
+Protocol=NEC Address=0x3 Command=0x45 Raw-Data=0xBA45FC03 32 bits LSB first
+Send with: IrSender.sendNEC(0x3, 0x45, );
+
+Protocol=NEC Address=0x3 Command=0x45 Repeat gap=43250us
+
+Protocol=NEC Address=0x203 Command=0x45 Raw-Data=0xBA450203 32 bits LSB first
+Send with: IrSender.sendNEC(0x203, 0x45, );
+
+Protocol=NEC Address=0x203 Command=0x45 Repeat gap=47550us
+
+Protocol=NEC Address=0x203 Command=0x45 Raw-Data=0xBA450203 32 bits LSB first
+Send with: IrSender.sendNEC(0x203, 0x45, );
+
+Protocol=NEC2 Address=0x203 Command=0x45 Repeat gap=46500us Raw-Data=0xBA450203 32 bits LSB first
+
+Protocol=Onkyo Address=0x203 Command=0x6745 Raw-Data=0x67450203 32 bits LSB first
+Send with: IrSender.sendOnkyo(0x203, 0x6745, );
+
+Protocol=Onkyo Address=0x203 Command=0x6745 Repeat gap=46550us
+
+Protocol=Apple Address=0x3 Command=0x45 Raw-Data=0x34587EE 32 bits LSB first
+Send with: IrSender.sendApple(0x3, 0x45, );
+
+Protocol=Apple Address=0x3 Command=0x45 Repeat gap=31550us
+
+Protocol=Panasonic Address=0x203 Command=0x45 Raw-Data=0x55452030 48 bits LSB first
+Send with: IrSender.sendPanasonic(0x203, 0x45, );
+
+Protocol=Panasonic Address=0x203 Command=0x45 Repeat gap=72550us Raw-Data=0x55452030 48 bits LSB first
+
+Protocol=Kaseikyo Address=0x203 Command=0x45 Extra=0x4711 Raw-Data=0x56452033 48 bits LSB first
+Send with: IrSender.sendKaseikyo(0x203, 0x45, , 0x4711);
+
+Protocol=Kaseikyo Address=0x203 Command=0x45 Extra=0x4711 Repeat gap=66750us Raw-Data=0x56452033 48 bits LSB first
+
+Protocol=Kaseikyo_Denon Address=0x203 Command=0x45 Raw-Data=0x55452030 48 bits LSB first
+Send with: IrSender.sendKaseikyo_Denon(0x203, 0x45, );
+
+Protocol=Kaseikyo_Denon Address=0x203 Command=0x45 Repeat gap=68300us Raw-Data=0x55452030 48 bits LSB first
\ No newline at end of file
diff --git a/libraries/IRremote/examples/SendDemo/PinDefinitionsAndMore.h b/libraries/IRremote/examples/SendDemo/PinDefinitionsAndMore.h
new file mode 100644
index 0000000..14573c7
--- /dev/null
+++ b/libraries/IRremote/examples/SendDemo/PinDefinitionsAndMore.h
@@ -0,0 +1,349 @@
+/*
+ * PinDefinitionsAndMore.h
+ *
+ * Contains pin definitions for IRremote examples for various platforms
+ * as well as definitions for feedback LED and tone() and includes
+ *
+ * Copyright (C) 2021-2023 Armin Joachimsmeyer
+ * armin.joachimsmeyer@gmail.com
+ *
+ * This file is part of IRremote https://github.com/Arduino-IRremote/Arduino-IRremote.
+ *
+ * Arduino-IRremote is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
+ * See the GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see .
+ *
+ */
+
+/*
+ * Pin mapping table for different platforms
+ *
+ * Platform IR input IR output Tone Core/Pin schema
+ * --------------------------------------------------------------
+ * DEFAULT/AVR 2 3 4 Arduino
+ * ATtinyX5 0|PB0 4|PB4 3|PB3 ATTinyCore
+ * ATtiny167 3|PA3 2|PA2 7|PA7 ATTinyCore
+ * ATtiny167 9|PA3 8|PA2 5|PA7 Digispark original core
+ * ATtiny84 |PB2 |PA4 |PA3 ATTinyCore
+ * ATtiny88 3|PD3 4|PD4 9|PB1 ATTinyCore
+ * ATtiny3217 18|PA1 19|PA2 20|PA3 MegaTinyCore
+ * ATtiny1604 2 3|PA5 %
+ * ATtiny816 14|PA1 16|PA3 1|PA5 MegaTinyCore
+ * ATtiny1614 8|PA1 10|PA3 1|PA5 MegaTinyCore
+ * SAMD21 3 4 5
+ * ESP8266 14|D5 12|D6 %
+ * ESP32 15 4 27
+ * ESP32-C3 2 3 4
+ * BluePill PA6 PA7 PA3
+ * APOLLO3 11 12 5
+ * RP2040 3|GPIO15 4|GPIO16 5|GPIO17
+ */
+//#define _IR_MEASURE_TIMING // For debugging purposes.
+
+#if defined(__AVR__)
+#if defined(__AVR_ATtiny25__) || defined(__AVR_ATtiny45__) || defined(__AVR_ATtiny85__) // Digispark board. For use with ATTinyCore.
+#include "ATtinySerialOut.hpp" // TX is at pin 2 - Available as Arduino library "ATtinySerialOut". Saves 700 bytes program memory and 70 bytes RAM for ATtinyCore.
+#define IR_RECEIVE_PIN PIN_PB0
+#define IR_SEND_PIN PIN_PB4 // Pin 2 is serial output with ATtinySerialOut. Pin 1 is internal LED and Pin3 is USB+ with pullup on Digispark board.
+#define TONE_PIN PIN_PB3
+#define _IR_TIMING_TEST_PIN PIN_PB3
+
+# elif defined(__AVR_ATtiny87__) || defined(__AVR_ATtiny167__) // Digispark pro board
+#include "ATtinySerialOut.hpp" // Available as Arduino library "ATtinySerialOut"
+// For ATtiny167 Pins PB6 and PA3 are usable as interrupt source.
+# if defined(ARDUINO_AVR_DIGISPARKPRO)
+// For use with Digispark original core
+#define IR_RECEIVE_PIN 9 // PA3 - on Digispark board labeled as pin 9
+//#define IR_RECEIVE_PIN 14 // PB6 / INT0 is connected to USB+ on DigisparkPro boards
+#define IR_SEND_PIN 8 // PA2 - on Digispark board labeled as pin 8
+#define TONE_PIN 5 // PA7 - on Digispark board labeled as pin 5
+#define _IR_TIMING_TEST_PIN 10 // PA4
+# else
+// For use with ATTinyCore
+#define IR_RECEIVE_PIN PIN_PA3 // On Digispark board labeled as pin 9 - INT0 is connected to USB+ on DigisparkPro boards
+#define IR_SEND_PIN PIN_PA2 // On Digispark board labeled as pin 8
+#define TONE_PIN PIN_PA7 // On Digispark board labeled as pin 5
+# endif
+
+# elif defined(__AVR_ATtiny84__) // For use with ATTinyCore
+#include "ATtinySerialOut.hpp" // Available as Arduino library "ATtinySerialOut". Saves 128 bytes program memory.
+#define IR_RECEIVE_PIN PIN_PB2 // INT0
+#define IR_SEND_PIN PIN_PA4
+#define TONE_PIN PIN_PA3
+#define _IR_TIMING_TEST_PIN PIN_PA5
+
+# elif defined(__AVR_ATtiny88__) // MH-ET Tiny88 board. For use with ATTinyCore.
+#include "ATtinySerialOut.hpp" // Available as Arduino library "ATtinySerialOut". Saves 128 bytes program memory.
+// Pin 6 is TX, pin 7 is RX
+#define IR_RECEIVE_PIN PIN_PD3 // 3 - INT1
+#define IR_SEND_PIN PIN_PD4 // 4
+#define TONE_PIN PIN_PB1 // 9
+#define _IR_TIMING_TEST_PIN PIN_PB0 // 8
+
+# elif defined(__AVR_ATtiny1616__) || defined(__AVR_ATtiny3216__) || defined(__AVR_ATtiny3217__) // For use with megaTinyCore
+// Tiny Core Dev board
+// https://www.tindie.com/products/xkimi/tiny-core-16-dev-board-attiny1616/ - Out of Stock
+// https://www.tindie.com/products/xkimi/tiny-core-32-dev-board-attiny3217/ - Out of Stock
+#define IR_RECEIVE_PIN PIN_PA1 // use 18 instead of PIN_PA1 for TinyCore32
+#define IR_SEND_PIN PIN_PA2 // 19
+#define TONE_PIN PIN_PA3 // 20
+#define APPLICATION_PIN PIN_PA0 // 0
+#undef LED_BUILTIN // No LED available on the TinyCore 32 board, take the one on the programming board which is connected to the DAC output
+#define LED_BUILTIN PIN_PA6 // use 2 instead of PIN_PA6 for TinyCore32
+
+# elif defined(__AVR_ATtiny816__) // For use with megaTinyCore
+#define IR_RECEIVE_PIN PIN_PA1 // 14
+#define IR_SEND_PIN PIN_PA1 // 16
+#define TONE_PIN PIN_PA5 // 1
+#define APPLICATION_PIN PIN_PA4 // 0
+#undef LED_BUILTIN // No LED available, take the one which is connected to the DAC output
+#define LED_BUILTIN PIN_PB5 // 4
+
+# elif defined(__AVR_ATtiny1614__) // For use with megaTinyCore
+#define IR_RECEIVE_PIN PIN_PA1 // 8
+#define IR_SEND_PIN PIN_PA3 // 10
+#define TONE_PIN PIN_PA5 // 1
+#define APPLICATION_PIN PIN_PA4 // 0
+
+# elif defined(__AVR_ATtiny1604__) // For use with megaTinyCore
+#define IR_RECEIVE_PIN PIN_PA6 // 2 - To be compatible with interrupt example, pin 2 is chosen here.
+#define IR_SEND_PIN PIN_PA7 // 3
+#define APPLICATION_PIN PIN_PB2 // 5
+
+#define tone(...) void() // Define as void, since TCB0_INT_vect is also used by tone()
+#define noTone(a) void()
+#define TONE_PIN 42 // Dummy for examples using it
+
+# elif defined(__AVR_ATmega1284__) || defined(__AVR_ATmega1284P__) \
+|| defined(__AVR_ATmega644__) || defined(__AVR_ATmega644P__) \
+|| defined(__AVR_ATmega324P__) || defined(__AVR_ATmega324A__) \
+|| defined(__AVR_ATmega324PA__) || defined(__AVR_ATmega164A__) \
+|| defined(__AVR_ATmega164P__) || defined(__AVR_ATmega32__) \
+|| defined(__AVR_ATmega16__) || defined(__AVR_ATmega8535__) \
+|| defined(__AVR_ATmega64__) || defined(__AVR_ATmega128__) \
+|| defined(__AVR_ATmega1281__) || defined(__AVR_ATmega2561__) \
+|| defined(__AVR_ATmega8515__) || defined(__AVR_ATmega162__)
+#define IR_RECEIVE_PIN 2
+#define IR_SEND_PIN 13
+#define TONE_PIN 4
+#define APPLICATION_PIN 5
+#define ALTERNATIVE_IR_FEEDBACK_LED_PIN 6 // E.g. used for examples which use LED_BUILDIN for example output.
+#define _IR_TIMING_TEST_PIN 7
+
+# else // Default as for ATmega328 like on Uno, Nano, Leonardo, Teensy 2.0 etc.
+#define IR_RECEIVE_PIN 2 // To be compatible with interrupt example, pin 2 is chosen here.
+#define IR_SEND_PIN 3
+#define TONE_PIN 4
+#define APPLICATION_PIN 5
+#define ALTERNATIVE_IR_FEEDBACK_LED_PIN 6 // E.g. used for examples which use LED_BUILDIN for example output.
+#define _IR_TIMING_TEST_PIN 7
+
+# if defined(ARDUINO_AVR_PROMICRO) // Sparkfun Pro Micro is __AVR_ATmega32U4__ but has different external circuit
+// We have no built in LED at pin 13 -> reuse RX LED
+#undef LED_BUILTIN
+#define LED_BUILTIN LED_BUILTIN_RX
+# endif
+# endif // defined(__AVR_ATtiny25__)...
+
+#elif defined(ARDUINO_ARCH_RENESAS_UNO) // Uno R4
+// To be compatible with Uno R3.
+#define IR_RECEIVE_PIN 2
+#define IR_SEND_PIN 3
+#define TONE_PIN 4
+#define APPLICATION_PIN 5
+#define ALTERNATIVE_IR_FEEDBACK_LED_PIN 6 // E.g. used for examples which use LED_BUILDIN for example output.
+#define _IR_TIMING_TEST_PIN 7
+
+#elif defined(ESP8266)
+#define FEEDBACK_LED_IS_ACTIVE_LOW // The LED on my board (D4) is active LOW
+#define IR_RECEIVE_PIN 14 // D5
+#define IR_SEND_PIN 12 // D6 - D4/pin 2 is internal LED
+#define _IR_TIMING_TEST_PIN 2 // D4
+#define APPLICATION_PIN 13 // D7
+
+#define tone(...) void() // tone() inhibits receive timer
+#define noTone(a) void()
+#define TONE_PIN 42 // Dummy for examples using it#
+
+#elif defined(ARDUINO_NOLOGO_ESP32C3_SUPER_MINI)
+#define FEEDBACK_LED_IS_ACTIVE_LOW // The LED on my board (D8) is active LOW
+#define IR_RECEIVE_PIN 2
+#define IR_SEND_PIN 3
+#define TONE_PIN 4
+#define APPLICATION_PIN 10
+
+#elif defined(CONFIG_IDF_TARGET_ESP32C3) || defined(ARDUINO_ESP32C3_DEV)
+#define NO_LED_FEEDBACK_CODE // The WS2812 on pin 8 of AI-C3 board crashes if used as receive feedback LED, other I/O pins are working...
+#define IR_RECEIVE_PIN 6
+#define IR_SEND_PIN 7
+#define TONE_PIN 10
+#define APPLICATION_PIN 18
+
+#elif defined(ESP32)
+#include
+
+// tone() is included in ESP32 core since 2.0.2
+#if !defined(ESP_ARDUINO_VERSION_VAL)
+#define ESP_ARDUINO_VERSION_VAL(major, minor, patch) 12345678
+#endif
+#if ESP_ARDUINO_VERSION <= ESP_ARDUINO_VERSION_VAL(2, 0, 2)
+#define TONE_LEDC_CHANNEL 1 // Using channel 1 makes tone() independent of receiving timer -> No need to stop receiving timer.
+void tone(uint8_t aPinNumber, unsigned int aFrequency){
+ ledcAttachPin(aPinNumber, TONE_LEDC_CHANNEL);
+ ledcWriteTone(TONE_LEDC_CHANNEL, aFrequency);
+}
+void tone(uint8_t aPinNumber, unsigned int aFrequency, unsigned long aDuration){
+ ledcAttachPin(aPinNumber, TONE_LEDC_CHANNEL);
+ ledcWriteTone(TONE_LEDC_CHANNEL, aFrequency);
+ delay(aDuration);
+ ledcWriteTone(TONE_LEDC_CHANNEL, 0);
+}
+void noTone(uint8_t aPinNumber){
+ ledcWriteTone(TONE_LEDC_CHANNEL, 0);
+}
+#endif // ESP_ARDUINO_VERSION <= ESP_ARDUINO_VERSION_VAL(2, 0, 2)
+
+#define IR_RECEIVE_PIN 15 // D15
+#define IR_SEND_PIN 4 // D4
+#define TONE_PIN 27 // D27 25 & 26 are DAC0 and 1
+#define APPLICATION_PIN 16 // RX2 pin
+
+#elif defined(ARDUINO_ARCH_STM32) || defined(ARDUINO_ARCH_STM32F1) // BluePill
+// Timer 3 blocks PA6, PA7, PB0, PB1 for use by Servo or tone()
+#define IR_RECEIVE_PIN PA6
+#define IR_RECEIVE_PIN_STRING "PA6"
+#define IR_SEND_PIN PA7
+#define IR_SEND_PIN_STRING "PA7"
+#define TONE_PIN PA3
+#define _IR_TIMING_TEST_PIN PA5
+#define APPLICATION_PIN PA2
+#define APPLICATION_PIN_STRING "PA2"
+# if defined(ARDUINO_GENERIC_STM32F103C) || defined(ARDUINO_BLUEPILL_F103C8)
+// BluePill LED is active low
+#define FEEDBACK_LED_IS_ACTIVE_LOW
+# endif
+
+#elif defined(ARDUINO_ARCH_APOLLO3) // Sparkfun Apollo boards
+#define IR_RECEIVE_PIN 11
+#define IR_SEND_PIN 12
+#define TONE_PIN 5
+
+#elif defined(ARDUINO_ARCH_MBED) && defined(ARDUINO_ARCH_MBED_NANO) // Arduino Nano 33 BLE and Arduino Nano Connect layout for MBED
+// Must be before ARDUINO_ARCH_RP2040, since it is the layout for the MBED core of Arduino Nano Connect
+#define IR_RECEIVE_PIN 3 // GPIO15 Start with pin 3 since pin 2|GPIO25 is connected to LED on Pi pico
+#define IR_SEND_PIN 4 // GPIO16
+#define TONE_PIN 5
+#define APPLICATION_PIN 6
+#define ALTERNATIVE_IR_FEEDBACK_LED_PIN 7 // E.g. used for examples which use LED_BUILDIN for example output.
+#define _IR_TIMING_TEST_PIN 8
+
+#elif defined(ARDUINO_ARCH_RP2040) // Arduino Nano Connect, Pi Pico with arduino-pico core https://github.com/earlephilhower/arduino-pico
+#define IR_RECEIVE_PIN 15 // GPIO15 to be compatible with the Arduino Nano RP2040 Connect (pin3)
+#define IR_SEND_PIN 16 // GPIO16
+#define TONE_PIN 17
+#define APPLICATION_PIN 18
+#define ALTERNATIVE_IR_FEEDBACK_LED_PIN 19 // E.g. used for examples which use LED_BUILDIN for example output.
+#define _IR_TIMING_TEST_PIN 20
+
+// If you program the Nano RP2040 Connect with this core, then you must redefine LED_BUILTIN
+// and use the external reset with 1 kOhm to ground to enter UF2 mode
+#undef LED_BUILTIN
+#define LED_BUILTIN 6
+
+#elif defined(PARTICLE) // !!!UNTESTED!!!
+#define IR_RECEIVE_PIN A4
+#define IR_SEND_PIN A5 // Particle supports multiple pins
+
+#define LED_BUILTIN D7
+
+/*
+ * 4 times the same (default) layout for easy adaption in the future
+ */
+#elif defined(TEENSYDUINO) // Teensy 2.0 is handled at default for ATmega328 like on Uno, Nano, Leonardo etc.
+#define IR_RECEIVE_PIN 2
+#define IR_SEND_PIN 3
+#define TONE_PIN 4
+#define APPLICATION_PIN 5
+#define ALTERNATIVE_IR_FEEDBACK_LED_PIN 6 // E.g. used for examples which use LED_BUILDIN for example output.
+#define _IR_TIMING_TEST_PIN 7
+
+#elif defined(ARDUINO_ARCH_MBED) // Arduino Nano 33 BLE
+#define IR_RECEIVE_PIN 2
+#define IR_SEND_PIN 3
+#define TONE_PIN 4
+#define APPLICATION_PIN 5
+#define ALTERNATIVE_IR_FEEDBACK_LED_PIN 6 // E.g. used for examples which use LED_BUILDIN for example output.
+#define _IR_TIMING_TEST_PIN 7
+
+#elif defined(ARDUINO_ARCH_SAMD) || defined(ARDUINO_ARCH_SAM)
+#define IR_RECEIVE_PIN 2
+#define IR_SEND_PIN 3
+#define TONE_PIN 4
+#define APPLICATION_PIN 5
+#define ALTERNATIVE_IR_FEEDBACK_LED_PIN 6 // E.g. used for examples which use LED_BUILDIN for example output.
+#define _IR_TIMING_TEST_PIN 7
+
+#if !defined(ARDUINO_SAMD_ADAFRUIT) && !defined(ARDUINO_SEEED_XIAO_M0)
+// On the Zero and others we switch explicitly to SerialUSB
+#define Serial SerialUSB
+#endif
+
+// Definitions for the Chinese SAMD21 M0-Mini clone, which has no led connected to D13/PA17.
+// Attention!!! D2 and D4 are swapped on these boards!!!
+// If you connect the LED, it is on pin 24/PB11. In this case activate the next two lines.
+//#undef LED_BUILTIN
+//#define LED_BUILTIN 24 // PB11
+// As an alternative you can choose pin 25, it is the RX-LED pin (PB03), but active low.In this case activate the next 3 lines.
+//#undef LED_BUILTIN
+//#define LED_BUILTIN 25 // PB03
+//#define FEEDBACK_LED_IS_ACTIVE_LOW // The RX LED on the M0-Mini is active LOW
+
+#elif defined (NRF51) // BBC micro:bit
+#define IR_RECEIVE_PIN 2
+#define IR_SEND_PIN 3
+#define APPLICATION_PIN 1
+#define _IR_TIMING_TEST_PIN 4
+
+#define tone(...) void() // no tone() available
+#define noTone(a) void()
+#define TONE_PIN 42 // Dummy for examples using it
+
+#else
+#warning Board / CPU is not detected using pre-processor symbols -> using default values, which may not fit. Please extend PinDefinitionsAndMore.h.
+// Default valued for unidentified boards
+#define IR_RECEIVE_PIN 2
+#define IR_SEND_PIN 3
+#define TONE_PIN 4
+#define APPLICATION_PIN 5
+#define ALTERNATIVE_IR_FEEDBACK_LED_PIN 6 // E.g. used for examples which use LED_BUILDIN for example output.
+#define _IR_TIMING_TEST_PIN 7
+#endif // defined(ESP8266)
+
+#if defined(ESP32) || defined(ARDUINO_ARCH_RP2040) || defined(PARTICLE) || defined(ARDUINO_ARCH_MBED)
+#define SEND_PWM_BY_TIMER // We do not have pin restrictions for this CPU's, so lets use the hardware PWM for send carrier signal generation
+#else
+# if defined(SEND_PWM_BY_TIMER)
+#undef IR_SEND_PIN // SendPin is determined by timer! This avoids warnings in IRremote.hpp and IRTimer.hpp
+# endif
+#endif
+
+#if !defined (FLASHEND)
+#define FLASHEND 0xFFFF // Dummy value for platforms where FLASHEND is not defined
+#endif
+
+/*
+ * Helper macro for getting a macro definition as string
+ */
+#if !defined(STR_HELPER)
+#define STR_HELPER(x) #x
+#define STR(x) STR_HELPER(x)
+#endif
diff --git a/libraries/IRremote/examples/SendDemo/SendDemo.ino b/libraries/IRremote/examples/SendDemo/SendDemo.ino
new file mode 100644
index 0000000..6ef9357
--- /dev/null
+++ b/libraries/IRremote/examples/SendDemo/SendDemo.ino
@@ -0,0 +1,424 @@
+/*
+ * SendDemo.cpp
+ *
+ * Demonstrates sending IR codes in standard format with address and command
+ *
+ * This file is part of Arduino-IRremote https://github.com/Arduino-IRremote/Arduino-IRremote.
+ *
+ ************************************************************************************
+ * MIT License
+ *
+ * Copyright (c) 2020-2023 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.
+ *
+ ************************************************************************************
+ */
+#include
+//#define EXCLUDE_EXOTIC_PROTOCOLS // Saves around 240 bytes program memory if IrSender.write is used
+#define SEND_PWM_BY_TIMER // Disable carrier PWM generation in software and use (restricted) hardware PWM.
+//#define USE_NO_SEND_PWM // Use no carrier PWM, just simulate an active low receiver signal. Overrides SEND_PWM_BY_TIMER definition
+//#define USE_ACTIVE_HIGH_OUTPUT_FOR_SEND_PIN // Simulate an active high receiver signal instead of an active low signal.
+//#define NO_LED_FEEDBACK_CODE // Saves 566 bytes program memory
+
+/*
+ * Helper macro for getting a macro definition as string
+ */
+#if !defined(STR_HELPER)
+#define STR_HELPER(x) #x
+#define STR(x) STR_HELPER(x)
+#endif
+
+#ifndef IR_SEND_PIN
+#define IR_SEND_PIN 3 // P0_0
+#endif
+
+#include
+
+// #undef IR_SEND_PIN // to use tSendPin
+
+#define DELAY_AFTER_SEND 2000
+#define DELAY_AFTER_LOOP 5000
+
+void setup() {
+ Serial.begin(9600);
+ while (!Serial)
+ ; // Wait for Serial to become available. Is optimized away for some cores.
+
+ // Just to know which program is running on my Arduino
+ Serial.println(F("START " __FILE__ " from " __DATE__ "\r\nUsing library version " VERSION_IRREMOTE));
+
+#if defined(IR_SEND_PIN)
+ IrSender.begin(); // Start with IR_SEND_PIN as send pin and enable feedback LED at default feedback LED pin
+// disableLEDFeedback(); // Disable feedback LED at default feedback LED pin
+ Serial.println(F("Send IR signals at pin " STR(IR_SEND_PIN)));
+#else
+ // Here the macro IR_SEND_PIN is not defined or undefined above with #undef IR_SEND_PIN
+ uint8_t tSendPin = 3;
+ IrSender.begin(tSendPin, ENABLE_LED_FEEDBACK, USE_DEFAULT_FEEDBACK_LED_PIN); // Specify send pin and enable feedback LED at default feedback LED pin
+ // You can change send pin later with IrSender.setSendPin();
+
+ Serial.print(F("Send IR signals at pin "));
+ Serial.println(tSendPin);
+#endif
+
+#if !defined(SEND_PWM_BY_TIMER)
+ /*
+ * Print internal software PWM signal generation info
+ */
+ IrSender.enableIROut(38); // Call it with 38 kHz just to initialize the values printed below
+ Serial.print(F("Send signal mark duration is "));
+ Serial.print(IrSender.periodOnTimeMicros);
+ Serial.print(F(" us, pulse narrowing correction is "));
+ Serial.print(IrSender.getPulseCorrectionNanos());
+ Serial.print(F(" ns, total period is "));
+ Serial.print(IrSender.periodTimeMicros);
+ Serial.println(F(" us"));
+#endif
+
+#if defined(LED_BUILTIN) && !defined(NO_LED_FEEDBACK_CODE)
+# if defined(FEEDBACK_LED_IS_ACTIVE_LOW)
+ Serial.print(F("Active low "));
+# endif
+ Serial.print(F("FeedbackLED at pin "));
+ Serial.println(LED_BUILTIN); // Works also for ESP32: static const uint8_t LED_BUILTIN = 8; #define LED_BUILTIN LED_BUILTIN
+#endif
+
+}
+
+/*
+ * Set up the data to be sent.
+ * For most protocols, the data is build up with a constant 8 (or 16 byte) address
+ * and a variable 8 bit command.
+ * There are exceptions like Sony and Denon, which have 5 bit address.
+ */
+uint16_t sAddress = 0x0132;
+uint8_t sCommand = 0x34;
+uint16_t s16BitCommand = 0x5634;
+uint8_t sRepeats = 0;
+
+void loop() {
+ /*
+ * Print values
+ */
+ Serial.println();
+ Serial.print(F("address=0x"));
+ Serial.print(sAddress, HEX);
+ Serial.print(F(" command=0x"));
+ Serial.print(sCommand, HEX);
+ Serial.print(F(" repeats="));
+ Serial.println(sRepeats);
+ Serial.println();
+ Serial.println();
+ Serial.flush();
+
+ Serial.println(F("Send NEC with 8 bit address"));
+ Serial.flush();
+ IrSender.sendNEC(sAddress & 0xFF, sCommand, sRepeats);
+ delay(DELAY_AFTER_SEND); // delay must be greater than 5 ms (RECORD_GAP_MICROS), otherwise the receiver sees it as one long signal
+
+ Serial.println(F("Send NEC with 16 bit address"));
+ Serial.flush();
+ IrSender.sendNEC(sAddress, sCommand, sRepeats);
+ delay(DELAY_AFTER_SEND);
+
+ Serial.println(F("Send NEC2 with 16 bit address"));
+ Serial.flush();
+ IrSender.sendNEC2(sAddress, sCommand, sRepeats);
+ delay(DELAY_AFTER_SEND);
+
+ if (sRepeats == 0) {
+ /*
+ * Send constant values only once in this demo
+ */
+ Serial.println(F("Sending NEC Pronto data with 8 bit address 0x80 and command 0x45 and no repeats"));
+ Serial.flush();
+ IrSender.sendPronto(F("0000 006D 0022 0000 015E 00AB " /* Pronto header + start bit */
+ "0017 0015 0017 0015 0017 0017 0015 0017 0017 0015 0017 0015 0017 0015 0017 003F " /* Lower address byte */
+ "0017 003F 0017 003E 0017 003F 0015 003F 0017 003E 0017 003F 0017 003E 0017 0015 " /* Upper address byte (inverted at 8 bit mode) */
+ "0017 003E 0017 0015 0017 003F 0017 0015 0017 0015 0017 0015 0017 003F 0017 0015 " /* command byte */
+ "0019 0013 0019 003C 0017 0015 0017 003F 0017 003E 0017 003F 0017 0015 0017 003E " /* inverted command byte */
+ "0017 0806"), 0); //stop bit, no repeat possible, because of missing repeat pattern
+ delay(DELAY_AFTER_SEND);
+
+ /*
+ * !!! The next data occupies 136 bytes RAM !!!
+ */
+ Serial.println(
+ F("Send NEC sendRaw data with 8 bit address=0xFB04 and command 0x08 and exact timing (16 bit array format)"));
+ Serial.flush();
+ const uint16_t irSignal[] = { 9000, 4500/*Start bit*/, 560, 560, 560, 560, 560, 1690, 560,
+ 560/*0010 0x4 of 16 bit address LSB first*/, 560, 560, 560, 560, 560, 560, 560, 560/*0000*/, 560, 1690, 560, 1690,
+ 560, 560, 560, 1690/*1101 0xB*/, 560, 1690, 560, 1690, 560, 1690, 560, 1690/*1111*/, 560, 560, 560, 560, 560, 560,
+ 560, 1690/*0001 0x08 of command LSB first*/, 560, 560, 560, 560, 560, 560, 560, 560/*0000 0x00*/, 560, 1690, 560,
+ 1690, 560, 1690, 560, 560/*1110 Inverted 8 of command*/, 560, 1690, 560, 1690, 560, 1690, 560,
+ 1690/*1111 inverted 0 of command*/, 560 /*stop bit*/}; // Using exact NEC timing
+ IrSender.sendRaw(irSignal, sizeof(irSignal) / sizeof(irSignal[0]), NEC_KHZ); // Note the approach used to automatically calculate the size of the array.
+ delay(DELAY_AFTER_SEND);
+
+ /*
+ * With sendNECRaw() you can send 32 bit combined codes
+ */
+ Serial.println(F("Send ONKYO with 16 bit address 0x0102 and 16 bit command 0x0304 with NECRaw(0x03040102)"));
+ Serial.flush();
+ IrSender.sendNECRaw(0x03040102, sRepeats);
+ delay(DELAY_AFTER_SEND);
+
+ /*
+ * With Send sendNECMSB() you can send your old 32 bit codes.
+ * To convert one into the other, you must reverse the byte positions and then reverse all positions of each byte.
+ * Use bitreverse32Bit().
+ * Example:
+ * 0xCB340102 byte reverse -> 0x020134CB bit reverse-> 40802CD3
+ */
+ Serial.println(F("Send ONKYO with 16 bit address 0x0102 and command 0x34 with old 32 bit format MSB first (0x40802CD3)"));
+ Serial.flush();
+ IrSender.sendNECMSB(0x40802CD3, 32, false);
+ delay(DELAY_AFTER_SEND);
+
+ Serial.println(F("Send Panasonic 0xB, 0x10 as 48 bit PulseDistance using ProtocolConstants"));
+ Serial.flush();
+
+ IrSender.sendPulseDistanceWidth(&KaseikyoProtocolConstants, 0xA010B02002, 48, NO_REPEATS); // Panasonic is a Kaseikyo variant
+
+ delay(DELAY_AFTER_SEND);
+
+ /*
+ * Send 2 Panasonic 48 bit codes as Pulse Distance data, once with LSB and once with MSB first
+ */
+ Serial.println(F("Send Panasonic 0xB, 0x10 as 48 bit PulseDistance"));
+ Serial.println(F(" LSB first"));
+ Serial.flush();
+
+ IrSender.sendPulseDistanceWidth(38, 3450, 1700, 450, 1250, 450, 400, 0xA010B02002, 48, PROTOCOL_IS_LSB_FIRST,
+ 0, NO_REPEATS);
+ delay(DELAY_AFTER_SEND);
+
+ // The same with MSB first. Use bit reversed raw data of LSB first part
+ Serial.println(F(" MSB first"));
+ IrSender.sendPulseDistanceWidth(38, 3450, 1700, 450, 1250, 450, 400, 0x40040D000805, 48, PROTOCOL_IS_MSB_FIRST,
+ 0, NO_REPEATS);
+ delay(DELAY_AFTER_SEND);
+
+ Serial.println(F("Send 72 bit PulseDistance 0x5A AFEDCBA9 87654321 LSB first"));
+ Serial.flush();
+ IRRawDataType tRawData[] = { 0xAFEDCBA987654321, 0x5A }; // LSB of tRawData[0] is sent first
+ IrSender.sendPulseDistanceWidthFromArray(38, 8900, 4450, 550, 1700, 550, 600, &tRawData[0], 72, PROTOCOL_IS_LSB_FIRST, 0, NO_REPEATS);
+ delay(DELAY_AFTER_SEND);
+
+ Serial.println(F("Send 52 bit PulseDistanceWidth 0xDCBA9 87654321 LSB first"));
+ Serial.flush();
+ // Real PulseDistanceWidth (constant bit length) does not require a stop bit
+ IrSender.sendPulseDistanceWidth(38, 300, 600, 600, 300, 300, 600, 0xDCBA987654321, 52, PROTOCOL_IS_LSB_FIRST,
+ 0, 0);
+ delay(DELAY_AFTER_SEND);
+
+ Serial.println(F("Send ASCII 7 bit PulseDistanceWidth LSB first"));
+ Serial.flush();
+ // Real PulseDistanceWidth (constant bit length) does theoretically not require a stop bit, but we know the stop bit from serial transmission
+ IrSender.sendPulseDistanceWidth(38, 6000, 500, 500, 1500, 1500, 500, sCommand, 7, PROTOCOL_IS_LSB_FIRST, 0, 0);
+ delay(DELAY_AFTER_SEND);
+
+ Serial.println(F("Send Sony12 as PulseWidth LSB first"));
+ Serial.flush();
+ uint32_t tData = (uint32_t) sAddress << 7 | (sCommand & 0x7F);
+ IrSender.sendPulseDistanceWidth(38, 2400, 600, 1200, 600, 600, 600, tData, SIRCS_12_PROTOCOL, PROTOCOL_IS_LSB_FIRST, 0, 0);
+ delay(DELAY_AFTER_SEND);
+
+ Serial.println(F("Send 32 bit PulseWidth 0x87654321 LSB first"));
+ Serial.flush();
+ // Real PulseDistanceWidth (constant bit length) does not require a stop bit
+ IrSender.sendPulseDistanceWidth(38, 1000, 500, 600, 300, 300, 300, 0x87654321, 32, PROTOCOL_IS_LSB_FIRST, 0, 0);
+ delay(DELAY_AFTER_SEND);
+ }
+
+ Serial.println(F("Send Onkyo (NEC with 16 bit command)"));
+ Serial.flush();
+ IrSender.sendOnkyo(sAddress, s16BitCommand, sRepeats);
+ delay(DELAY_AFTER_SEND);
+
+ Serial.println(F("Send Apple"));
+ Serial.flush();
+ IrSender.sendApple(sAddress & 0xFF, sCommand, sRepeats);
+ delay(DELAY_AFTER_SEND);
+
+ Serial.println(F("Send Panasonic"));
+ Serial.flush();
+ IrSender.sendPanasonic(sAddress & 0xFFF, sCommand, sRepeats);
+ delay(DELAY_AFTER_SEND);
+
+ Serial.println(F("Send Kaseikyo with 0x4711 as Vendor ID"));
+ Serial.flush();
+ IrSender.sendKaseikyo(sAddress & 0xFFF, sCommand, sRepeats, 0x4711);
+ delay(DELAY_AFTER_SEND);
+
+ Serial.println(F("Send Kaseikyo_Denon variant"));
+ Serial.flush();
+ IrSender.sendKaseikyo_Denon(sAddress & 0xFFF, sCommand, sRepeats);
+ delay(DELAY_AFTER_SEND);
+
+ Serial.println(F("Send Denon"));
+ Serial.flush();
+ IrSender.sendDenon(sAddress & 0x1F, sCommand, sRepeats);
+ delay(DELAY_AFTER_SEND);
+
+ Serial.println(F("Send Denon/Sharp variant"));
+ Serial.flush();
+ IrSender.sendSharp(sAddress & 0x1F, sCommand, sRepeats);
+ delay(DELAY_AFTER_SEND);
+
+ Serial.println(F("Send Sony/SIRCS with 7 command and 5 address bits"));
+ Serial.flush();
+ IrSender.sendSony(sAddress & 0x1F, sCommand & 0x7F, sRepeats);
+ delay(DELAY_AFTER_SEND);
+
+ Serial.println(F("Send Sony/SIRCS with 7 command and 8 address bits"));
+ Serial.flush();
+ IrSender.sendSony(sAddress & 0xFF, sCommand, sRepeats, SIRCS_15_PROTOCOL);
+ delay(DELAY_AFTER_SEND);
+
+ Serial.println(F("Send Sony/SIRCS with 7 command and 13 address bits"));
+ Serial.flush();
+ IrSender.sendSony(sAddress & 0x1FFF, sCommand & 0x7F, sRepeats, SIRCS_20_PROTOCOL);
+ delay(DELAY_AFTER_SEND);
+
+ Serial.println(F("Send Samsung 8 bit command"));
+ Serial.flush();
+ IrSender.sendSamsung(sAddress, sCommand, sRepeats);
+ delay(DELAY_AFTER_SEND);
+
+ Serial.println(F("Send Samsung 16 bit command"));
+ Serial.flush();
+ IrSender.sendSamsung(sAddress, s16BitCommand, sRepeats);
+ delay(DELAY_AFTER_SEND);
+
+ Serial.println(F("Send Samsung48 16 bit command"));
+ Serial.flush();
+ IrSender.sendSamsung48(sAddress, s16BitCommand, sRepeats);
+ delay(DELAY_AFTER_SEND);
+
+ Serial.println(F("Send RC5"));
+ Serial.flush();
+ IrSender.sendRC5(sAddress & 0x1F, sCommand & 0x3F, sRepeats, true); // 5 address, 6 command bits
+ delay(DELAY_AFTER_SEND);
+
+ Serial.println(F("Send RC5X with 7.th MSB of command set"));
+ Serial.flush();
+ IrSender.sendRC5(sAddress & 0x1F, (sCommand & 0x3F) + 0x40, sRepeats, true); // 5 address, 7 command bits
+ delay(DELAY_AFTER_SEND);
+
+ Serial.println(F("Send RC6"));
+ Serial.flush();
+ IrSender.sendRC6(sAddress, sCommand, sRepeats, true);
+ delay(DELAY_AFTER_SEND);
+
+ Serial.println(F("Send RC6A with 14 bit 0x2711 as extra"));
+ Serial.flush();
+ IrSender.sendRC6A(sAddress & 0xFF, sCommand, sRepeats, 0x2711, true);
+ delay(DELAY_AFTER_SEND);
+
+ Serial.println(F("Send MagiQuest"));
+ Serial.flush();
+ IrSender.sendMagiQuest(0x6BCD0000 | (uint32_t) sAddress, s16BitCommand); // we have 31 bit address
+ delay(DELAY_AFTER_SEND);
+
+ /*
+ * Next example how to use the IrSender.write function
+ */
+ IRData IRSendData;
+ // prepare data
+ IRSendData.address = sAddress;
+ IRSendData.command = sCommand;
+ IRSendData.flags = IRDATA_FLAGS_EMPTY;
+
+ Serial.println(F("Send next protocols with IrSender.write"));
+ Serial.flush();
+
+ IRSendData.protocol = JVC; // switch protocol
+ Serial.print(F("Send "));
+ Serial.println(getProtocolString(IRSendData.protocol));
+ Serial.flush();
+ IrSender.write(&IRSendData, sRepeats);
+ delay(DELAY_AFTER_SEND);
+
+ IRSendData.command = s16BitCommand; // LG support more than 8 bit command
+
+ IRSendData.protocol = SAMSUNG;
+ Serial.print(F("Send "));
+ Serial.println(getProtocolString(IRSendData.protocol));
+ Serial.flush();
+ IrSender.write(&IRSendData, sRepeats);
+ delay(DELAY_AFTER_SEND);
+
+ IRSendData.protocol = LG;
+ Serial.print(F("Send "));
+ Serial.println(getProtocolString(IRSendData.protocol));
+ Serial.flush();
+ IrSender.write(&IRSendData, sRepeats);
+ delay(DELAY_AFTER_SEND);
+
+ IRSendData.protocol = BOSEWAVE;
+ Serial.println(F("Send Bosewave with no address and 8 command bits"));
+ Serial.flush();
+ IrSender.write(&IRSendData, sRepeats);
+ delay(DELAY_AFTER_SEND);
+
+ IRSendData.protocol = FAST;
+ Serial.print(F("Send "));
+ Serial.println(getProtocolString(IRSendData.protocol));
+ Serial.flush();
+ IrSender.write(&IRSendData, sRepeats);
+ delay(DELAY_AFTER_SEND);
+
+ /*
+ * LEGO is difficult to receive because of its short marks and spaces
+ */
+ Serial.println(F("Send Lego with 2 channel and with 4 command bits"));
+ Serial.flush();
+ IrSender.sendLegoPowerFunctions(sAddress, sCommand, LEGO_MODE_COMBO, true);
+ delay(DELAY_AFTER_SEND);
+
+
+ /*
+ * Force buffer overflow
+ */
+ Serial.println(F("Force buffer overflow by sending 700 marks and spaces"));
+ for (unsigned int i = 0; i < 350; ++i) {
+ // 400 + 400 should be received as 8/8 and sometimes as 9/7 or 7/9 if compensation by MARK_EXCESS_MICROS is optimal.
+ // 210 + 540 = 750 should be received as 5/10 or 4/11 if compensation by MARK_EXCESS_MICROS is optimal.
+ IrSender.mark(210); // 8 pulses at 38 kHz
+ IrSender.space(540); // to fill up to 750 us
+ }
+ delay(DELAY_AFTER_SEND);
+
+ /*
+ * Increment values
+ * Also increment address just for demonstration, which normally makes no sense
+ */
+ sAddress += 0x0101;
+ sCommand += 0x11;
+ s16BitCommand += 0x1111;
+ sRepeats++;
+ // clip repeats at 4
+ if (sRepeats > 4) {
+ sRepeats = 4;
+ }
+
+ delay(DELAY_AFTER_LOOP); // additional delay at the end of each loop
+}
+
diff --git a/libraries/IRremote/examples/SendLGAirConditionerDemo/PinDefinitionsAndMore.h b/libraries/IRremote/examples/SendLGAirConditionerDemo/PinDefinitionsAndMore.h
new file mode 100644
index 0000000..14573c7
--- /dev/null
+++ b/libraries/IRremote/examples/SendLGAirConditionerDemo/PinDefinitionsAndMore.h
@@ -0,0 +1,349 @@
+/*
+ * PinDefinitionsAndMore.h
+ *
+ * Contains pin definitions for IRremote examples for various platforms
+ * as well as definitions for feedback LED and tone() and includes
+ *
+ * Copyright (C) 2021-2023 Armin Joachimsmeyer
+ * armin.joachimsmeyer@gmail.com
+ *
+ * This file is part of IRremote https://github.com/Arduino-IRremote/Arduino-IRremote.
+ *
+ * Arduino-IRremote is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
+ * See the GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see .
+ *
+ */
+
+/*
+ * Pin mapping table for different platforms
+ *
+ * Platform IR input IR output Tone Core/Pin schema
+ * --------------------------------------------------------------
+ * DEFAULT/AVR 2 3 4 Arduino
+ * ATtinyX5 0|PB0 4|PB4 3|PB3 ATTinyCore
+ * ATtiny167 3|PA3 2|PA2 7|PA7 ATTinyCore
+ * ATtiny167 9|PA3 8|PA2 5|PA7 Digispark original core
+ * ATtiny84 |PB2 |PA4 |PA3 ATTinyCore
+ * ATtiny88 3|PD3 4|PD4 9|PB1 ATTinyCore
+ * ATtiny3217 18|PA1 19|PA2 20|PA3 MegaTinyCore
+ * ATtiny1604 2 3|PA5 %
+ * ATtiny816 14|PA1 16|PA3 1|PA5 MegaTinyCore
+ * ATtiny1614 8|PA1 10|PA3 1|PA5 MegaTinyCore
+ * SAMD21 3 4 5
+ * ESP8266 14|D5 12|D6 %
+ * ESP32 15 4 27
+ * ESP32-C3 2 3 4
+ * BluePill PA6 PA7 PA3
+ * APOLLO3 11 12 5
+ * RP2040 3|GPIO15 4|GPIO16 5|GPIO17
+ */
+//#define _IR_MEASURE_TIMING // For debugging purposes.
+
+#if defined(__AVR__)
+#if defined(__AVR_ATtiny25__) || defined(__AVR_ATtiny45__) || defined(__AVR_ATtiny85__) // Digispark board. For use with ATTinyCore.
+#include "ATtinySerialOut.hpp" // TX is at pin 2 - Available as Arduino library "ATtinySerialOut". Saves 700 bytes program memory and 70 bytes RAM for ATtinyCore.
+#define IR_RECEIVE_PIN PIN_PB0
+#define IR_SEND_PIN PIN_PB4 // Pin 2 is serial output with ATtinySerialOut. Pin 1 is internal LED and Pin3 is USB+ with pullup on Digispark board.
+#define TONE_PIN PIN_PB3
+#define _IR_TIMING_TEST_PIN PIN_PB3
+
+# elif defined(__AVR_ATtiny87__) || defined(__AVR_ATtiny167__) // Digispark pro board
+#include "ATtinySerialOut.hpp" // Available as Arduino library "ATtinySerialOut"
+// For ATtiny167 Pins PB6 and PA3 are usable as interrupt source.
+# if defined(ARDUINO_AVR_DIGISPARKPRO)
+// For use with Digispark original core
+#define IR_RECEIVE_PIN 9 // PA3 - on Digispark board labeled as pin 9
+//#define IR_RECEIVE_PIN 14 // PB6 / INT0 is connected to USB+ on DigisparkPro boards
+#define IR_SEND_PIN 8 // PA2 - on Digispark board labeled as pin 8
+#define TONE_PIN 5 // PA7 - on Digispark board labeled as pin 5
+#define _IR_TIMING_TEST_PIN 10 // PA4
+# else
+// For use with ATTinyCore
+#define IR_RECEIVE_PIN PIN_PA3 // On Digispark board labeled as pin 9 - INT0 is connected to USB+ on DigisparkPro boards
+#define IR_SEND_PIN PIN_PA2 // On Digispark board labeled as pin 8
+#define TONE_PIN PIN_PA7 // On Digispark board labeled as pin 5
+# endif
+
+# elif defined(__AVR_ATtiny84__) // For use with ATTinyCore
+#include "ATtinySerialOut.hpp" // Available as Arduino library "ATtinySerialOut". Saves 128 bytes program memory.
+#define IR_RECEIVE_PIN PIN_PB2 // INT0
+#define IR_SEND_PIN PIN_PA4
+#define TONE_PIN PIN_PA3
+#define _IR_TIMING_TEST_PIN PIN_PA5
+
+# elif defined(__AVR_ATtiny88__) // MH-ET Tiny88 board. For use with ATTinyCore.
+#include "ATtinySerialOut.hpp" // Available as Arduino library "ATtinySerialOut". Saves 128 bytes program memory.
+// Pin 6 is TX, pin 7 is RX
+#define IR_RECEIVE_PIN PIN_PD3 // 3 - INT1
+#define IR_SEND_PIN PIN_PD4 // 4
+#define TONE_PIN PIN_PB1 // 9
+#define _IR_TIMING_TEST_PIN PIN_PB0 // 8
+
+# elif defined(__AVR_ATtiny1616__) || defined(__AVR_ATtiny3216__) || defined(__AVR_ATtiny3217__) // For use with megaTinyCore
+// Tiny Core Dev board
+// https://www.tindie.com/products/xkimi/tiny-core-16-dev-board-attiny1616/ - Out of Stock
+// https://www.tindie.com/products/xkimi/tiny-core-32-dev-board-attiny3217/ - Out of Stock
+#define IR_RECEIVE_PIN PIN_PA1 // use 18 instead of PIN_PA1 for TinyCore32
+#define IR_SEND_PIN PIN_PA2 // 19
+#define TONE_PIN PIN_PA3 // 20
+#define APPLICATION_PIN PIN_PA0 // 0
+#undef LED_BUILTIN // No LED available on the TinyCore 32 board, take the one on the programming board which is connected to the DAC output
+#define LED_BUILTIN PIN_PA6 // use 2 instead of PIN_PA6 for TinyCore32
+
+# elif defined(__AVR_ATtiny816__) // For use with megaTinyCore
+#define IR_RECEIVE_PIN PIN_PA1 // 14
+#define IR_SEND_PIN PIN_PA1 // 16
+#define TONE_PIN PIN_PA5 // 1
+#define APPLICATION_PIN PIN_PA4 // 0
+#undef LED_BUILTIN // No LED available, take the one which is connected to the DAC output
+#define LED_BUILTIN PIN_PB5 // 4
+
+# elif defined(__AVR_ATtiny1614__) // For use with megaTinyCore
+#define IR_RECEIVE_PIN PIN_PA1 // 8
+#define IR_SEND_PIN PIN_PA3 // 10
+#define TONE_PIN PIN_PA5 // 1
+#define APPLICATION_PIN PIN_PA4 // 0
+
+# elif defined(__AVR_ATtiny1604__) // For use with megaTinyCore
+#define IR_RECEIVE_PIN PIN_PA6 // 2 - To be compatible with interrupt example, pin 2 is chosen here.
+#define IR_SEND_PIN PIN_PA7 // 3
+#define APPLICATION_PIN PIN_PB2 // 5
+
+#define tone(...) void() // Define as void, since TCB0_INT_vect is also used by tone()
+#define noTone(a) void()
+#define TONE_PIN 42 // Dummy for examples using it
+
+# elif defined(__AVR_ATmega1284__) || defined(__AVR_ATmega1284P__) \
+|| defined(__AVR_ATmega644__) || defined(__AVR_ATmega644P__) \
+|| defined(__AVR_ATmega324P__) || defined(__AVR_ATmega324A__) \
+|| defined(__AVR_ATmega324PA__) || defined(__AVR_ATmega164A__) \
+|| defined(__AVR_ATmega164P__) || defined(__AVR_ATmega32__) \
+|| defined(__AVR_ATmega16__) || defined(__AVR_ATmega8535__) \
+|| defined(__AVR_ATmega64__) || defined(__AVR_ATmega128__) \
+|| defined(__AVR_ATmega1281__) || defined(__AVR_ATmega2561__) \
+|| defined(__AVR_ATmega8515__) || defined(__AVR_ATmega162__)
+#define IR_RECEIVE_PIN 2
+#define IR_SEND_PIN 13
+#define TONE_PIN 4
+#define APPLICATION_PIN 5
+#define ALTERNATIVE_IR_FEEDBACK_LED_PIN 6 // E.g. used for examples which use LED_BUILDIN for example output.
+#define _IR_TIMING_TEST_PIN 7
+
+# else // Default as for ATmega328 like on Uno, Nano, Leonardo, Teensy 2.0 etc.
+#define IR_RECEIVE_PIN 2 // To be compatible with interrupt example, pin 2 is chosen here.
+#define IR_SEND_PIN 3
+#define TONE_PIN 4
+#define APPLICATION_PIN 5
+#define ALTERNATIVE_IR_FEEDBACK_LED_PIN 6 // E.g. used for examples which use LED_BUILDIN for example output.
+#define _IR_TIMING_TEST_PIN 7
+
+# if defined(ARDUINO_AVR_PROMICRO) // Sparkfun Pro Micro is __AVR_ATmega32U4__ but has different external circuit
+// We have no built in LED at pin 13 -> reuse RX LED
+#undef LED_BUILTIN
+#define LED_BUILTIN LED_BUILTIN_RX
+# endif
+# endif // defined(__AVR_ATtiny25__)...
+
+#elif defined(ARDUINO_ARCH_RENESAS_UNO) // Uno R4
+// To be compatible with Uno R3.
+#define IR_RECEIVE_PIN 2
+#define IR_SEND_PIN 3
+#define TONE_PIN 4
+#define APPLICATION_PIN 5
+#define ALTERNATIVE_IR_FEEDBACK_LED_PIN 6 // E.g. used for examples which use LED_BUILDIN for example output.
+#define _IR_TIMING_TEST_PIN 7
+
+#elif defined(ESP8266)
+#define FEEDBACK_LED_IS_ACTIVE_LOW // The LED on my board (D4) is active LOW
+#define IR_RECEIVE_PIN 14 // D5
+#define IR_SEND_PIN 12 // D6 - D4/pin 2 is internal LED
+#define _IR_TIMING_TEST_PIN 2 // D4
+#define APPLICATION_PIN 13 // D7
+
+#define tone(...) void() // tone() inhibits receive timer
+#define noTone(a) void()
+#define TONE_PIN 42 // Dummy for examples using it#
+
+#elif defined(ARDUINO_NOLOGO_ESP32C3_SUPER_MINI)
+#define FEEDBACK_LED_IS_ACTIVE_LOW // The LED on my board (D8) is active LOW
+#define IR_RECEIVE_PIN 2
+#define IR_SEND_PIN 3
+#define TONE_PIN 4
+#define APPLICATION_PIN 10
+
+#elif defined(CONFIG_IDF_TARGET_ESP32C3) || defined(ARDUINO_ESP32C3_DEV)
+#define NO_LED_FEEDBACK_CODE // The WS2812 on pin 8 of AI-C3 board crashes if used as receive feedback LED, other I/O pins are working...
+#define IR_RECEIVE_PIN 6
+#define IR_SEND_PIN 7
+#define TONE_PIN 10
+#define APPLICATION_PIN 18
+
+#elif defined(ESP32)
+#include
+
+// tone() is included in ESP32 core since 2.0.2
+#if !defined(ESP_ARDUINO_VERSION_VAL)
+#define ESP_ARDUINO_VERSION_VAL(major, minor, patch) 12345678
+#endif
+#if ESP_ARDUINO_VERSION <= ESP_ARDUINO_VERSION_VAL(2, 0, 2)
+#define TONE_LEDC_CHANNEL 1 // Using channel 1 makes tone() independent of receiving timer -> No need to stop receiving timer.
+void tone(uint8_t aPinNumber, unsigned int aFrequency){
+ ledcAttachPin(aPinNumber, TONE_LEDC_CHANNEL);
+ ledcWriteTone(TONE_LEDC_CHANNEL, aFrequency);
+}
+void tone(uint8_t aPinNumber, unsigned int aFrequency, unsigned long aDuration){
+ ledcAttachPin(aPinNumber, TONE_LEDC_CHANNEL);
+ ledcWriteTone(TONE_LEDC_CHANNEL, aFrequency);
+ delay(aDuration);
+ ledcWriteTone(TONE_LEDC_CHANNEL, 0);
+}
+void noTone(uint8_t aPinNumber){
+ ledcWriteTone(TONE_LEDC_CHANNEL, 0);
+}
+#endif // ESP_ARDUINO_VERSION <= ESP_ARDUINO_VERSION_VAL(2, 0, 2)
+
+#define IR_RECEIVE_PIN 15 // D15
+#define IR_SEND_PIN 4 // D4
+#define TONE_PIN 27 // D27 25 & 26 are DAC0 and 1
+#define APPLICATION_PIN 16 // RX2 pin
+
+#elif defined(ARDUINO_ARCH_STM32) || defined(ARDUINO_ARCH_STM32F1) // BluePill
+// Timer 3 blocks PA6, PA7, PB0, PB1 for use by Servo or tone()
+#define IR_RECEIVE_PIN PA6
+#define IR_RECEIVE_PIN_STRING "PA6"
+#define IR_SEND_PIN PA7
+#define IR_SEND_PIN_STRING "PA7"
+#define TONE_PIN PA3
+#define _IR_TIMING_TEST_PIN PA5
+#define APPLICATION_PIN PA2
+#define APPLICATION_PIN_STRING "PA2"
+# if defined(ARDUINO_GENERIC_STM32F103C) || defined(ARDUINO_BLUEPILL_F103C8)
+// BluePill LED is active low
+#define FEEDBACK_LED_IS_ACTIVE_LOW
+# endif
+
+#elif defined(ARDUINO_ARCH_APOLLO3) // Sparkfun Apollo boards
+#define IR_RECEIVE_PIN 11
+#define IR_SEND_PIN 12
+#define TONE_PIN 5
+
+#elif defined(ARDUINO_ARCH_MBED) && defined(ARDUINO_ARCH_MBED_NANO) // Arduino Nano 33 BLE and Arduino Nano Connect layout for MBED
+// Must be before ARDUINO_ARCH_RP2040, since it is the layout for the MBED core of Arduino Nano Connect
+#define IR_RECEIVE_PIN 3 // GPIO15 Start with pin 3 since pin 2|GPIO25 is connected to LED on Pi pico
+#define IR_SEND_PIN 4 // GPIO16
+#define TONE_PIN 5
+#define APPLICATION_PIN 6
+#define ALTERNATIVE_IR_FEEDBACK_LED_PIN 7 // E.g. used for examples which use LED_BUILDIN for example output.
+#define _IR_TIMING_TEST_PIN 8
+
+#elif defined(ARDUINO_ARCH_RP2040) // Arduino Nano Connect, Pi Pico with arduino-pico core https://github.com/earlephilhower/arduino-pico
+#define IR_RECEIVE_PIN 15 // GPIO15 to be compatible with the Arduino Nano RP2040 Connect (pin3)
+#define IR_SEND_PIN 16 // GPIO16
+#define TONE_PIN 17
+#define APPLICATION_PIN 18
+#define ALTERNATIVE_IR_FEEDBACK_LED_PIN 19 // E.g. used for examples which use LED_BUILDIN for example output.
+#define _IR_TIMING_TEST_PIN 20
+
+// If you program the Nano RP2040 Connect with this core, then you must redefine LED_BUILTIN
+// and use the external reset with 1 kOhm to ground to enter UF2 mode
+#undef LED_BUILTIN
+#define LED_BUILTIN 6
+
+#elif defined(PARTICLE) // !!!UNTESTED!!!
+#define IR_RECEIVE_PIN A4
+#define IR_SEND_PIN A5 // Particle supports multiple pins
+
+#define LED_BUILTIN D7
+
+/*
+ * 4 times the same (default) layout for easy adaption in the future
+ */
+#elif defined(TEENSYDUINO) // Teensy 2.0 is handled at default for ATmega328 like on Uno, Nano, Leonardo etc.
+#define IR_RECEIVE_PIN 2
+#define IR_SEND_PIN 3
+#define TONE_PIN 4
+#define APPLICATION_PIN 5
+#define ALTERNATIVE_IR_FEEDBACK_LED_PIN 6 // E.g. used for examples which use LED_BUILDIN for example output.
+#define _IR_TIMING_TEST_PIN 7
+
+#elif defined(ARDUINO_ARCH_MBED) // Arduino Nano 33 BLE
+#define IR_RECEIVE_PIN 2
+#define IR_SEND_PIN 3
+#define TONE_PIN 4
+#define APPLICATION_PIN 5
+#define ALTERNATIVE_IR_FEEDBACK_LED_PIN 6 // E.g. used for examples which use LED_BUILDIN for example output.
+#define _IR_TIMING_TEST_PIN 7
+
+#elif defined(ARDUINO_ARCH_SAMD) || defined(ARDUINO_ARCH_SAM)
+#define IR_RECEIVE_PIN 2
+#define IR_SEND_PIN 3
+#define TONE_PIN 4
+#define APPLICATION_PIN 5
+#define ALTERNATIVE_IR_FEEDBACK_LED_PIN 6 // E.g. used for examples which use LED_BUILDIN for example output.
+#define _IR_TIMING_TEST_PIN 7
+
+#if !defined(ARDUINO_SAMD_ADAFRUIT) && !defined(ARDUINO_SEEED_XIAO_M0)
+// On the Zero and others we switch explicitly to SerialUSB
+#define Serial SerialUSB
+#endif
+
+// Definitions for the Chinese SAMD21 M0-Mini clone, which has no led connected to D13/PA17.
+// Attention!!! D2 and D4 are swapped on these boards!!!
+// If you connect the LED, it is on pin 24/PB11. In this case activate the next two lines.
+//#undef LED_BUILTIN
+//#define LED_BUILTIN 24 // PB11
+// As an alternative you can choose pin 25, it is the RX-LED pin (PB03), but active low.In this case activate the next 3 lines.
+//#undef LED_BUILTIN
+//#define LED_BUILTIN 25 // PB03
+//#define FEEDBACK_LED_IS_ACTIVE_LOW // The RX LED on the M0-Mini is active LOW
+
+#elif defined (NRF51) // BBC micro:bit
+#define IR_RECEIVE_PIN 2
+#define IR_SEND_PIN 3
+#define APPLICATION_PIN 1
+#define _IR_TIMING_TEST_PIN 4
+
+#define tone(...) void() // no tone() available
+#define noTone(a) void()
+#define TONE_PIN 42 // Dummy for examples using it
+
+#else
+#warning Board / CPU is not detected using pre-processor symbols -> using default values, which may not fit. Please extend PinDefinitionsAndMore.h.
+// Default valued for unidentified boards
+#define IR_RECEIVE_PIN 2
+#define IR_SEND_PIN 3
+#define TONE_PIN 4
+#define APPLICATION_PIN 5
+#define ALTERNATIVE_IR_FEEDBACK_LED_PIN 6 // E.g. used for examples which use LED_BUILDIN for example output.
+#define _IR_TIMING_TEST_PIN 7
+#endif // defined(ESP8266)
+
+#if defined(ESP32) || defined(ARDUINO_ARCH_RP2040) || defined(PARTICLE) || defined(ARDUINO_ARCH_MBED)
+#define SEND_PWM_BY_TIMER // We do not have pin restrictions for this CPU's, so lets use the hardware PWM for send carrier signal generation
+#else
+# if defined(SEND_PWM_BY_TIMER)
+#undef IR_SEND_PIN // SendPin is determined by timer! This avoids warnings in IRremote.hpp and IRTimer.hpp
+# endif
+#endif
+
+#if !defined (FLASHEND)
+#define FLASHEND 0xFFFF // Dummy value for platforms where FLASHEND is not defined
+#endif
+
+/*
+ * Helper macro for getting a macro definition as string
+ */
+#if !defined(STR_HELPER)
+#define STR_HELPER(x) #x
+#define STR(x) STR_HELPER(x)
+#endif
diff --git a/libraries/IRremote/examples/SendLGAirConditionerDemo/Readme.md b/libraries/IRremote/examples/SendLGAirConditionerDemo/Readme.md
new file mode 100644
index 0000000..ad16367
--- /dev/null
+++ b/libraries/IRremote/examples/SendLGAirConditionerDemo/Readme.md
@@ -0,0 +1,93 @@
+=== decoding for LG A/C ====
+- 1) remote of LG AC has two type of HDR mark/space, 8000/4000 and 3100/10000
+- 2) HDR 8000/4000 is decoded using decodeLG(IRrecvDumpV2) without problem
+- 3) for HDR 3100/10000, use AnalysIR's code : http://www.analysir.com/blog/2014/03/19/air-conditioners-problems-recording-long-infrared-remote-control-signals-arduino/
+- 4) for bin output based on AnalysIR's code : https://gist.github.com/chaeplin/a3a4b4b6b887c663bfe8
+- 5) remove first two byte(11)
+- 6) sample rawcode with bin output : https://gist.github.com/chaeplin/134d232e0b8cfb898860
+
+
+=== *** ===
+- 1) Sample raw code : https://gist.github.com/chaeplin/ab2a7ad1533c41260f0d
+- 2) send raw code : https://gist.github.com/chaeplin/7c800d3166463bb51be4
+
+
+=== *** ===
+- (0) : Cooling or Heating
+- (1) : fixed address
+- (2) : fixed address
+- (3) : special(power, swing, air clean)
+- (4) : change air flow, temperature, cooling(0)/heating(4)
+- (5) : temperature ( 15 + (5) = )
+- (6) : air flow
+- (7) : checksum ( 3 + 4 + 5 + 6 ) & B00001111
+
+
+°F = °C × 1.8 + 32
+°C = (°F - 32) / 1.8
+
+
+=== *** ===
+* remote / Korea / without heating
+
+| status |(0)| (1)| (2)| (3)| (4)| (5)| (6)| (7)
+|----------------|---|----|----|----|----|----|----|----
+| on / 25 / mid | C |1000|1000|0000|0000|1010|0010|1100
+| on / 26 / mid | C |1000|1000|0000|0000|1011|0010|1101
+| on / 27 / mid | C |1000|1000|0000|0000|1100|0010|1110
+| on / 28 / mid | C |1000|1000|0000|0000|1101|0010|1111
+| on / 25 / high | C |1000|1000|0000|0000|1010|0100|1110
+| on / 26 / high | C |1000|1000|0000|0000|1011|0100|1111
+| on / 27 / high | C |1000|1000|0000|0000|1100|0100|0000
+| on / 28 / high | C |1000|1000|0000|0000|1101|0100|0001
+|----------------|---|----|----|----|----|----|----|----
+| 1 up | C |1000|1000|0000|1000|1101|0100|1001
+|----------------|---|----|----|----|----|----|----|----
+| Cool power | C |1000|1000|0001|0000|0000|1100|1101
+| energy saving | C |1000|1000|0001|0000|0000|0100|0101
+| power | C |1000|1000|0001|0000|0000|1000|1001
+| flow/up/down | C |1000|1000|0001|0011|0001|0100|1001
+| up/down off | C |1000|1000|0001|0011|0001|0101|1010
+| flow/left/right| C |1000|1000|0001|0011|0001|0110|1011
+| left/right off | C |1000|1000|0001|0011|0001|0111|1100
+|----------------|---|----|----|----|----|----|----|----
+| Air clean | C |1000|1000|1100|0000|0000|0000|1100
+|----------------|---|----|----|----|----|----|----|----
+| off | C |1000|1000|1100|0000|0000|0101|0001
+
+
+
+* remote / with heating
+* converted using raw code at https://github.com/chaeplin/RaspAC/blob/master/lircd.conf
+
+| status |(0)| (1)| (2)| (3)| (4)| (5)| (6)| (7)
+|----------------|---|----|----|----|----|----|----|----
+| on | C |1000|1000|0000|0000|1011|0010|1101
+|----------------|---|----|----|----|----|----|----|----
+| off | C |1000|1000|1100|0000|0000|0101|0001
+|----------------|---|----|----|----|----|----|----|----
+| 64 / 18 | C |1000|1000|0000|0000|0011|0100|0111
+| 66 / 19 | C |1000|1000|0000|0000|0100|0100|1000
+| 68 / 20 | C |1000|1000|0000|0000|0101|0100|1001
+| 70 / 21 | C |1000|1000|0000|0000|0110|0100|1010
+| 72 / 22 | C |1000|1000|0000|0000|0111|0100|1011
+| 74 / 23 | C |1000|1000|0000|0000|1000|0100|1100
+| 76 / 25 | C |1000|1000|0000|0000|1010|0100|1110
+| 78 / 26 | C |1000|1000|0000|0000|1011|0100|1111
+| 80 / 27 | C |1000|1000|0000|0000|1100|0100|0000
+| 82 / 28 | C |1000|1000|0000|0000|1101|0100|0001
+| 84 / 29 | C |1000|1000|0000|0000|1110|0100|0010
+| 86 / 30 | C |1000|1000|0000|0000|1111|0100|0011
+|----------------|---|----|----|----|----|----|----|----
+| heat64 | H |1000|1000|0000|0100|0011|0100|1011
+| heat66 | H |1000|1000|0000|0100|0100|0100|1100
+| heat68 | H |1000|1000|0000|0100|0101|0100|1101
+| heat70 | H |1000|1000|0000|0100|0110|0100|1110
+| heat72 | H |1000|1000|0000|0100|0111|0100|1111
+| heat74 | H |1000|1000|0000|0100|1000|0100|0000
+| heat76 | H |1000|1000|0000|0100|1001|0100|0001
+| heat78 | H |1000|1000|0000|0100|1011|0100|0011
+| heat80 | H |1000|1000|0000|0100|1100|0100|0100
+| heat82 | H |1000|1000|0000|0100|1101|0100|0101
+| heat84 | H |1000|1000|0000|0100|1110|0100|0110
+| heat86 | H |1000|1000|0000|0100|1111|0100|0111
diff --git a/libraries/IRremote/examples/SendLGAirConditionerDemo/SendLGAirConditionerDemo.ino b/libraries/IRremote/examples/SendLGAirConditionerDemo/SendLGAirConditionerDemo.ino
new file mode 100644
index 0000000..dd8dd11
--- /dev/null
+++ b/libraries/IRremote/examples/SendLGAirConditionerDemo/SendLGAirConditionerDemo.ino
@@ -0,0 +1,153 @@
+/*
+ * SendLGAirConditionerDemo.cpp
+ *
+ * Sending LG air conditioner IR codes controlled by Serial input
+ * Based on he old IRremote source from https://github.com/chaeplin
+ *
+ * This file is part of Arduino-IRremote https://github.com/Arduino-IRremote/Arduino-IRremote.
+ *
+ ************************************************************************************
+ * MIT License
+ *
+ * Copyright (c) 2020-2022 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.
+ *
+ ************************************************************************************
+ */
+#include
+
+/*
+ * LG2 has different header timing and a shorter bit time
+ * Known LG remote controls, which uses LG2 protocol are:
+ * AKB75215403
+ * AKB74955603
+ * AKB73757604:
+ */
+//#define USE_LG2_PROTOCOL // Try it if you do not have success with the default LG protocol
+#define NUMBER_OF_COMMANDS_BETWEEN_PRINT_OF_MENU 5
+
+#define INFO // Deactivate this to save program memory and suppress info output from the LG-AC driver.
+//#define DEBUG // Activate this for more output from the LG-AC driver.
+
+/*
+ * Helper macro for getting a macro definition as string
+ */
+#if !defined(STR_HELPER)
+#define STR_HELPER(x) #x
+#define STR(x) STR_HELPER(x)
+#endif
+
+#define IR_SEND_PIN 3 // P0_0
+
+#include
+
+
+#include "ac_LG.hpp"
+
+#define SIZE_OF_RECEIVE_BUFFER 10
+char sRequestString[SIZE_OF_RECEIVE_BUFFER];
+
+Aircondition_LG MyLG_Aircondition;
+
+void setup() {
+ pinMode(LED_BUILTIN, OUTPUT);
+
+ Serial.begin(9600);
+ while (!Serial)
+ ; // Wait for Serial to become available. Is optimized away for some cores.
+
+
+// Just to know which program is running on my Arduino
+ Serial.println(F("START " __FILE__ " from " __DATE__ "\r\nUsing library version " VERSION_IRREMOTE));
+ Serial.println(F("Send IR signals at pin " STR(IR_SEND_PIN)));
+
+ /*
+ * The IR library setup. That's all!
+ */
+ IrSender.begin(); // Start with IR_SEND_PIN as send pin and enable feedback LED at default feedback LED pin
+
+ Serial.println();
+ MyLG_Aircondition.setType(LG_IS_WALL_TYPE);
+ MyLG_Aircondition.printMenu(&Serial);
+
+ delay(1000);
+
+// test
+// MyLG_Aircondition.sendCommandAndParameter('j', 1);
+// delay(5000);
+// MyLG_Aircondition.sendCommandAndParameter('f', 3);
+// delay(5000);
+
+}
+
+void loop() {
+ static uint8_t sShowmenuConter = 0;
+
+ if (Serial.available()) {
+ /*
+ * Get parameters from serial
+ */
+ uint8_t tNumberOfBytesReceived = Serial.readBytesUntil('\n', sRequestString, SIZE_OF_RECEIVE_BUFFER - 1);
+ // handle CR LF
+ if (sRequestString[tNumberOfBytesReceived - 1] == '\r') {
+ tNumberOfBytesReceived--;
+ }
+ sRequestString[tNumberOfBytesReceived] = '\0'; // terminate as string
+ char tCommand = sRequestString[0];
+
+ /*
+ * Handle parameter numbers which can be greater 9
+ */
+ int tParameter = 0;
+ if (tNumberOfBytesReceived >= 2) {
+ tParameter = sRequestString[1] - '0';
+ if (tCommand == LG_COMMAND_TEMPERATURE || tCommand == LG_COMMAND_SWING || tCommand == LG_COMMAND_SLEEP
+ || tCommand == LG_COMMAND_TIMER_ON || tCommand == LG_COMMAND_TIMER_OFF) {
+ tParameter = atoi(&sRequestString[1]);
+ }
+ }
+
+ /*
+ * Print command to send
+ */
+ Serial.println();
+ Serial.print(F("Command="));
+ Serial.print(tCommand);
+ if (tParameter != 0) {
+ Serial.print(F(" Parameter="));
+ Serial.print(tParameter);
+ }
+ Serial.println();
+
+ if (!MyLG_Aircondition.sendCommandAndParameter(tCommand, tParameter)) {
+ Serial.print(F("Error: unknown command or invalid parameter in \""));
+ Serial.print(sRequestString);
+ Serial.println('\"');
+ }
+
+ if (sShowmenuConter == 0) {
+ MyLG_Aircondition.printMenu(&Serial);
+ sShowmenuConter = NUMBER_OF_COMMANDS_BETWEEN_PRINT_OF_MENU;
+ } else {
+ sShowmenuConter--;
+ }
+ }
+ delay(100);
+}
+
diff --git a/libraries/IRremote/examples/SendProntoDemo/PinDefinitionsAndMore.h b/libraries/IRremote/examples/SendProntoDemo/PinDefinitionsAndMore.h
new file mode 100644
index 0000000..14573c7
--- /dev/null
+++ b/libraries/IRremote/examples/SendProntoDemo/PinDefinitionsAndMore.h
@@ -0,0 +1,349 @@
+/*
+ * PinDefinitionsAndMore.h
+ *
+ * Contains pin definitions for IRremote examples for various platforms
+ * as well as definitions for feedback LED and tone() and includes
+ *
+ * Copyright (C) 2021-2023 Armin Joachimsmeyer
+ * armin.joachimsmeyer@gmail.com
+ *
+ * This file is part of IRremote https://github.com/Arduino-IRremote/Arduino-IRremote.
+ *
+ * Arduino-IRremote is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
+ * See the GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see .
+ *
+ */
+
+/*
+ * Pin mapping table for different platforms
+ *
+ * Platform IR input IR output Tone Core/Pin schema
+ * --------------------------------------------------------------
+ * DEFAULT/AVR 2 3 4 Arduino
+ * ATtinyX5 0|PB0 4|PB4 3|PB3 ATTinyCore
+ * ATtiny167 3|PA3 2|PA2 7|PA7 ATTinyCore
+ * ATtiny167 9|PA3 8|PA2 5|PA7 Digispark original core
+ * ATtiny84 |PB2 |PA4 |PA3 ATTinyCore
+ * ATtiny88 3|PD3 4|PD4 9|PB1 ATTinyCore
+ * ATtiny3217 18|PA1 19|PA2 20|PA3 MegaTinyCore
+ * ATtiny1604 2 3|PA5 %
+ * ATtiny816 14|PA1 16|PA3 1|PA5 MegaTinyCore
+ * ATtiny1614 8|PA1 10|PA3 1|PA5 MegaTinyCore
+ * SAMD21 3 4 5
+ * ESP8266 14|D5 12|D6 %
+ * ESP32 15 4 27
+ * ESP32-C3 2 3 4
+ * BluePill PA6 PA7 PA3
+ * APOLLO3 11 12 5
+ * RP2040 3|GPIO15 4|GPIO16 5|GPIO17
+ */
+//#define _IR_MEASURE_TIMING // For debugging purposes.
+
+#if defined(__AVR__)
+#if defined(__AVR_ATtiny25__) || defined(__AVR_ATtiny45__) || defined(__AVR_ATtiny85__) // Digispark board. For use with ATTinyCore.
+#include "ATtinySerialOut.hpp" // TX is at pin 2 - Available as Arduino library "ATtinySerialOut". Saves 700 bytes program memory and 70 bytes RAM for ATtinyCore.
+#define IR_RECEIVE_PIN PIN_PB0
+#define IR_SEND_PIN PIN_PB4 // Pin 2 is serial output with ATtinySerialOut. Pin 1 is internal LED and Pin3 is USB+ with pullup on Digispark board.
+#define TONE_PIN PIN_PB3
+#define _IR_TIMING_TEST_PIN PIN_PB3
+
+# elif defined(__AVR_ATtiny87__) || defined(__AVR_ATtiny167__) // Digispark pro board
+#include "ATtinySerialOut.hpp" // Available as Arduino library "ATtinySerialOut"
+// For ATtiny167 Pins PB6 and PA3 are usable as interrupt source.
+# if defined(ARDUINO_AVR_DIGISPARKPRO)
+// For use with Digispark original core
+#define IR_RECEIVE_PIN 9 // PA3 - on Digispark board labeled as pin 9
+//#define IR_RECEIVE_PIN 14 // PB6 / INT0 is connected to USB+ on DigisparkPro boards
+#define IR_SEND_PIN 8 // PA2 - on Digispark board labeled as pin 8
+#define TONE_PIN 5 // PA7 - on Digispark board labeled as pin 5
+#define _IR_TIMING_TEST_PIN 10 // PA4
+# else
+// For use with ATTinyCore
+#define IR_RECEIVE_PIN PIN_PA3 // On Digispark board labeled as pin 9 - INT0 is connected to USB+ on DigisparkPro boards
+#define IR_SEND_PIN PIN_PA2 // On Digispark board labeled as pin 8
+#define TONE_PIN PIN_PA7 // On Digispark board labeled as pin 5
+# endif
+
+# elif defined(__AVR_ATtiny84__) // For use with ATTinyCore
+#include "ATtinySerialOut.hpp" // Available as Arduino library "ATtinySerialOut". Saves 128 bytes program memory.
+#define IR_RECEIVE_PIN PIN_PB2 // INT0
+#define IR_SEND_PIN PIN_PA4
+#define TONE_PIN PIN_PA3
+#define _IR_TIMING_TEST_PIN PIN_PA5
+
+# elif defined(__AVR_ATtiny88__) // MH-ET Tiny88 board. For use with ATTinyCore.
+#include "ATtinySerialOut.hpp" // Available as Arduino library "ATtinySerialOut". Saves 128 bytes program memory.
+// Pin 6 is TX, pin 7 is RX
+#define IR_RECEIVE_PIN PIN_PD3 // 3 - INT1
+#define IR_SEND_PIN PIN_PD4 // 4
+#define TONE_PIN PIN_PB1 // 9
+#define _IR_TIMING_TEST_PIN PIN_PB0 // 8
+
+# elif defined(__AVR_ATtiny1616__) || defined(__AVR_ATtiny3216__) || defined(__AVR_ATtiny3217__) // For use with megaTinyCore
+// Tiny Core Dev board
+// https://www.tindie.com/products/xkimi/tiny-core-16-dev-board-attiny1616/ - Out of Stock
+// https://www.tindie.com/products/xkimi/tiny-core-32-dev-board-attiny3217/ - Out of Stock
+#define IR_RECEIVE_PIN PIN_PA1 // use 18 instead of PIN_PA1 for TinyCore32
+#define IR_SEND_PIN PIN_PA2 // 19
+#define TONE_PIN PIN_PA3 // 20
+#define APPLICATION_PIN PIN_PA0 // 0
+#undef LED_BUILTIN // No LED available on the TinyCore 32 board, take the one on the programming board which is connected to the DAC output
+#define LED_BUILTIN PIN_PA6 // use 2 instead of PIN_PA6 for TinyCore32
+
+# elif defined(__AVR_ATtiny816__) // For use with megaTinyCore
+#define IR_RECEIVE_PIN PIN_PA1 // 14
+#define IR_SEND_PIN PIN_PA1 // 16
+#define TONE_PIN PIN_PA5 // 1
+#define APPLICATION_PIN PIN_PA4 // 0
+#undef LED_BUILTIN // No LED available, take the one which is connected to the DAC output
+#define LED_BUILTIN PIN_PB5 // 4
+
+# elif defined(__AVR_ATtiny1614__) // For use with megaTinyCore
+#define IR_RECEIVE_PIN PIN_PA1 // 8
+#define IR_SEND_PIN PIN_PA3 // 10
+#define TONE_PIN PIN_PA5 // 1
+#define APPLICATION_PIN PIN_PA4 // 0
+
+# elif defined(__AVR_ATtiny1604__) // For use with megaTinyCore
+#define IR_RECEIVE_PIN PIN_PA6 // 2 - To be compatible with interrupt example, pin 2 is chosen here.
+#define IR_SEND_PIN PIN_PA7 // 3
+#define APPLICATION_PIN PIN_PB2 // 5
+
+#define tone(...) void() // Define as void, since TCB0_INT_vect is also used by tone()
+#define noTone(a) void()
+#define TONE_PIN 42 // Dummy for examples using it
+
+# elif defined(__AVR_ATmega1284__) || defined(__AVR_ATmega1284P__) \
+|| defined(__AVR_ATmega644__) || defined(__AVR_ATmega644P__) \
+|| defined(__AVR_ATmega324P__) || defined(__AVR_ATmega324A__) \
+|| defined(__AVR_ATmega324PA__) || defined(__AVR_ATmega164A__) \
+|| defined(__AVR_ATmega164P__) || defined(__AVR_ATmega32__) \
+|| defined(__AVR_ATmega16__) || defined(__AVR_ATmega8535__) \
+|| defined(__AVR_ATmega64__) || defined(__AVR_ATmega128__) \
+|| defined(__AVR_ATmega1281__) || defined(__AVR_ATmega2561__) \
+|| defined(__AVR_ATmega8515__) || defined(__AVR_ATmega162__)
+#define IR_RECEIVE_PIN 2
+#define IR_SEND_PIN 13
+#define TONE_PIN 4
+#define APPLICATION_PIN 5
+#define ALTERNATIVE_IR_FEEDBACK_LED_PIN 6 // E.g. used for examples which use LED_BUILDIN for example output.
+#define _IR_TIMING_TEST_PIN 7
+
+# else // Default as for ATmega328 like on Uno, Nano, Leonardo, Teensy 2.0 etc.
+#define IR_RECEIVE_PIN 2 // To be compatible with interrupt example, pin 2 is chosen here.
+#define IR_SEND_PIN 3
+#define TONE_PIN 4
+#define APPLICATION_PIN 5
+#define ALTERNATIVE_IR_FEEDBACK_LED_PIN 6 // E.g. used for examples which use LED_BUILDIN for example output.
+#define _IR_TIMING_TEST_PIN 7
+
+# if defined(ARDUINO_AVR_PROMICRO) // Sparkfun Pro Micro is __AVR_ATmega32U4__ but has different external circuit
+// We have no built in LED at pin 13 -> reuse RX LED
+#undef LED_BUILTIN
+#define LED_BUILTIN LED_BUILTIN_RX
+# endif
+# endif // defined(__AVR_ATtiny25__)...
+
+#elif defined(ARDUINO_ARCH_RENESAS_UNO) // Uno R4
+// To be compatible with Uno R3.
+#define IR_RECEIVE_PIN 2
+#define IR_SEND_PIN 3
+#define TONE_PIN 4
+#define APPLICATION_PIN 5
+#define ALTERNATIVE_IR_FEEDBACK_LED_PIN 6 // E.g. used for examples which use LED_BUILDIN for example output.
+#define _IR_TIMING_TEST_PIN 7
+
+#elif defined(ESP8266)
+#define FEEDBACK_LED_IS_ACTIVE_LOW // The LED on my board (D4) is active LOW
+#define IR_RECEIVE_PIN 14 // D5
+#define IR_SEND_PIN 12 // D6 - D4/pin 2 is internal LED
+#define _IR_TIMING_TEST_PIN 2 // D4
+#define APPLICATION_PIN 13 // D7
+
+#define tone(...) void() // tone() inhibits receive timer
+#define noTone(a) void()
+#define TONE_PIN 42 // Dummy for examples using it#
+
+#elif defined(ARDUINO_NOLOGO_ESP32C3_SUPER_MINI)
+#define FEEDBACK_LED_IS_ACTIVE_LOW // The LED on my board (D8) is active LOW
+#define IR_RECEIVE_PIN 2
+#define IR_SEND_PIN 3
+#define TONE_PIN 4
+#define APPLICATION_PIN 10
+
+#elif defined(CONFIG_IDF_TARGET_ESP32C3) || defined(ARDUINO_ESP32C3_DEV)
+#define NO_LED_FEEDBACK_CODE // The WS2812 on pin 8 of AI-C3 board crashes if used as receive feedback LED, other I/O pins are working...
+#define IR_RECEIVE_PIN 6
+#define IR_SEND_PIN 7
+#define TONE_PIN 10
+#define APPLICATION_PIN 18
+
+#elif defined(ESP32)
+#include
+
+// tone() is included in ESP32 core since 2.0.2
+#if !defined(ESP_ARDUINO_VERSION_VAL)
+#define ESP_ARDUINO_VERSION_VAL(major, minor, patch) 12345678
+#endif
+#if ESP_ARDUINO_VERSION <= ESP_ARDUINO_VERSION_VAL(2, 0, 2)
+#define TONE_LEDC_CHANNEL 1 // Using channel 1 makes tone() independent of receiving timer -> No need to stop receiving timer.
+void tone(uint8_t aPinNumber, unsigned int aFrequency){
+ ledcAttachPin(aPinNumber, TONE_LEDC_CHANNEL);
+ ledcWriteTone(TONE_LEDC_CHANNEL, aFrequency);
+}
+void tone(uint8_t aPinNumber, unsigned int aFrequency, unsigned long aDuration){
+ ledcAttachPin(aPinNumber, TONE_LEDC_CHANNEL);
+ ledcWriteTone(TONE_LEDC_CHANNEL, aFrequency);
+ delay(aDuration);
+ ledcWriteTone(TONE_LEDC_CHANNEL, 0);
+}
+void noTone(uint8_t aPinNumber){
+ ledcWriteTone(TONE_LEDC_CHANNEL, 0);
+}
+#endif // ESP_ARDUINO_VERSION <= ESP_ARDUINO_VERSION_VAL(2, 0, 2)
+
+#define IR_RECEIVE_PIN 15 // D15
+#define IR_SEND_PIN 4 // D4
+#define TONE_PIN 27 // D27 25 & 26 are DAC0 and 1
+#define APPLICATION_PIN 16 // RX2 pin
+
+#elif defined(ARDUINO_ARCH_STM32) || defined(ARDUINO_ARCH_STM32F1) // BluePill
+// Timer 3 blocks PA6, PA7, PB0, PB1 for use by Servo or tone()
+#define IR_RECEIVE_PIN PA6
+#define IR_RECEIVE_PIN_STRING "PA6"
+#define IR_SEND_PIN PA7
+#define IR_SEND_PIN_STRING "PA7"
+#define TONE_PIN PA3
+#define _IR_TIMING_TEST_PIN PA5
+#define APPLICATION_PIN PA2
+#define APPLICATION_PIN_STRING "PA2"
+# if defined(ARDUINO_GENERIC_STM32F103C) || defined(ARDUINO_BLUEPILL_F103C8)
+// BluePill LED is active low
+#define FEEDBACK_LED_IS_ACTIVE_LOW
+# endif
+
+#elif defined(ARDUINO_ARCH_APOLLO3) // Sparkfun Apollo boards
+#define IR_RECEIVE_PIN 11
+#define IR_SEND_PIN 12
+#define TONE_PIN 5
+
+#elif defined(ARDUINO_ARCH_MBED) && defined(ARDUINO_ARCH_MBED_NANO) // Arduino Nano 33 BLE and Arduino Nano Connect layout for MBED
+// Must be before ARDUINO_ARCH_RP2040, since it is the layout for the MBED core of Arduino Nano Connect
+#define IR_RECEIVE_PIN 3 // GPIO15 Start with pin 3 since pin 2|GPIO25 is connected to LED on Pi pico
+#define IR_SEND_PIN 4 // GPIO16
+#define TONE_PIN 5
+#define APPLICATION_PIN 6
+#define ALTERNATIVE_IR_FEEDBACK_LED_PIN 7 // E.g. used for examples which use LED_BUILDIN for example output.
+#define _IR_TIMING_TEST_PIN 8
+
+#elif defined(ARDUINO_ARCH_RP2040) // Arduino Nano Connect, Pi Pico with arduino-pico core https://github.com/earlephilhower/arduino-pico
+#define IR_RECEIVE_PIN 15 // GPIO15 to be compatible with the Arduino Nano RP2040 Connect (pin3)
+#define IR_SEND_PIN 16 // GPIO16
+#define TONE_PIN 17
+#define APPLICATION_PIN 18
+#define ALTERNATIVE_IR_FEEDBACK_LED_PIN 19 // E.g. used for examples which use LED_BUILDIN for example output.
+#define _IR_TIMING_TEST_PIN 20
+
+// If you program the Nano RP2040 Connect with this core, then you must redefine LED_BUILTIN
+// and use the external reset with 1 kOhm to ground to enter UF2 mode
+#undef LED_BUILTIN
+#define LED_BUILTIN 6
+
+#elif defined(PARTICLE) // !!!UNTESTED!!!
+#define IR_RECEIVE_PIN A4
+#define IR_SEND_PIN A5 // Particle supports multiple pins
+
+#define LED_BUILTIN D7
+
+/*
+ * 4 times the same (default) layout for easy adaption in the future
+ */
+#elif defined(TEENSYDUINO) // Teensy 2.0 is handled at default for ATmega328 like on Uno, Nano, Leonardo etc.
+#define IR_RECEIVE_PIN 2
+#define IR_SEND_PIN 3
+#define TONE_PIN 4
+#define APPLICATION_PIN 5
+#define ALTERNATIVE_IR_FEEDBACK_LED_PIN 6 // E.g. used for examples which use LED_BUILDIN for example output.
+#define _IR_TIMING_TEST_PIN 7
+
+#elif defined(ARDUINO_ARCH_MBED) // Arduino Nano 33 BLE
+#define IR_RECEIVE_PIN 2
+#define IR_SEND_PIN 3
+#define TONE_PIN 4
+#define APPLICATION_PIN 5
+#define ALTERNATIVE_IR_FEEDBACK_LED_PIN 6 // E.g. used for examples which use LED_BUILDIN for example output.
+#define _IR_TIMING_TEST_PIN 7
+
+#elif defined(ARDUINO_ARCH_SAMD) || defined(ARDUINO_ARCH_SAM)
+#define IR_RECEIVE_PIN 2
+#define IR_SEND_PIN 3
+#define TONE_PIN 4
+#define APPLICATION_PIN 5
+#define ALTERNATIVE_IR_FEEDBACK_LED_PIN 6 // E.g. used for examples which use LED_BUILDIN for example output.
+#define _IR_TIMING_TEST_PIN 7
+
+#if !defined(ARDUINO_SAMD_ADAFRUIT) && !defined(ARDUINO_SEEED_XIAO_M0)
+// On the Zero and others we switch explicitly to SerialUSB
+#define Serial SerialUSB
+#endif
+
+// Definitions for the Chinese SAMD21 M0-Mini clone, which has no led connected to D13/PA17.
+// Attention!!! D2 and D4 are swapped on these boards!!!
+// If you connect the LED, it is on pin 24/PB11. In this case activate the next two lines.
+//#undef LED_BUILTIN
+//#define LED_BUILTIN 24 // PB11
+// As an alternative you can choose pin 25, it is the RX-LED pin (PB03), but active low.In this case activate the next 3 lines.
+//#undef LED_BUILTIN
+//#define LED_BUILTIN 25 // PB03
+//#define FEEDBACK_LED_IS_ACTIVE_LOW // The RX LED on the M0-Mini is active LOW
+
+#elif defined (NRF51) // BBC micro:bit
+#define IR_RECEIVE_PIN 2
+#define IR_SEND_PIN 3
+#define APPLICATION_PIN 1
+#define _IR_TIMING_TEST_PIN 4
+
+#define tone(...) void() // no tone() available
+#define noTone(a) void()
+#define TONE_PIN 42 // Dummy for examples using it
+
+#else
+#warning Board / CPU is not detected using pre-processor symbols -> using default values, which may not fit. Please extend PinDefinitionsAndMore.h.
+// Default valued for unidentified boards
+#define IR_RECEIVE_PIN 2
+#define IR_SEND_PIN 3
+#define TONE_PIN 4
+#define APPLICATION_PIN 5
+#define ALTERNATIVE_IR_FEEDBACK_LED_PIN 6 // E.g. used for examples which use LED_BUILDIN for example output.
+#define _IR_TIMING_TEST_PIN 7
+#endif // defined(ESP8266)
+
+#if defined(ESP32) || defined(ARDUINO_ARCH_RP2040) || defined(PARTICLE) || defined(ARDUINO_ARCH_MBED)
+#define SEND_PWM_BY_TIMER // We do not have pin restrictions for this CPU's, so lets use the hardware PWM for send carrier signal generation
+#else
+# if defined(SEND_PWM_BY_TIMER)
+#undef IR_SEND_PIN // SendPin is determined by timer! This avoids warnings in IRremote.hpp and IRTimer.hpp
+# endif
+#endif
+
+#if !defined (FLASHEND)
+#define FLASHEND 0xFFFF // Dummy value for platforms where FLASHEND is not defined
+#endif
+
+/*
+ * Helper macro for getting a macro definition as string
+ */
+#if !defined(STR_HELPER)
+#define STR_HELPER(x) #x
+#define STR(x) STR_HELPER(x)
+#endif
diff --git a/libraries/IRremote/examples/SendProntoDemo/SendProntoDemo.ino b/libraries/IRremote/examples/SendProntoDemo/SendProntoDemo.ino
new file mode 100644
index 0000000..fe53aee
--- /dev/null
+++ b/libraries/IRremote/examples/SendProntoDemo/SendProntoDemo.ino
@@ -0,0 +1,100 @@
+/*
+ * SendProntoDemo.cpp
+ *
+ * Example for sending pronto codes with the IRremote library.
+ * The code used here, sends NEC protocol data.
+ *
+ * This file is part of Arduino-IRremote https://github.com/Arduino-IRremote/Arduino-IRremote.
+ *
+ ************************************************************************************
+ * MIT License
+ *
+ * Copyright (c) 2020-2022 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.
+ *
+ ************************************************************************************
+ */
+#include
+
+#define IR_SEND_PIN 3 // P0_0
+
+/*
+ * Helper macro for getting a macro definition as string
+ */
+#if !defined(STR_HELPER)
+#define STR_HELPER(x) #x
+#define STR(x) STR_HELPER(x)
+#endif
+
+#include
+
+#define NUMBER_OF_REPEATS 3U
+
+// The first number, here 0000, denotes the type of the signal. 0000 denotes a raw IR signal with modulation.
+// The second number, here 006C, denotes a frequency code. 006C corresponds to 1000000/(0x006c * 0.241246) = 38381 Hertz.
+// The third and the forth number denote the number of pairs (= half the number of durations) in the start- and the repeat sequence respectively.
+const char yamahaVolDown[]
+= "0000 006C 0022 0002 015B 00AD " /* Pronto header + start bit */
+ "0016 0016 0016 0041 0016 0016 0016 0041 0016 0041 0016 0041 0016 0041 0016 0016 " /* Lower address byte */
+ "0016 0041 0016 0016 0016 0041 0016 0016 0016 0016 0016 0016 0016 0016 0016 0041 " /* Upper address byte (inverted at 8 bit mode) */
+ "0016 0041 0016 0041 0016 0016 0016 0041 0016 0041 0016 0016 0016 0016 0016 0016 " /* command byte */
+ "0016 0016 0016 0016 0016 0041 0016 0016 0016 0016 0016 0041 0016 0041 0016 0041 0016 05F7 " /* inverted command byte + stop bit */
+ "015B 0057 0016 0E6C"; /* NEC repeat pattern*/
+
+IRsend irsend;
+
+void setup() {
+ Serial.begin(9600);
+ while (!Serial)
+ ; // Wait for Serial to become available. Is optimized away for some cores.
+
+ // Just to know which program is running on my Arduino
+ Serial.println(F("START " __FILE__ " from " __DATE__ "\r\nUsing library version " VERSION_IRREMOTE));
+ Serial.println(F("Send IR signals at pin " STR(IR_SEND_PIN)));
+
+ IrSender.begin(); // Start with IR_SEND_PIN as send pin and enable feedback LED at default feedback LED pin
+}
+
+void loop() {
+ Serial.println(F("Sending from normal memory"));
+ irsend.sendPronto(yamahaVolDown, NUMBER_OF_REPEATS);
+
+ delay(2000);
+ Serial.println(F("Sending the NEC using the F()-form: address 0x5, data 0x1A"));
+ irsend.sendPronto(F("0000 006C 0022 0002 015B 00AD " /* Pronto header + start bit */
+ "0016 0016 0016 0041 0016 0016 0016 0041 0016 0041 0016 0041 0016 0041 0016 0041 " /* Lower address byte */
+ "0016 0041 0016 0016 0016 0041 0016 0016 0016 0016 0016 0016 0016 0016 0016 0016 " /* Upper address byte (inverted at 8 bit mode) */
+ "0016 0016 0016 0041 0016 0016 0016 0041 0016 0041 0016 0016 0016 0016 0016 0016 " /* command byte */
+ "0016 0041 0016 0016 0016 0041 0016 0016 0016 0016 0016 0041 0016 0041 0016 0041 0016 05F7 " /* inverted command byte + stop bit */
+ "015B 0057 0016 0E6C"), /* NEC repeat pattern*/
+ NUMBER_OF_REPEATS);
+ delay(2000);
+
+ // send Nec code acquired by IRreceiveDump.cpp
+ Serial.println(F("Sending NEC from RAM: address 0xFF00, data 0x15"));
+ // 006D -> 38029 Hz
+ irsend.sendPronto("0000 006D 0022 0000 015C 00AB " /* Pronto header + start bit */
+ "0017 0015 0017 0015 0017 0015 0017 0015 0017 0015 0017 0015 0017 0015 0017 0015 " /* Lower address byte */
+ "0017 003F 0017 003E 0017 003F 0017 003E 0017 003F 0015 003F 0017 003F 0015 003F " /* Upper address byte (inverted at 8 bit mode) */
+ "0017 003E 0017 0015 0017 003F 0017 0015 0017 003E 0017 0015 0017 0017 0015 0017 " /* command byte */
+ "0017 0015 0017 003E 0017 0015 0017 003F 0015 0017 0017 003E 0017 003F 0015 003F 0017 0806" /* inverted command byte + stop bit */
+ , 0); // No repeat possible, because of missing repeat pattern
+
+ delay(5000);
+}
diff --git a/libraries/IRremote/examples/SendRawDemo/PinDefinitionsAndMore.h b/libraries/IRremote/examples/SendRawDemo/PinDefinitionsAndMore.h
new file mode 100644
index 0000000..14573c7
--- /dev/null
+++ b/libraries/IRremote/examples/SendRawDemo/PinDefinitionsAndMore.h
@@ -0,0 +1,349 @@
+/*
+ * PinDefinitionsAndMore.h
+ *
+ * Contains pin definitions for IRremote examples for various platforms
+ * as well as definitions for feedback LED and tone() and includes
+ *
+ * Copyright (C) 2021-2023 Armin Joachimsmeyer
+ * armin.joachimsmeyer@gmail.com
+ *
+ * This file is part of IRremote https://github.com/Arduino-IRremote/Arduino-IRremote.
+ *
+ * Arduino-IRremote is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
+ * See the GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see .
+ *
+ */
+
+/*
+ * Pin mapping table for different platforms
+ *
+ * Platform IR input IR output Tone Core/Pin schema
+ * --------------------------------------------------------------
+ * DEFAULT/AVR 2 3 4 Arduino
+ * ATtinyX5 0|PB0 4|PB4 3|PB3 ATTinyCore
+ * ATtiny167 3|PA3 2|PA2 7|PA7 ATTinyCore
+ * ATtiny167 9|PA3 8|PA2 5|PA7 Digispark original core
+ * ATtiny84 |PB2 |PA4 |PA3 ATTinyCore
+ * ATtiny88 3|PD3 4|PD4 9|PB1 ATTinyCore
+ * ATtiny3217 18|PA1 19|PA2 20|PA3 MegaTinyCore
+ * ATtiny1604 2 3|PA5 %
+ * ATtiny816 14|PA1 16|PA3 1|PA5 MegaTinyCore
+ * ATtiny1614 8|PA1 10|PA3 1|PA5 MegaTinyCore
+ * SAMD21 3 4 5
+ * ESP8266 14|D5 12|D6 %
+ * ESP32 15 4 27
+ * ESP32-C3 2 3 4
+ * BluePill PA6 PA7 PA3
+ * APOLLO3 11 12 5
+ * RP2040 3|GPIO15 4|GPIO16 5|GPIO17
+ */
+//#define _IR_MEASURE_TIMING // For debugging purposes.
+
+#if defined(__AVR__)
+#if defined(__AVR_ATtiny25__) || defined(__AVR_ATtiny45__) || defined(__AVR_ATtiny85__) // Digispark board. For use with ATTinyCore.
+#include "ATtinySerialOut.hpp" // TX is at pin 2 - Available as Arduino library "ATtinySerialOut". Saves 700 bytes program memory and 70 bytes RAM for ATtinyCore.
+#define IR_RECEIVE_PIN PIN_PB0
+#define IR_SEND_PIN PIN_PB4 // Pin 2 is serial output with ATtinySerialOut. Pin 1 is internal LED and Pin3 is USB+ with pullup on Digispark board.
+#define TONE_PIN PIN_PB3
+#define _IR_TIMING_TEST_PIN PIN_PB3
+
+# elif defined(__AVR_ATtiny87__) || defined(__AVR_ATtiny167__) // Digispark pro board
+#include "ATtinySerialOut.hpp" // Available as Arduino library "ATtinySerialOut"
+// For ATtiny167 Pins PB6 and PA3 are usable as interrupt source.
+# if defined(ARDUINO_AVR_DIGISPARKPRO)
+// For use with Digispark original core
+#define IR_RECEIVE_PIN 9 // PA3 - on Digispark board labeled as pin 9
+//#define IR_RECEIVE_PIN 14 // PB6 / INT0 is connected to USB+ on DigisparkPro boards
+#define IR_SEND_PIN 8 // PA2 - on Digispark board labeled as pin 8
+#define TONE_PIN 5 // PA7 - on Digispark board labeled as pin 5
+#define _IR_TIMING_TEST_PIN 10 // PA4
+# else
+// For use with ATTinyCore
+#define IR_RECEIVE_PIN PIN_PA3 // On Digispark board labeled as pin 9 - INT0 is connected to USB+ on DigisparkPro boards
+#define IR_SEND_PIN PIN_PA2 // On Digispark board labeled as pin 8
+#define TONE_PIN PIN_PA7 // On Digispark board labeled as pin 5
+# endif
+
+# elif defined(__AVR_ATtiny84__) // For use with ATTinyCore
+#include "ATtinySerialOut.hpp" // Available as Arduino library "ATtinySerialOut". Saves 128 bytes program memory.
+#define IR_RECEIVE_PIN PIN_PB2 // INT0
+#define IR_SEND_PIN PIN_PA4
+#define TONE_PIN PIN_PA3
+#define _IR_TIMING_TEST_PIN PIN_PA5
+
+# elif defined(__AVR_ATtiny88__) // MH-ET Tiny88 board. For use with ATTinyCore.
+#include "ATtinySerialOut.hpp" // Available as Arduino library "ATtinySerialOut". Saves 128 bytes program memory.
+// Pin 6 is TX, pin 7 is RX
+#define IR_RECEIVE_PIN PIN_PD3 // 3 - INT1
+#define IR_SEND_PIN PIN_PD4 // 4
+#define TONE_PIN PIN_PB1 // 9
+#define _IR_TIMING_TEST_PIN PIN_PB0 // 8
+
+# elif defined(__AVR_ATtiny1616__) || defined(__AVR_ATtiny3216__) || defined(__AVR_ATtiny3217__) // For use with megaTinyCore
+// Tiny Core Dev board
+// https://www.tindie.com/products/xkimi/tiny-core-16-dev-board-attiny1616/ - Out of Stock
+// https://www.tindie.com/products/xkimi/tiny-core-32-dev-board-attiny3217/ - Out of Stock
+#define IR_RECEIVE_PIN PIN_PA1 // use 18 instead of PIN_PA1 for TinyCore32
+#define IR_SEND_PIN PIN_PA2 // 19
+#define TONE_PIN PIN_PA3 // 20
+#define APPLICATION_PIN PIN_PA0 // 0
+#undef LED_BUILTIN // No LED available on the TinyCore 32 board, take the one on the programming board which is connected to the DAC output
+#define LED_BUILTIN PIN_PA6 // use 2 instead of PIN_PA6 for TinyCore32
+
+# elif defined(__AVR_ATtiny816__) // For use with megaTinyCore
+#define IR_RECEIVE_PIN PIN_PA1 // 14
+#define IR_SEND_PIN PIN_PA1 // 16
+#define TONE_PIN PIN_PA5 // 1
+#define APPLICATION_PIN PIN_PA4 // 0
+#undef LED_BUILTIN // No LED available, take the one which is connected to the DAC output
+#define LED_BUILTIN PIN_PB5 // 4
+
+# elif defined(__AVR_ATtiny1614__) // For use with megaTinyCore
+#define IR_RECEIVE_PIN PIN_PA1 // 8
+#define IR_SEND_PIN PIN_PA3 // 10
+#define TONE_PIN PIN_PA5 // 1
+#define APPLICATION_PIN PIN_PA4 // 0
+
+# elif defined(__AVR_ATtiny1604__) // For use with megaTinyCore
+#define IR_RECEIVE_PIN PIN_PA6 // 2 - To be compatible with interrupt example, pin 2 is chosen here.
+#define IR_SEND_PIN PIN_PA7 // 3
+#define APPLICATION_PIN PIN_PB2 // 5
+
+#define tone(...) void() // Define as void, since TCB0_INT_vect is also used by tone()
+#define noTone(a) void()
+#define TONE_PIN 42 // Dummy for examples using it
+
+# elif defined(__AVR_ATmega1284__) || defined(__AVR_ATmega1284P__) \
+|| defined(__AVR_ATmega644__) || defined(__AVR_ATmega644P__) \
+|| defined(__AVR_ATmega324P__) || defined(__AVR_ATmega324A__) \
+|| defined(__AVR_ATmega324PA__) || defined(__AVR_ATmega164A__) \
+|| defined(__AVR_ATmega164P__) || defined(__AVR_ATmega32__) \
+|| defined(__AVR_ATmega16__) || defined(__AVR_ATmega8535__) \
+|| defined(__AVR_ATmega64__) || defined(__AVR_ATmega128__) \
+|| defined(__AVR_ATmega1281__) || defined(__AVR_ATmega2561__) \
+|| defined(__AVR_ATmega8515__) || defined(__AVR_ATmega162__)
+#define IR_RECEIVE_PIN 2
+#define IR_SEND_PIN 13
+#define TONE_PIN 4
+#define APPLICATION_PIN 5
+#define ALTERNATIVE_IR_FEEDBACK_LED_PIN 6 // E.g. used for examples which use LED_BUILDIN for example output.
+#define _IR_TIMING_TEST_PIN 7
+
+# else // Default as for ATmega328 like on Uno, Nano, Leonardo, Teensy 2.0 etc.
+#define IR_RECEIVE_PIN 2 // To be compatible with interrupt example, pin 2 is chosen here.
+#define IR_SEND_PIN 3
+#define TONE_PIN 4
+#define APPLICATION_PIN 5
+#define ALTERNATIVE_IR_FEEDBACK_LED_PIN 6 // E.g. used for examples which use LED_BUILDIN for example output.
+#define _IR_TIMING_TEST_PIN 7
+
+# if defined(ARDUINO_AVR_PROMICRO) // Sparkfun Pro Micro is __AVR_ATmega32U4__ but has different external circuit
+// We have no built in LED at pin 13 -> reuse RX LED
+#undef LED_BUILTIN
+#define LED_BUILTIN LED_BUILTIN_RX
+# endif
+# endif // defined(__AVR_ATtiny25__)...
+
+#elif defined(ARDUINO_ARCH_RENESAS_UNO) // Uno R4
+// To be compatible with Uno R3.
+#define IR_RECEIVE_PIN 2
+#define IR_SEND_PIN 3
+#define TONE_PIN 4
+#define APPLICATION_PIN 5
+#define ALTERNATIVE_IR_FEEDBACK_LED_PIN 6 // E.g. used for examples which use LED_BUILDIN for example output.
+#define _IR_TIMING_TEST_PIN 7
+
+#elif defined(ESP8266)
+#define FEEDBACK_LED_IS_ACTIVE_LOW // The LED on my board (D4) is active LOW
+#define IR_RECEIVE_PIN 14 // D5
+#define IR_SEND_PIN 12 // D6 - D4/pin 2 is internal LED
+#define _IR_TIMING_TEST_PIN 2 // D4
+#define APPLICATION_PIN 13 // D7
+
+#define tone(...) void() // tone() inhibits receive timer
+#define noTone(a) void()
+#define TONE_PIN 42 // Dummy for examples using it#
+
+#elif defined(ARDUINO_NOLOGO_ESP32C3_SUPER_MINI)
+#define FEEDBACK_LED_IS_ACTIVE_LOW // The LED on my board (D8) is active LOW
+#define IR_RECEIVE_PIN 2
+#define IR_SEND_PIN 3
+#define TONE_PIN 4
+#define APPLICATION_PIN 10
+
+#elif defined(CONFIG_IDF_TARGET_ESP32C3) || defined(ARDUINO_ESP32C3_DEV)
+#define NO_LED_FEEDBACK_CODE // The WS2812 on pin 8 of AI-C3 board crashes if used as receive feedback LED, other I/O pins are working...
+#define IR_RECEIVE_PIN 6
+#define IR_SEND_PIN 7
+#define TONE_PIN 10
+#define APPLICATION_PIN 18
+
+#elif defined(ESP32)
+#include
+
+// tone() is included in ESP32 core since 2.0.2
+#if !defined(ESP_ARDUINO_VERSION_VAL)
+#define ESP_ARDUINO_VERSION_VAL(major, minor, patch) 12345678
+#endif
+#if ESP_ARDUINO_VERSION <= ESP_ARDUINO_VERSION_VAL(2, 0, 2)
+#define TONE_LEDC_CHANNEL 1 // Using channel 1 makes tone() independent of receiving timer -> No need to stop receiving timer.
+void tone(uint8_t aPinNumber, unsigned int aFrequency){
+ ledcAttachPin(aPinNumber, TONE_LEDC_CHANNEL);
+ ledcWriteTone(TONE_LEDC_CHANNEL, aFrequency);
+}
+void tone(uint8_t aPinNumber, unsigned int aFrequency, unsigned long aDuration){
+ ledcAttachPin(aPinNumber, TONE_LEDC_CHANNEL);
+ ledcWriteTone(TONE_LEDC_CHANNEL, aFrequency);
+ delay(aDuration);
+ ledcWriteTone(TONE_LEDC_CHANNEL, 0);
+}
+void noTone(uint8_t aPinNumber){
+ ledcWriteTone(TONE_LEDC_CHANNEL, 0);
+}
+#endif // ESP_ARDUINO_VERSION <= ESP_ARDUINO_VERSION_VAL(2, 0, 2)
+
+#define IR_RECEIVE_PIN 15 // D15
+#define IR_SEND_PIN 4 // D4
+#define TONE_PIN 27 // D27 25 & 26 are DAC0 and 1
+#define APPLICATION_PIN 16 // RX2 pin
+
+#elif defined(ARDUINO_ARCH_STM32) || defined(ARDUINO_ARCH_STM32F1) // BluePill
+// Timer 3 blocks PA6, PA7, PB0, PB1 for use by Servo or tone()
+#define IR_RECEIVE_PIN PA6
+#define IR_RECEIVE_PIN_STRING "PA6"
+#define IR_SEND_PIN PA7
+#define IR_SEND_PIN_STRING "PA7"
+#define TONE_PIN PA3
+#define _IR_TIMING_TEST_PIN PA5
+#define APPLICATION_PIN PA2
+#define APPLICATION_PIN_STRING "PA2"
+# if defined(ARDUINO_GENERIC_STM32F103C) || defined(ARDUINO_BLUEPILL_F103C8)
+// BluePill LED is active low
+#define FEEDBACK_LED_IS_ACTIVE_LOW
+# endif
+
+#elif defined(ARDUINO_ARCH_APOLLO3) // Sparkfun Apollo boards
+#define IR_RECEIVE_PIN 11
+#define IR_SEND_PIN 12
+#define TONE_PIN 5
+
+#elif defined(ARDUINO_ARCH_MBED) && defined(ARDUINO_ARCH_MBED_NANO) // Arduino Nano 33 BLE and Arduino Nano Connect layout for MBED
+// Must be before ARDUINO_ARCH_RP2040, since it is the layout for the MBED core of Arduino Nano Connect
+#define IR_RECEIVE_PIN 3 // GPIO15 Start with pin 3 since pin 2|GPIO25 is connected to LED on Pi pico
+#define IR_SEND_PIN 4 // GPIO16
+#define TONE_PIN 5
+#define APPLICATION_PIN 6
+#define ALTERNATIVE_IR_FEEDBACK_LED_PIN 7 // E.g. used for examples which use LED_BUILDIN for example output.
+#define _IR_TIMING_TEST_PIN 8
+
+#elif defined(ARDUINO_ARCH_RP2040) // Arduino Nano Connect, Pi Pico with arduino-pico core https://github.com/earlephilhower/arduino-pico
+#define IR_RECEIVE_PIN 15 // GPIO15 to be compatible with the Arduino Nano RP2040 Connect (pin3)
+#define IR_SEND_PIN 16 // GPIO16
+#define TONE_PIN 17
+#define APPLICATION_PIN 18
+#define ALTERNATIVE_IR_FEEDBACK_LED_PIN 19 // E.g. used for examples which use LED_BUILDIN for example output.
+#define _IR_TIMING_TEST_PIN 20
+
+// If you program the Nano RP2040 Connect with this core, then you must redefine LED_BUILTIN
+// and use the external reset with 1 kOhm to ground to enter UF2 mode
+#undef LED_BUILTIN
+#define LED_BUILTIN 6
+
+#elif defined(PARTICLE) // !!!UNTESTED!!!
+#define IR_RECEIVE_PIN A4
+#define IR_SEND_PIN A5 // Particle supports multiple pins
+
+#define LED_BUILTIN D7
+
+/*
+ * 4 times the same (default) layout for easy adaption in the future
+ */
+#elif defined(TEENSYDUINO) // Teensy 2.0 is handled at default for ATmega328 like on Uno, Nano, Leonardo etc.
+#define IR_RECEIVE_PIN 2
+#define IR_SEND_PIN 3
+#define TONE_PIN 4
+#define APPLICATION_PIN 5
+#define ALTERNATIVE_IR_FEEDBACK_LED_PIN 6 // E.g. used for examples which use LED_BUILDIN for example output.
+#define _IR_TIMING_TEST_PIN 7
+
+#elif defined(ARDUINO_ARCH_MBED) // Arduino Nano 33 BLE
+#define IR_RECEIVE_PIN 2
+#define IR_SEND_PIN 3
+#define TONE_PIN 4
+#define APPLICATION_PIN 5
+#define ALTERNATIVE_IR_FEEDBACK_LED_PIN 6 // E.g. used for examples which use LED_BUILDIN for example output.
+#define _IR_TIMING_TEST_PIN 7
+
+#elif defined(ARDUINO_ARCH_SAMD) || defined(ARDUINO_ARCH_SAM)
+#define IR_RECEIVE_PIN 2
+#define IR_SEND_PIN 3
+#define TONE_PIN 4
+#define APPLICATION_PIN 5
+#define ALTERNATIVE_IR_FEEDBACK_LED_PIN 6 // E.g. used for examples which use LED_BUILDIN for example output.
+#define _IR_TIMING_TEST_PIN 7
+
+#if !defined(ARDUINO_SAMD_ADAFRUIT) && !defined(ARDUINO_SEEED_XIAO_M0)
+// On the Zero and others we switch explicitly to SerialUSB
+#define Serial SerialUSB
+#endif
+
+// Definitions for the Chinese SAMD21 M0-Mini clone, which has no led connected to D13/PA17.
+// Attention!!! D2 and D4 are swapped on these boards!!!
+// If you connect the LED, it is on pin 24/PB11. In this case activate the next two lines.
+//#undef LED_BUILTIN
+//#define LED_BUILTIN 24 // PB11
+// As an alternative you can choose pin 25, it is the RX-LED pin (PB03), but active low.In this case activate the next 3 lines.
+//#undef LED_BUILTIN
+//#define LED_BUILTIN 25 // PB03
+//#define FEEDBACK_LED_IS_ACTIVE_LOW // The RX LED on the M0-Mini is active LOW
+
+#elif defined (NRF51) // BBC micro:bit
+#define IR_RECEIVE_PIN 2
+#define IR_SEND_PIN 3
+#define APPLICATION_PIN 1
+#define _IR_TIMING_TEST_PIN 4
+
+#define tone(...) void() // no tone() available
+#define noTone(a) void()
+#define TONE_PIN 42 // Dummy for examples using it
+
+#else
+#warning Board / CPU is not detected using pre-processor symbols -> using default values, which may not fit. Please extend PinDefinitionsAndMore.h.
+// Default valued for unidentified boards
+#define IR_RECEIVE_PIN 2
+#define IR_SEND_PIN 3
+#define TONE_PIN 4
+#define APPLICATION_PIN 5
+#define ALTERNATIVE_IR_FEEDBACK_LED_PIN 6 // E.g. used for examples which use LED_BUILDIN for example output.
+#define _IR_TIMING_TEST_PIN 7
+#endif // defined(ESP8266)
+
+#if defined(ESP32) || defined(ARDUINO_ARCH_RP2040) || defined(PARTICLE) || defined(ARDUINO_ARCH_MBED)
+#define SEND_PWM_BY_TIMER // We do not have pin restrictions for this CPU's, so lets use the hardware PWM for send carrier signal generation
+#else
+# if defined(SEND_PWM_BY_TIMER)
+#undef IR_SEND_PIN // SendPin is determined by timer! This avoids warnings in IRremote.hpp and IRTimer.hpp
+# endif
+#endif
+
+#if !defined (FLASHEND)
+#define FLASHEND 0xFFFF // Dummy value for platforms where FLASHEND is not defined
+#endif
+
+/*
+ * Helper macro for getting a macro definition as string
+ */
+#if !defined(STR_HELPER)
+#define STR_HELPER(x) #x
+#define STR(x) STR_HELPER(x)
+#endif
diff --git a/libraries/IRremote/examples/SendRawDemo/SendRawDemo.ino b/libraries/IRremote/examples/SendRawDemo/SendRawDemo.ino
new file mode 100644
index 0000000..8e14f0a
--- /dev/null
+++ b/libraries/IRremote/examples/SendRawDemo/SendRawDemo.ino
@@ -0,0 +1,124 @@
+/*
+ * SendRawDemo.cpp - demonstrates sending IR codes with sendRaw
+ *
+ * This example shows how to send a RAW signal using the IRremote library.
+ * The example signal is actually a 32 bit NEC signal.
+ * Protocol=NEC Address=0x4 Command=0x18 Raw-Data=0xE718FB04 32 bits LSB first
+ *
+ * If it is a supported protocol, it is more efficient to use the protocol send function
+ * (here sendNEC) to send the signal.
+ *
+ * This file is part of Arduino-IRremote https://github.com/Arduino-IRremote/Arduino-IRremote.
+ *
+ ************************************************************************************
+ * MIT License
+ *
+ * Copyright (c) 2020-2024 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.
+ *
+ ************************************************************************************
+ */
+#include
+
+
+//#define SEND_PWM_BY_TIMER // Disable carrier PWM generation in software and use (restricted) hardware PWM.
+//#define USE_NO_SEND_PWM // Use no carrier PWM, just simulate an active low receiver signal. Overrides SEND_PWM_BY_TIMER definition
+//#define NO_LED_FEEDBACK_CODE // Saves 566 bytes program memory
+
+#define IR_SEND_PIN 3 // P0_0
+/*
+ * Helper macro for getting a macro definition as string
+ */
+#if !defined(STR_HELPER)
+#define STR_HELPER(x) #x
+#define STR(x) STR_HELPER(x)
+#endif
+
+#include
+
+void setup() {
+ pinMode(LED_BUILTIN, OUTPUT);
+
+ Serial.begin(9600);
+ while (!Serial)
+ ; // Wait for Serial to become available. Is optimized away for some cores.
+
+ // Just to know which program is running on my Arduino
+ Serial.println(F("START " __FILE__ " from " __DATE__ "\r\nUsing library version " VERSION_IRREMOTE));
+ Serial.println(F("Send IR signals at pin " STR(IR_SEND_PIN)));
+
+ IrSender.begin(); // Start with IR_SEND_PIN as send pin and enable feedback LED at default feedback LED pin
+}
+
+/*
+ * NEC address=0x04 (0xFB04), command=0x18 (0xE718)
+ *
+ * This is the raw data array in byte format.
+ * The uint8_t/byte elements contain the number of ticks in 50 us.
+ * The uint16_t format contains the (number of ticks * 50) if generated by IRremote,
+ * so the uint16_t format has exact the same resolution but requires double space.
+ * With the uint16_t format, you are able to modify the timings to meet the standards,
+ * e.g. use 560 (instead of 11 * 50) for NEC or use 432 for Panasonic. But in this cases,
+ * you better use the timing generation functions e.g. sendNEC() directly.
+ */
+const uint8_t rawDataP[] =
+ { 180, 90 /*Start bit*/, 11, 11, 11, 11, 11, 34, 11, 11/*0010 0x4 of 8 bit address LSB first*/, 11, 11, 11, 11, 11, 11, 11,
+ 11/*0000*/, 11, 34, 11, 34, 11, 11, 11, 34/*1101 0xB*/, 11, 34, 11, 34, 11, 34, 11, 34/*1111*/, 11, 11, 11, 11, 11, 11, 11,
+ 34/*0001 0x08 of command LSB first*/, 11, 34, 11, 11, 11, 11, 11, 11/*1000 0x01*/, 11, 34, 11, 34, 11, 34, 11,
+ 11/*1110 Inverted 8 of command*/, 11, 11, 11, 34, 11, 34, 11, 34/*0111 inverted 1 of command*/, 11 /*stop bit*/};
+
+/*
+ * The same frame as above. Values are NOT multiple of 50, but are taken from the NEC timing definitions
+ */
+const uint16_t rawData[] = { 9000, 4500/*Start bit*/, 560, 560, 560, 560, 560, 1690, 560,
+ 560/*0010 0x4 of 8 bit address LSB first*/, 560, 560, 560, 560, 560, 560, 560, 560/*0000*/, 560, 1690, 560, 1690, 560, 560,
+ 560, 1690/*1101 0xB - inverted 0x04*/, 560, 1690, 560, 1690, 560, 1690, 560, 1690/*1111 - inverted 0*/, 560, 560, 560, 560,
+ 560, 560, 560, 1690/*0001 0x08 of command LSB first*/, 560, 1690, 560, 560, 560, 560, 560, 560/*1000 0x01*/, 560, 1690, 560,
+ 1690, 560, 1690, 560, 560/*1110 Inverted 8 of command*/, 560, 560, 560, 1690, 560, 1690, 560,
+ 1690/*1111 inverted 0 of command*/, 560 /*stop bit*/}; // Using exact NEC timing
+
+void loop() {
+ /*
+ * Send hand crafted data from RAM
+ */
+ Serial.println(F("Send NEC 8 bit address=0x04 (0xFB04) and command 0x18 (0xE718) with exact timing (16 bit array format)"));
+ Serial.flush();
+ IrSender.sendRaw(rawData, sizeof(rawData) / sizeof(rawData[0]), NEC_KHZ); // Note the approach used to automatically calculate the size of the array.
+
+ delay(1000); // delay must be greater than 8 ms (RECORD_GAP_MICROS), otherwise the receiver sees it as one long signal
+
+ /*
+ * Send byte data direct from FLASH
+ * Note the approach used to automatically calculate the size of the array.
+ */
+ Serial.println(F("Send NEC 8 bit address 0x04 and command 0x18 with (50 us) tick resolution timing (8 bit array format) "));
+ Serial.flush();
+ IrSender.sendRaw_P(rawDataP, sizeof(rawDataP) / sizeof(rawDataP[0]), NEC_KHZ);
+
+ delay(1000); // delay must be greater than 8 ms (RECORD_GAP_MICROS), otherwise the receiver sees it as one long signal
+
+ /*
+ * Send the same frame using NEC encoder
+ */
+ Serial.println(F("Send NEC 16 bit address 0x04, 8 bit command 0x18 with NEC encoder"));
+ Serial.flush();
+ IrSender.sendNEC(0x04, 0x18, 0);
+
+ delay(3000);
+}
diff --git a/libraries/IRremote/examples/SimpleReceiver/PinDefinitionsAndMore.h b/libraries/IRremote/examples/SimpleReceiver/PinDefinitionsAndMore.h
new file mode 100644
index 0000000..14573c7
--- /dev/null
+++ b/libraries/IRremote/examples/SimpleReceiver/PinDefinitionsAndMore.h
@@ -0,0 +1,349 @@
+/*
+ * PinDefinitionsAndMore.h
+ *
+ * Contains pin definitions for IRremote examples for various platforms
+ * as well as definitions for feedback LED and tone() and includes
+ *
+ * Copyright (C) 2021-2023 Armin Joachimsmeyer
+ * armin.joachimsmeyer@gmail.com
+ *
+ * This file is part of IRremote https://github.com/Arduino-IRremote/Arduino-IRremote.
+ *
+ * Arduino-IRremote is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
+ * See the GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see .
+ *
+ */
+
+/*
+ * Pin mapping table for different platforms
+ *
+ * Platform IR input IR output Tone Core/Pin schema
+ * --------------------------------------------------------------
+ * DEFAULT/AVR 2 3 4 Arduino
+ * ATtinyX5 0|PB0 4|PB4 3|PB3 ATTinyCore
+ * ATtiny167 3|PA3 2|PA2 7|PA7 ATTinyCore
+ * ATtiny167 9|PA3 8|PA2 5|PA7 Digispark original core
+ * ATtiny84 |PB2 |PA4 |PA3 ATTinyCore
+ * ATtiny88 3|PD3 4|PD4 9|PB1 ATTinyCore
+ * ATtiny3217 18|PA1 19|PA2 20|PA3 MegaTinyCore
+ * ATtiny1604 2 3|PA5 %
+ * ATtiny816 14|PA1 16|PA3 1|PA5 MegaTinyCore
+ * ATtiny1614 8|PA1 10|PA3 1|PA5 MegaTinyCore
+ * SAMD21 3 4 5
+ * ESP8266 14|D5 12|D6 %
+ * ESP32 15 4 27
+ * ESP32-C3 2 3 4
+ * BluePill PA6 PA7 PA3
+ * APOLLO3 11 12 5
+ * RP2040 3|GPIO15 4|GPIO16 5|GPIO17
+ */
+//#define _IR_MEASURE_TIMING // For debugging purposes.
+
+#if defined(__AVR__)
+#if defined(__AVR_ATtiny25__) || defined(__AVR_ATtiny45__) || defined(__AVR_ATtiny85__) // Digispark board. For use with ATTinyCore.
+#include "ATtinySerialOut.hpp" // TX is at pin 2 - Available as Arduino library "ATtinySerialOut". Saves 700 bytes program memory and 70 bytes RAM for ATtinyCore.
+#define IR_RECEIVE_PIN PIN_PB0
+#define IR_SEND_PIN PIN_PB4 // Pin 2 is serial output with ATtinySerialOut. Pin 1 is internal LED and Pin3 is USB+ with pullup on Digispark board.
+#define TONE_PIN PIN_PB3
+#define _IR_TIMING_TEST_PIN PIN_PB3
+
+# elif defined(__AVR_ATtiny87__) || defined(__AVR_ATtiny167__) // Digispark pro board
+#include "ATtinySerialOut.hpp" // Available as Arduino library "ATtinySerialOut"
+// For ATtiny167 Pins PB6 and PA3 are usable as interrupt source.
+# if defined(ARDUINO_AVR_DIGISPARKPRO)
+// For use with Digispark original core
+#define IR_RECEIVE_PIN 9 // PA3 - on Digispark board labeled as pin 9
+//#define IR_RECEIVE_PIN 14 // PB6 / INT0 is connected to USB+ on DigisparkPro boards
+#define IR_SEND_PIN 8 // PA2 - on Digispark board labeled as pin 8
+#define TONE_PIN 5 // PA7 - on Digispark board labeled as pin 5
+#define _IR_TIMING_TEST_PIN 10 // PA4
+# else
+// For use with ATTinyCore
+#define IR_RECEIVE_PIN PIN_PA3 // On Digispark board labeled as pin 9 - INT0 is connected to USB+ on DigisparkPro boards
+#define IR_SEND_PIN PIN_PA2 // On Digispark board labeled as pin 8
+#define TONE_PIN PIN_PA7 // On Digispark board labeled as pin 5
+# endif
+
+# elif defined(__AVR_ATtiny84__) // For use with ATTinyCore
+#include "ATtinySerialOut.hpp" // Available as Arduino library "ATtinySerialOut". Saves 128 bytes program memory.
+#define IR_RECEIVE_PIN PIN_PB2 // INT0
+#define IR_SEND_PIN PIN_PA4
+#define TONE_PIN PIN_PA3
+#define _IR_TIMING_TEST_PIN PIN_PA5
+
+# elif defined(__AVR_ATtiny88__) // MH-ET Tiny88 board. For use with ATTinyCore.
+#include "ATtinySerialOut.hpp" // Available as Arduino library "ATtinySerialOut". Saves 128 bytes program memory.
+// Pin 6 is TX, pin 7 is RX
+#define IR_RECEIVE_PIN PIN_PD3 // 3 - INT1
+#define IR_SEND_PIN PIN_PD4 // 4
+#define TONE_PIN PIN_PB1 // 9
+#define _IR_TIMING_TEST_PIN PIN_PB0 // 8
+
+# elif defined(__AVR_ATtiny1616__) || defined(__AVR_ATtiny3216__) || defined(__AVR_ATtiny3217__) // For use with megaTinyCore
+// Tiny Core Dev board
+// https://www.tindie.com/products/xkimi/tiny-core-16-dev-board-attiny1616/ - Out of Stock
+// https://www.tindie.com/products/xkimi/tiny-core-32-dev-board-attiny3217/ - Out of Stock
+#define IR_RECEIVE_PIN PIN_PA1 // use 18 instead of PIN_PA1 for TinyCore32
+#define IR_SEND_PIN PIN_PA2 // 19
+#define TONE_PIN PIN_PA3 // 20
+#define APPLICATION_PIN PIN_PA0 // 0
+#undef LED_BUILTIN // No LED available on the TinyCore 32 board, take the one on the programming board which is connected to the DAC output
+#define LED_BUILTIN PIN_PA6 // use 2 instead of PIN_PA6 for TinyCore32
+
+# elif defined(__AVR_ATtiny816__) // For use with megaTinyCore
+#define IR_RECEIVE_PIN PIN_PA1 // 14
+#define IR_SEND_PIN PIN_PA1 // 16
+#define TONE_PIN PIN_PA5 // 1
+#define APPLICATION_PIN PIN_PA4 // 0
+#undef LED_BUILTIN // No LED available, take the one which is connected to the DAC output
+#define LED_BUILTIN PIN_PB5 // 4
+
+# elif defined(__AVR_ATtiny1614__) // For use with megaTinyCore
+#define IR_RECEIVE_PIN PIN_PA1 // 8
+#define IR_SEND_PIN PIN_PA3 // 10
+#define TONE_PIN PIN_PA5 // 1
+#define APPLICATION_PIN PIN_PA4 // 0
+
+# elif defined(__AVR_ATtiny1604__) // For use with megaTinyCore
+#define IR_RECEIVE_PIN PIN_PA6 // 2 - To be compatible with interrupt example, pin 2 is chosen here.
+#define IR_SEND_PIN PIN_PA7 // 3
+#define APPLICATION_PIN PIN_PB2 // 5
+
+#define tone(...) void() // Define as void, since TCB0_INT_vect is also used by tone()
+#define noTone(a) void()
+#define TONE_PIN 42 // Dummy for examples using it
+
+# elif defined(__AVR_ATmega1284__) || defined(__AVR_ATmega1284P__) \
+|| defined(__AVR_ATmega644__) || defined(__AVR_ATmega644P__) \
+|| defined(__AVR_ATmega324P__) || defined(__AVR_ATmega324A__) \
+|| defined(__AVR_ATmega324PA__) || defined(__AVR_ATmega164A__) \
+|| defined(__AVR_ATmega164P__) || defined(__AVR_ATmega32__) \
+|| defined(__AVR_ATmega16__) || defined(__AVR_ATmega8535__) \
+|| defined(__AVR_ATmega64__) || defined(__AVR_ATmega128__) \
+|| defined(__AVR_ATmega1281__) || defined(__AVR_ATmega2561__) \
+|| defined(__AVR_ATmega8515__) || defined(__AVR_ATmega162__)
+#define IR_RECEIVE_PIN 2
+#define IR_SEND_PIN 13
+#define TONE_PIN 4
+#define APPLICATION_PIN 5
+#define ALTERNATIVE_IR_FEEDBACK_LED_PIN 6 // E.g. used for examples which use LED_BUILDIN for example output.
+#define _IR_TIMING_TEST_PIN 7
+
+# else // Default as for ATmega328 like on Uno, Nano, Leonardo, Teensy 2.0 etc.
+#define IR_RECEIVE_PIN 2 // To be compatible with interrupt example, pin 2 is chosen here.
+#define IR_SEND_PIN 3
+#define TONE_PIN 4
+#define APPLICATION_PIN 5
+#define ALTERNATIVE_IR_FEEDBACK_LED_PIN 6 // E.g. used for examples which use LED_BUILDIN for example output.
+#define _IR_TIMING_TEST_PIN 7
+
+# if defined(ARDUINO_AVR_PROMICRO) // Sparkfun Pro Micro is __AVR_ATmega32U4__ but has different external circuit
+// We have no built in LED at pin 13 -> reuse RX LED
+#undef LED_BUILTIN
+#define LED_BUILTIN LED_BUILTIN_RX
+# endif
+# endif // defined(__AVR_ATtiny25__)...
+
+#elif defined(ARDUINO_ARCH_RENESAS_UNO) // Uno R4
+// To be compatible with Uno R3.
+#define IR_RECEIVE_PIN 2
+#define IR_SEND_PIN 3
+#define TONE_PIN 4
+#define APPLICATION_PIN 5
+#define ALTERNATIVE_IR_FEEDBACK_LED_PIN 6 // E.g. used for examples which use LED_BUILDIN for example output.
+#define _IR_TIMING_TEST_PIN 7
+
+#elif defined(ESP8266)
+#define FEEDBACK_LED_IS_ACTIVE_LOW // The LED on my board (D4) is active LOW
+#define IR_RECEIVE_PIN 14 // D5
+#define IR_SEND_PIN 12 // D6 - D4/pin 2 is internal LED
+#define _IR_TIMING_TEST_PIN 2 // D4
+#define APPLICATION_PIN 13 // D7
+
+#define tone(...) void() // tone() inhibits receive timer
+#define noTone(a) void()
+#define TONE_PIN 42 // Dummy for examples using it#
+
+#elif defined(ARDUINO_NOLOGO_ESP32C3_SUPER_MINI)
+#define FEEDBACK_LED_IS_ACTIVE_LOW // The LED on my board (D8) is active LOW
+#define IR_RECEIVE_PIN 2
+#define IR_SEND_PIN 3
+#define TONE_PIN 4
+#define APPLICATION_PIN 10
+
+#elif defined(CONFIG_IDF_TARGET_ESP32C3) || defined(ARDUINO_ESP32C3_DEV)
+#define NO_LED_FEEDBACK_CODE // The WS2812 on pin 8 of AI-C3 board crashes if used as receive feedback LED, other I/O pins are working...
+#define IR_RECEIVE_PIN 6
+#define IR_SEND_PIN 7
+#define TONE_PIN 10
+#define APPLICATION_PIN 18
+
+#elif defined(ESP32)
+#include
+
+// tone() is included in ESP32 core since 2.0.2
+#if !defined(ESP_ARDUINO_VERSION_VAL)
+#define ESP_ARDUINO_VERSION_VAL(major, minor, patch) 12345678
+#endif
+#if ESP_ARDUINO_VERSION <= ESP_ARDUINO_VERSION_VAL(2, 0, 2)
+#define TONE_LEDC_CHANNEL 1 // Using channel 1 makes tone() independent of receiving timer -> No need to stop receiving timer.
+void tone(uint8_t aPinNumber, unsigned int aFrequency){
+ ledcAttachPin(aPinNumber, TONE_LEDC_CHANNEL);
+ ledcWriteTone(TONE_LEDC_CHANNEL, aFrequency);
+}
+void tone(uint8_t aPinNumber, unsigned int aFrequency, unsigned long aDuration){
+ ledcAttachPin(aPinNumber, TONE_LEDC_CHANNEL);
+ ledcWriteTone(TONE_LEDC_CHANNEL, aFrequency);
+ delay(aDuration);
+ ledcWriteTone(TONE_LEDC_CHANNEL, 0);
+}
+void noTone(uint8_t aPinNumber){
+ ledcWriteTone(TONE_LEDC_CHANNEL, 0);
+}
+#endif // ESP_ARDUINO_VERSION <= ESP_ARDUINO_VERSION_VAL(2, 0, 2)
+
+#define IR_RECEIVE_PIN 15 // D15
+#define IR_SEND_PIN 4 // D4
+#define TONE_PIN 27 // D27 25 & 26 are DAC0 and 1
+#define APPLICATION_PIN 16 // RX2 pin
+
+#elif defined(ARDUINO_ARCH_STM32) || defined(ARDUINO_ARCH_STM32F1) // BluePill
+// Timer 3 blocks PA6, PA7, PB0, PB1 for use by Servo or tone()
+#define IR_RECEIVE_PIN PA6
+#define IR_RECEIVE_PIN_STRING "PA6"
+#define IR_SEND_PIN PA7
+#define IR_SEND_PIN_STRING "PA7"
+#define TONE_PIN PA3
+#define _IR_TIMING_TEST_PIN PA5
+#define APPLICATION_PIN PA2
+#define APPLICATION_PIN_STRING "PA2"
+# if defined(ARDUINO_GENERIC_STM32F103C) || defined(ARDUINO_BLUEPILL_F103C8)
+// BluePill LED is active low
+#define FEEDBACK_LED_IS_ACTIVE_LOW
+# endif
+
+#elif defined(ARDUINO_ARCH_APOLLO3) // Sparkfun Apollo boards
+#define IR_RECEIVE_PIN 11
+#define IR_SEND_PIN 12
+#define TONE_PIN 5
+
+#elif defined(ARDUINO_ARCH_MBED) && defined(ARDUINO_ARCH_MBED_NANO) // Arduino Nano 33 BLE and Arduino Nano Connect layout for MBED
+// Must be before ARDUINO_ARCH_RP2040, since it is the layout for the MBED core of Arduino Nano Connect
+#define IR_RECEIVE_PIN 3 // GPIO15 Start with pin 3 since pin 2|GPIO25 is connected to LED on Pi pico
+#define IR_SEND_PIN 4 // GPIO16
+#define TONE_PIN 5
+#define APPLICATION_PIN 6
+#define ALTERNATIVE_IR_FEEDBACK_LED_PIN 7 // E.g. used for examples which use LED_BUILDIN for example output.
+#define _IR_TIMING_TEST_PIN 8
+
+#elif defined(ARDUINO_ARCH_RP2040) // Arduino Nano Connect, Pi Pico with arduino-pico core https://github.com/earlephilhower/arduino-pico
+#define IR_RECEIVE_PIN 15 // GPIO15 to be compatible with the Arduino Nano RP2040 Connect (pin3)
+#define IR_SEND_PIN 16 // GPIO16
+#define TONE_PIN 17
+#define APPLICATION_PIN 18
+#define ALTERNATIVE_IR_FEEDBACK_LED_PIN 19 // E.g. used for examples which use LED_BUILDIN for example output.
+#define _IR_TIMING_TEST_PIN 20
+
+// If you program the Nano RP2040 Connect with this core, then you must redefine LED_BUILTIN
+// and use the external reset with 1 kOhm to ground to enter UF2 mode
+#undef LED_BUILTIN
+#define LED_BUILTIN 6
+
+#elif defined(PARTICLE) // !!!UNTESTED!!!
+#define IR_RECEIVE_PIN A4
+#define IR_SEND_PIN A5 // Particle supports multiple pins
+
+#define LED_BUILTIN D7
+
+/*
+ * 4 times the same (default) layout for easy adaption in the future
+ */
+#elif defined(TEENSYDUINO) // Teensy 2.0 is handled at default for ATmega328 like on Uno, Nano, Leonardo etc.
+#define IR_RECEIVE_PIN 2
+#define IR_SEND_PIN 3
+#define TONE_PIN 4
+#define APPLICATION_PIN 5
+#define ALTERNATIVE_IR_FEEDBACK_LED_PIN 6 // E.g. used for examples which use LED_BUILDIN for example output.
+#define _IR_TIMING_TEST_PIN 7
+
+#elif defined(ARDUINO_ARCH_MBED) // Arduino Nano 33 BLE
+#define IR_RECEIVE_PIN 2
+#define IR_SEND_PIN 3
+#define TONE_PIN 4
+#define APPLICATION_PIN 5
+#define ALTERNATIVE_IR_FEEDBACK_LED_PIN 6 // E.g. used for examples which use LED_BUILDIN for example output.
+#define _IR_TIMING_TEST_PIN 7
+
+#elif defined(ARDUINO_ARCH_SAMD) || defined(ARDUINO_ARCH_SAM)
+#define IR_RECEIVE_PIN 2
+#define IR_SEND_PIN 3
+#define TONE_PIN 4
+#define APPLICATION_PIN 5
+#define ALTERNATIVE_IR_FEEDBACK_LED_PIN 6 // E.g. used for examples which use LED_BUILDIN for example output.
+#define _IR_TIMING_TEST_PIN 7
+
+#if !defined(ARDUINO_SAMD_ADAFRUIT) && !defined(ARDUINO_SEEED_XIAO_M0)
+// On the Zero and others we switch explicitly to SerialUSB
+#define Serial SerialUSB
+#endif
+
+// Definitions for the Chinese SAMD21 M0-Mini clone, which has no led connected to D13/PA17.
+// Attention!!! D2 and D4 are swapped on these boards!!!
+// If you connect the LED, it is on pin 24/PB11. In this case activate the next two lines.
+//#undef LED_BUILTIN
+//#define LED_BUILTIN 24 // PB11
+// As an alternative you can choose pin 25, it is the RX-LED pin (PB03), but active low.In this case activate the next 3 lines.
+//#undef LED_BUILTIN
+//#define LED_BUILTIN 25 // PB03
+//#define FEEDBACK_LED_IS_ACTIVE_LOW // The RX LED on the M0-Mini is active LOW
+
+#elif defined (NRF51) // BBC micro:bit
+#define IR_RECEIVE_PIN 2
+#define IR_SEND_PIN 3
+#define APPLICATION_PIN 1
+#define _IR_TIMING_TEST_PIN 4
+
+#define tone(...) void() // no tone() available
+#define noTone(a) void()
+#define TONE_PIN 42 // Dummy for examples using it
+
+#else
+#warning Board / CPU is not detected using pre-processor symbols -> using default values, which may not fit. Please extend PinDefinitionsAndMore.h.
+// Default valued for unidentified boards
+#define IR_RECEIVE_PIN 2
+#define IR_SEND_PIN 3
+#define TONE_PIN 4
+#define APPLICATION_PIN 5
+#define ALTERNATIVE_IR_FEEDBACK_LED_PIN 6 // E.g. used for examples which use LED_BUILDIN for example output.
+#define _IR_TIMING_TEST_PIN 7
+#endif // defined(ESP8266)
+
+#if defined(ESP32) || defined(ARDUINO_ARCH_RP2040) || defined(PARTICLE) || defined(ARDUINO_ARCH_MBED)
+#define SEND_PWM_BY_TIMER // We do not have pin restrictions for this CPU's, so lets use the hardware PWM for send carrier signal generation
+#else
+# if defined(SEND_PWM_BY_TIMER)
+#undef IR_SEND_PIN // SendPin is determined by timer! This avoids warnings in IRremote.hpp and IRTimer.hpp
+# endif
+#endif
+
+#if !defined (FLASHEND)
+#define FLASHEND 0xFFFF // Dummy value for platforms where FLASHEND is not defined
+#endif
+
+/*
+ * Helper macro for getting a macro definition as string
+ */
+#if !defined(STR_HELPER)
+#define STR_HELPER(x) #x
+#define STR(x) STR_HELPER(x)
+#endif
diff --git a/libraries/IRremote/examples/SimpleReceiver/SimpleReceiver.ino b/libraries/IRremote/examples/SimpleReceiver/SimpleReceiver.ino
new file mode 100644
index 0000000..2a62e58
--- /dev/null
+++ b/libraries/IRremote/examples/SimpleReceiver/SimpleReceiver.ino
@@ -0,0 +1,131 @@
+/*
+ * SimpleReceiver.cpp
+ *
+ * Demonstrates receiving ONLY NEC protocol IR codes with IRremote
+ * If no protocol is defined, all protocols (except Bang&Olufsen) are active.
+ *
+ * This file is part of Arduino-IRremote https://github.com/Arduino-IRremote/Arduino-IRremote.
+ *
+ ************************************************************************************
+ * MIT License
+ *
+ * Copyright (c) 2020-2023 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.
+ *
+ ************************************************************************************
+ */
+
+#include
+
+/*
+ * Specify which protocol(s) should be used for decoding.
+ * If no protocol is defined, all protocols (except Bang&Olufsen) are active.
+ * This must be done before the #include
+ */
+//#define DECODE_DENON // Includes Sharp
+//#define DECODE_JVC
+//#define DECODE_KASEIKYO
+//#define DECODE_PANASONIC // alias for DECODE_KASEIKYO
+//#define DECODE_LG
+#define DECODE_NEC // Includes Apple and Onkyo. To enable all protocols , just comment/disable this line.
+//#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 // Universal decoder for pulse distance width protocols
+//#define DECODE_HASH // special decoder for all protocols
+
+//#define DECODE_BEO // This protocol must always be enabled manually, i.e. it is NOT enabled if no protocol is defined. It prevents decoding of SONY!
+
+//#define DEBUG // Activate this for lots of lovely debug output from the decoders.
+
+//#define RAW_BUFFER_LENGTH 750 // For air condition remotes it requires 750. Default is 200.
+
+/*
+ * This include defines the actual pin number for pins like IR_RECEIVE_PIN, IR_SEND_PIN for many different boards and architectures
+ */
+// #include "PinDefinitionsAndMore.h"
+#include // include the library
+
+#if !defined(STR_HELPER)
+#define STR_HELPER(x) #x
+#define STR(x) STR_HELPER(x)
+#endif
+
+#define IR_RECEIVE_PIN 4 // P0_1
+
+void setup() {
+ Serial.begin(9600);
+ while (!Serial)
+ ; // Wait for Serial to become available. Is optimized away for some cores.
+
+ // Just to know which program is running on my Arduino
+ Serial.println(F("START " __FILE__ " from " __DATE__ "\r\nUsing library version " VERSION_IRREMOTE));
+
+ // Start the receiver and if not 3. parameter specified, take LED_BUILTIN pin from the internal boards definition as default feedback LED
+ IrReceiver.begin(IR_RECEIVE_PIN, ENABLE_LED_FEEDBACK);
+
+ Serial.print(F("Ready to receive IR signals of protocols: "));
+ printActiveIRProtocols(&Serial);
+ Serial.println(F("at pin " STR(IR_RECEIVE_PIN)));
+}
+
+void loop() {
+ /*
+ * Check if received data is available and if yes, try to decode it.
+ * Decoded result is in the IrReceiver.decodedIRData structure.
+ *
+ * E.g. command is in IrReceiver.decodedIRData.command
+ * address is in command is in IrReceiver.decodedIRData.address
+ * and up to 32 bit raw data in IrReceiver.decodedIRData.decodedRawData
+ */
+ if (IrReceiver.decode()) {
+
+ /*
+ * Print a summary of received data
+ */
+ if (IrReceiver.decodedIRData.protocol == UNKNOWN) {
+ Serial.println(F("Received noise or an unknown (or not yet enabled) protocol"));
+ // We have an unknown protocol here, print extended info
+ IrReceiver.printIRResultRawFormatted(&Serial, true);
+ IrReceiver.resume(); // Do it here, to preserve raw data for printing with printIRResultRawFormatted()
+ } else {
+ IrReceiver.resume(); // Early enable receiving of the next IR frame
+ IrReceiver.printIRResultShort(&Serial);
+ IrReceiver.printIRSendUsage(&Serial);
+ }
+ Serial.println();
+
+ /*
+ * Finally, check the received data and perform actions according to the received command
+ */
+ if (IrReceiver.decodedIRData.command == 0x10) {
+ // do something
+ } else if (IrReceiver.decodedIRData.command == 0x11) {
+ // do something else
+ }
+ }
+}
diff --git a/libraries/IRremote/examples/SimpleReceiverForHashCodes/PinDefinitionsAndMore.h b/libraries/IRremote/examples/SimpleReceiverForHashCodes/PinDefinitionsAndMore.h
new file mode 100644
index 0000000..14573c7
--- /dev/null
+++ b/libraries/IRremote/examples/SimpleReceiverForHashCodes/PinDefinitionsAndMore.h
@@ -0,0 +1,349 @@
+/*
+ * PinDefinitionsAndMore.h
+ *
+ * Contains pin definitions for IRremote examples for various platforms
+ * as well as definitions for feedback LED and tone() and includes
+ *
+ * Copyright (C) 2021-2023 Armin Joachimsmeyer
+ * armin.joachimsmeyer@gmail.com
+ *
+ * This file is part of IRremote https://github.com/Arduino-IRremote/Arduino-IRremote.
+ *
+ * Arduino-IRremote is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
+ * See the GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see .
+ *
+ */
+
+/*
+ * Pin mapping table for different platforms
+ *
+ * Platform IR input IR output Tone Core/Pin schema
+ * --------------------------------------------------------------
+ * DEFAULT/AVR 2 3 4 Arduino
+ * ATtinyX5 0|PB0 4|PB4 3|PB3 ATTinyCore
+ * ATtiny167 3|PA3 2|PA2 7|PA7 ATTinyCore
+ * ATtiny167 9|PA3 8|PA2 5|PA7 Digispark original core
+ * ATtiny84 |PB2 |PA4 |PA3 ATTinyCore
+ * ATtiny88 3|PD3 4|PD4 9|PB1 ATTinyCore
+ * ATtiny3217 18|PA1 19|PA2 20|PA3 MegaTinyCore
+ * ATtiny1604 2 3|PA5 %
+ * ATtiny816 14|PA1 16|PA3 1|PA5 MegaTinyCore
+ * ATtiny1614 8|PA1 10|PA3 1|PA5 MegaTinyCore
+ * SAMD21 3 4 5
+ * ESP8266 14|D5 12|D6 %
+ * ESP32 15 4 27
+ * ESP32-C3 2 3 4
+ * BluePill PA6 PA7 PA3
+ * APOLLO3 11 12 5
+ * RP2040 3|GPIO15 4|GPIO16 5|GPIO17
+ */
+//#define _IR_MEASURE_TIMING // For debugging purposes.
+
+#if defined(__AVR__)
+#if defined(__AVR_ATtiny25__) || defined(__AVR_ATtiny45__) || defined(__AVR_ATtiny85__) // Digispark board. For use with ATTinyCore.
+#include "ATtinySerialOut.hpp" // TX is at pin 2 - Available as Arduino library "ATtinySerialOut". Saves 700 bytes program memory and 70 bytes RAM for ATtinyCore.
+#define IR_RECEIVE_PIN PIN_PB0
+#define IR_SEND_PIN PIN_PB4 // Pin 2 is serial output with ATtinySerialOut. Pin 1 is internal LED and Pin3 is USB+ with pullup on Digispark board.
+#define TONE_PIN PIN_PB3
+#define _IR_TIMING_TEST_PIN PIN_PB3
+
+# elif defined(__AVR_ATtiny87__) || defined(__AVR_ATtiny167__) // Digispark pro board
+#include "ATtinySerialOut.hpp" // Available as Arduino library "ATtinySerialOut"
+// For ATtiny167 Pins PB6 and PA3 are usable as interrupt source.
+# if defined(ARDUINO_AVR_DIGISPARKPRO)
+// For use with Digispark original core
+#define IR_RECEIVE_PIN 9 // PA3 - on Digispark board labeled as pin 9
+//#define IR_RECEIVE_PIN 14 // PB6 / INT0 is connected to USB+ on DigisparkPro boards
+#define IR_SEND_PIN 8 // PA2 - on Digispark board labeled as pin 8
+#define TONE_PIN 5 // PA7 - on Digispark board labeled as pin 5
+#define _IR_TIMING_TEST_PIN 10 // PA4
+# else
+// For use with ATTinyCore
+#define IR_RECEIVE_PIN PIN_PA3 // On Digispark board labeled as pin 9 - INT0 is connected to USB+ on DigisparkPro boards
+#define IR_SEND_PIN PIN_PA2 // On Digispark board labeled as pin 8
+#define TONE_PIN PIN_PA7 // On Digispark board labeled as pin 5
+# endif
+
+# elif defined(__AVR_ATtiny84__) // For use with ATTinyCore
+#include "ATtinySerialOut.hpp" // Available as Arduino library "ATtinySerialOut". Saves 128 bytes program memory.
+#define IR_RECEIVE_PIN PIN_PB2 // INT0
+#define IR_SEND_PIN PIN_PA4
+#define TONE_PIN PIN_PA3
+#define _IR_TIMING_TEST_PIN PIN_PA5
+
+# elif defined(__AVR_ATtiny88__) // MH-ET Tiny88 board. For use with ATTinyCore.
+#include "ATtinySerialOut.hpp" // Available as Arduino library "ATtinySerialOut". Saves 128 bytes program memory.
+// Pin 6 is TX, pin 7 is RX
+#define IR_RECEIVE_PIN PIN_PD3 // 3 - INT1
+#define IR_SEND_PIN PIN_PD4 // 4
+#define TONE_PIN PIN_PB1 // 9
+#define _IR_TIMING_TEST_PIN PIN_PB0 // 8
+
+# elif defined(__AVR_ATtiny1616__) || defined(__AVR_ATtiny3216__) || defined(__AVR_ATtiny3217__) // For use with megaTinyCore
+// Tiny Core Dev board
+// https://www.tindie.com/products/xkimi/tiny-core-16-dev-board-attiny1616/ - Out of Stock
+// https://www.tindie.com/products/xkimi/tiny-core-32-dev-board-attiny3217/ - Out of Stock
+#define IR_RECEIVE_PIN PIN_PA1 // use 18 instead of PIN_PA1 for TinyCore32
+#define IR_SEND_PIN PIN_PA2 // 19
+#define TONE_PIN PIN_PA3 // 20
+#define APPLICATION_PIN PIN_PA0 // 0
+#undef LED_BUILTIN // No LED available on the TinyCore 32 board, take the one on the programming board which is connected to the DAC output
+#define LED_BUILTIN PIN_PA6 // use 2 instead of PIN_PA6 for TinyCore32
+
+# elif defined(__AVR_ATtiny816__) // For use with megaTinyCore
+#define IR_RECEIVE_PIN PIN_PA1 // 14
+#define IR_SEND_PIN PIN_PA1 // 16
+#define TONE_PIN PIN_PA5 // 1
+#define APPLICATION_PIN PIN_PA4 // 0
+#undef LED_BUILTIN // No LED available, take the one which is connected to the DAC output
+#define LED_BUILTIN PIN_PB5 // 4
+
+# elif defined(__AVR_ATtiny1614__) // For use with megaTinyCore
+#define IR_RECEIVE_PIN PIN_PA1 // 8
+#define IR_SEND_PIN PIN_PA3 // 10
+#define TONE_PIN PIN_PA5 // 1
+#define APPLICATION_PIN PIN_PA4 // 0
+
+# elif defined(__AVR_ATtiny1604__) // For use with megaTinyCore
+#define IR_RECEIVE_PIN PIN_PA6 // 2 - To be compatible with interrupt example, pin 2 is chosen here.
+#define IR_SEND_PIN PIN_PA7 // 3
+#define APPLICATION_PIN PIN_PB2 // 5
+
+#define tone(...) void() // Define as void, since TCB0_INT_vect is also used by tone()
+#define noTone(a) void()
+#define TONE_PIN 42 // Dummy for examples using it
+
+# elif defined(__AVR_ATmega1284__) || defined(__AVR_ATmega1284P__) \
+|| defined(__AVR_ATmega644__) || defined(__AVR_ATmega644P__) \
+|| defined(__AVR_ATmega324P__) || defined(__AVR_ATmega324A__) \
+|| defined(__AVR_ATmega324PA__) || defined(__AVR_ATmega164A__) \
+|| defined(__AVR_ATmega164P__) || defined(__AVR_ATmega32__) \
+|| defined(__AVR_ATmega16__) || defined(__AVR_ATmega8535__) \
+|| defined(__AVR_ATmega64__) || defined(__AVR_ATmega128__) \
+|| defined(__AVR_ATmega1281__) || defined(__AVR_ATmega2561__) \
+|| defined(__AVR_ATmega8515__) || defined(__AVR_ATmega162__)
+#define IR_RECEIVE_PIN 2
+#define IR_SEND_PIN 13
+#define TONE_PIN 4
+#define APPLICATION_PIN 5
+#define ALTERNATIVE_IR_FEEDBACK_LED_PIN 6 // E.g. used for examples which use LED_BUILDIN for example output.
+#define _IR_TIMING_TEST_PIN 7
+
+# else // Default as for ATmega328 like on Uno, Nano, Leonardo, Teensy 2.0 etc.
+#define IR_RECEIVE_PIN 2 // To be compatible with interrupt example, pin 2 is chosen here.
+#define IR_SEND_PIN 3
+#define TONE_PIN 4
+#define APPLICATION_PIN 5
+#define ALTERNATIVE_IR_FEEDBACK_LED_PIN 6 // E.g. used for examples which use LED_BUILDIN for example output.
+#define _IR_TIMING_TEST_PIN 7
+
+# if defined(ARDUINO_AVR_PROMICRO) // Sparkfun Pro Micro is __AVR_ATmega32U4__ but has different external circuit
+// We have no built in LED at pin 13 -> reuse RX LED
+#undef LED_BUILTIN
+#define LED_BUILTIN LED_BUILTIN_RX
+# endif
+# endif // defined(__AVR_ATtiny25__)...
+
+#elif defined(ARDUINO_ARCH_RENESAS_UNO) // Uno R4
+// To be compatible with Uno R3.
+#define IR_RECEIVE_PIN 2
+#define IR_SEND_PIN 3
+#define TONE_PIN 4
+#define APPLICATION_PIN 5
+#define ALTERNATIVE_IR_FEEDBACK_LED_PIN 6 // E.g. used for examples which use LED_BUILDIN for example output.
+#define _IR_TIMING_TEST_PIN 7
+
+#elif defined(ESP8266)
+#define FEEDBACK_LED_IS_ACTIVE_LOW // The LED on my board (D4) is active LOW
+#define IR_RECEIVE_PIN 14 // D5
+#define IR_SEND_PIN 12 // D6 - D4/pin 2 is internal LED
+#define _IR_TIMING_TEST_PIN 2 // D4
+#define APPLICATION_PIN 13 // D7
+
+#define tone(...) void() // tone() inhibits receive timer
+#define noTone(a) void()
+#define TONE_PIN 42 // Dummy for examples using it#
+
+#elif defined(ARDUINO_NOLOGO_ESP32C3_SUPER_MINI)
+#define FEEDBACK_LED_IS_ACTIVE_LOW // The LED on my board (D8) is active LOW
+#define IR_RECEIVE_PIN 2
+#define IR_SEND_PIN 3
+#define TONE_PIN 4
+#define APPLICATION_PIN 10
+
+#elif defined(CONFIG_IDF_TARGET_ESP32C3) || defined(ARDUINO_ESP32C3_DEV)
+#define NO_LED_FEEDBACK_CODE // The WS2812 on pin 8 of AI-C3 board crashes if used as receive feedback LED, other I/O pins are working...
+#define IR_RECEIVE_PIN 6
+#define IR_SEND_PIN 7
+#define TONE_PIN 10
+#define APPLICATION_PIN 18
+
+#elif defined(ESP32)
+#include
+
+// tone() is included in ESP32 core since 2.0.2
+#if !defined(ESP_ARDUINO_VERSION_VAL)
+#define ESP_ARDUINO_VERSION_VAL(major, minor, patch) 12345678
+#endif
+#if ESP_ARDUINO_VERSION <= ESP_ARDUINO_VERSION_VAL(2, 0, 2)
+#define TONE_LEDC_CHANNEL 1 // Using channel 1 makes tone() independent of receiving timer -> No need to stop receiving timer.
+void tone(uint8_t aPinNumber, unsigned int aFrequency){
+ ledcAttachPin(aPinNumber, TONE_LEDC_CHANNEL);
+ ledcWriteTone(TONE_LEDC_CHANNEL, aFrequency);
+}
+void tone(uint8_t aPinNumber, unsigned int aFrequency, unsigned long aDuration){
+ ledcAttachPin(aPinNumber, TONE_LEDC_CHANNEL);
+ ledcWriteTone(TONE_LEDC_CHANNEL, aFrequency);
+ delay(aDuration);
+ ledcWriteTone(TONE_LEDC_CHANNEL, 0);
+}
+void noTone(uint8_t aPinNumber){
+ ledcWriteTone(TONE_LEDC_CHANNEL, 0);
+}
+#endif // ESP_ARDUINO_VERSION <= ESP_ARDUINO_VERSION_VAL(2, 0, 2)
+
+#define IR_RECEIVE_PIN 15 // D15
+#define IR_SEND_PIN 4 // D4
+#define TONE_PIN 27 // D27 25 & 26 are DAC0 and 1
+#define APPLICATION_PIN 16 // RX2 pin
+
+#elif defined(ARDUINO_ARCH_STM32) || defined(ARDUINO_ARCH_STM32F1) // BluePill
+// Timer 3 blocks PA6, PA7, PB0, PB1 for use by Servo or tone()
+#define IR_RECEIVE_PIN PA6
+#define IR_RECEIVE_PIN_STRING "PA6"
+#define IR_SEND_PIN PA7
+#define IR_SEND_PIN_STRING "PA7"
+#define TONE_PIN PA3
+#define _IR_TIMING_TEST_PIN PA5
+#define APPLICATION_PIN PA2
+#define APPLICATION_PIN_STRING "PA2"
+# if defined(ARDUINO_GENERIC_STM32F103C) || defined(ARDUINO_BLUEPILL_F103C8)
+// BluePill LED is active low
+#define FEEDBACK_LED_IS_ACTIVE_LOW
+# endif
+
+#elif defined(ARDUINO_ARCH_APOLLO3) // Sparkfun Apollo boards
+#define IR_RECEIVE_PIN 11
+#define IR_SEND_PIN 12
+#define TONE_PIN 5
+
+#elif defined(ARDUINO_ARCH_MBED) && defined(ARDUINO_ARCH_MBED_NANO) // Arduino Nano 33 BLE and Arduino Nano Connect layout for MBED
+// Must be before ARDUINO_ARCH_RP2040, since it is the layout for the MBED core of Arduino Nano Connect
+#define IR_RECEIVE_PIN 3 // GPIO15 Start with pin 3 since pin 2|GPIO25 is connected to LED on Pi pico
+#define IR_SEND_PIN 4 // GPIO16
+#define TONE_PIN 5
+#define APPLICATION_PIN 6
+#define ALTERNATIVE_IR_FEEDBACK_LED_PIN 7 // E.g. used for examples which use LED_BUILDIN for example output.
+#define _IR_TIMING_TEST_PIN 8
+
+#elif defined(ARDUINO_ARCH_RP2040) // Arduino Nano Connect, Pi Pico with arduino-pico core https://github.com/earlephilhower/arduino-pico
+#define IR_RECEIVE_PIN 15 // GPIO15 to be compatible with the Arduino Nano RP2040 Connect (pin3)
+#define IR_SEND_PIN 16 // GPIO16
+#define TONE_PIN 17
+#define APPLICATION_PIN 18
+#define ALTERNATIVE_IR_FEEDBACK_LED_PIN 19 // E.g. used for examples which use LED_BUILDIN for example output.
+#define _IR_TIMING_TEST_PIN 20
+
+// If you program the Nano RP2040 Connect with this core, then you must redefine LED_BUILTIN
+// and use the external reset with 1 kOhm to ground to enter UF2 mode
+#undef LED_BUILTIN
+#define LED_BUILTIN 6
+
+#elif defined(PARTICLE) // !!!UNTESTED!!!
+#define IR_RECEIVE_PIN A4
+#define IR_SEND_PIN A5 // Particle supports multiple pins
+
+#define LED_BUILTIN D7
+
+/*
+ * 4 times the same (default) layout for easy adaption in the future
+ */
+#elif defined(TEENSYDUINO) // Teensy 2.0 is handled at default for ATmega328 like on Uno, Nano, Leonardo etc.
+#define IR_RECEIVE_PIN 2
+#define IR_SEND_PIN 3
+#define TONE_PIN 4
+#define APPLICATION_PIN 5
+#define ALTERNATIVE_IR_FEEDBACK_LED_PIN 6 // E.g. used for examples which use LED_BUILDIN for example output.
+#define _IR_TIMING_TEST_PIN 7
+
+#elif defined(ARDUINO_ARCH_MBED) // Arduino Nano 33 BLE
+#define IR_RECEIVE_PIN 2
+#define IR_SEND_PIN 3
+#define TONE_PIN 4
+#define APPLICATION_PIN 5
+#define ALTERNATIVE_IR_FEEDBACK_LED_PIN 6 // E.g. used for examples which use LED_BUILDIN for example output.
+#define _IR_TIMING_TEST_PIN 7
+
+#elif defined(ARDUINO_ARCH_SAMD) || defined(ARDUINO_ARCH_SAM)
+#define IR_RECEIVE_PIN 2
+#define IR_SEND_PIN 3
+#define TONE_PIN 4
+#define APPLICATION_PIN 5
+#define ALTERNATIVE_IR_FEEDBACK_LED_PIN 6 // E.g. used for examples which use LED_BUILDIN for example output.
+#define _IR_TIMING_TEST_PIN 7
+
+#if !defined(ARDUINO_SAMD_ADAFRUIT) && !defined(ARDUINO_SEEED_XIAO_M0)
+// On the Zero and others we switch explicitly to SerialUSB
+#define Serial SerialUSB
+#endif
+
+// Definitions for the Chinese SAMD21 M0-Mini clone, which has no led connected to D13/PA17.
+// Attention!!! D2 and D4 are swapped on these boards!!!
+// If you connect the LED, it is on pin 24/PB11. In this case activate the next two lines.
+//#undef LED_BUILTIN
+//#define LED_BUILTIN 24 // PB11
+// As an alternative you can choose pin 25, it is the RX-LED pin (PB03), but active low.In this case activate the next 3 lines.
+//#undef LED_BUILTIN
+//#define LED_BUILTIN 25 // PB03
+//#define FEEDBACK_LED_IS_ACTIVE_LOW // The RX LED on the M0-Mini is active LOW
+
+#elif defined (NRF51) // BBC micro:bit
+#define IR_RECEIVE_PIN 2
+#define IR_SEND_PIN 3
+#define APPLICATION_PIN 1
+#define _IR_TIMING_TEST_PIN 4
+
+#define tone(...) void() // no tone() available
+#define noTone(a) void()
+#define TONE_PIN 42 // Dummy for examples using it
+
+#else
+#warning Board / CPU is not detected using pre-processor symbols -> using default values, which may not fit. Please extend PinDefinitionsAndMore.h.
+// Default valued for unidentified boards
+#define IR_RECEIVE_PIN 2
+#define IR_SEND_PIN 3
+#define TONE_PIN 4
+#define APPLICATION_PIN 5
+#define ALTERNATIVE_IR_FEEDBACK_LED_PIN 6 // E.g. used for examples which use LED_BUILDIN for example output.
+#define _IR_TIMING_TEST_PIN 7
+#endif // defined(ESP8266)
+
+#if defined(ESP32) || defined(ARDUINO_ARCH_RP2040) || defined(PARTICLE) || defined(ARDUINO_ARCH_MBED)
+#define SEND_PWM_BY_TIMER // We do not have pin restrictions for this CPU's, so lets use the hardware PWM for send carrier signal generation
+#else
+# if defined(SEND_PWM_BY_TIMER)
+#undef IR_SEND_PIN // SendPin is determined by timer! This avoids warnings in IRremote.hpp and IRTimer.hpp
+# endif
+#endif
+
+#if !defined (FLASHEND)
+#define FLASHEND 0xFFFF // Dummy value for platforms where FLASHEND is not defined
+#endif
+
+/*
+ * Helper macro for getting a macro definition as string
+ */
+#if !defined(STR_HELPER)
+#define STR_HELPER(x) #x
+#define STR(x) STR_HELPER(x)
+#endif
diff --git a/libraries/IRremote/examples/SimpleReceiverForHashCodes/SimpleReceiverForHashCodes.ino b/libraries/IRremote/examples/SimpleReceiverForHashCodes/SimpleReceiverForHashCodes.ino
new file mode 100644
index 0000000..6c81b79
--- /dev/null
+++ b/libraries/IRremote/examples/SimpleReceiverForHashCodes/SimpleReceiverForHashCodes.ino
@@ -0,0 +1,100 @@
+/*
+ * SimpleReceiverForHashCodes.cpp
+ *
+ * Demonstrates receiving hash codes of unknown protocols with IRremote
+ *
+ * This file is part of Arduino-IRremote https://github.com/Arduino-IRremote/Arduino-IRremote.
+ *
+ ************************************************************************************
+ * MIT License
+ *
+ * Copyright (c) 2024 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.
+ *
+ ************************************************************************************
+ */
+
+#include
+
+/*
+ * Specify which protocol(s) should be used for decoding.
+ * This must be done before the #include
+ */
+#define DECODE_HASH // special decoder for all protocols
+#define RAW_BUFFER_LENGTH 1000 // Especially useful for unknown and probably long protocols
+//#define DEBUG // Activate this for lots of lovely debug output from the decoders.
+
+/*
+ * This include defines the actual pin number for pins like IR_RECEIVE_PIN, IR_SEND_PIN for many different boards and architectures
+ */
+// #include "PinDefinitionsAndMore.h"
+#include // include the library
+
+/*
+ * Helper macro for getting a macro definition as string
+ */
+#if !defined(STR_HELPER)
+#define STR_HELPER(x) #x
+#define STR(x) STR_HELPER(x)
+#endif
+
+#define IR_RECEIVE_PIN 4 // P0_1
+
+void setup() {
+ Serial.begin(9600);
+ while (!Serial)
+ ; // Wait for Serial to become available. Is optimized away for some cores.
+
+ // Just to know which program is running on my Arduino
+ Serial.println(F("START " __FILE__ " from " __DATE__ "\r\nUsing library version " VERSION_IRREMOTE));
+
+ // Start the receiver and if not 3. parameter specified, take LED_BUILTIN pin from the internal boards definition as default feedback LED
+ IrReceiver.begin(IR_RECEIVE_PIN, ENABLE_LED_FEEDBACK);
+
+ Serial.println(F("Ready to receive unknown IR signals at pin " STR(IR_RECEIVE_PIN) " and decode it with hash decoder."));
+}
+
+void loop() {
+ /*
+ * Check if received data is available and if yes, try to decode it.
+ * Decoded hash result is in IrReceiver.decodedIRData.decodedRawData
+ */
+ if (IrReceiver.available()) {
+ IrReceiver.initDecodedIRData(); // is required, if we do not call decode();
+ IrReceiver.decodeHash();
+ IrReceiver.resume(); // Early enable receiving of the next IR frame
+ /*
+ * Print a summary and then timing of received data
+ */
+ IrReceiver.printIRResultShort(&Serial);
+ IrReceiver.printIRResultRawFormatted(&Serial, true);
+
+ Serial.println();
+
+ /*
+ * Finally, check the received data and perform actions according to the received command
+ */
+ auto tDecodedRawData = IrReceiver.decodedIRData.decodedRawData; // uint32_t on 8 and 16 bit CPUs and uint64_t on 32 and 64 bit CPUs
+ if (tDecodedRawData == 0x4F7BE2FB) {
+ // do something
+ } else if (tDecodedRawData == 0x97483BFB) {
+ // do something else
+ }
+ }
+}
diff --git a/libraries/IRremote/examples/SimpleReceiverWithCallback/PinDefinitionsAndMore.h b/libraries/IRremote/examples/SimpleReceiverWithCallback/PinDefinitionsAndMore.h
new file mode 100644
index 0000000..14573c7
--- /dev/null
+++ b/libraries/IRremote/examples/SimpleReceiverWithCallback/PinDefinitionsAndMore.h
@@ -0,0 +1,349 @@
+/*
+ * PinDefinitionsAndMore.h
+ *
+ * Contains pin definitions for IRremote examples for various platforms
+ * as well as definitions for feedback LED and tone() and includes
+ *
+ * Copyright (C) 2021-2023 Armin Joachimsmeyer
+ * armin.joachimsmeyer@gmail.com
+ *
+ * This file is part of IRremote https://github.com/Arduino-IRremote/Arduino-IRremote.
+ *
+ * Arduino-IRremote is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
+ * See the GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see .
+ *
+ */
+
+/*
+ * Pin mapping table for different platforms
+ *
+ * Platform IR input IR output Tone Core/Pin schema
+ * --------------------------------------------------------------
+ * DEFAULT/AVR 2 3 4 Arduino
+ * ATtinyX5 0|PB0 4|PB4 3|PB3 ATTinyCore
+ * ATtiny167 3|PA3 2|PA2 7|PA7 ATTinyCore
+ * ATtiny167 9|PA3 8|PA2 5|PA7 Digispark original core
+ * ATtiny84 |PB2 |PA4 |PA3 ATTinyCore
+ * ATtiny88 3|PD3 4|PD4 9|PB1 ATTinyCore
+ * ATtiny3217 18|PA1 19|PA2 20|PA3 MegaTinyCore
+ * ATtiny1604 2 3|PA5 %
+ * ATtiny816 14|PA1 16|PA3 1|PA5 MegaTinyCore
+ * ATtiny1614 8|PA1 10|PA3 1|PA5 MegaTinyCore
+ * SAMD21 3 4 5
+ * ESP8266 14|D5 12|D6 %
+ * ESP32 15 4 27
+ * ESP32-C3 2 3 4
+ * BluePill PA6 PA7 PA3
+ * APOLLO3 11 12 5
+ * RP2040 3|GPIO15 4|GPIO16 5|GPIO17
+ */
+//#define _IR_MEASURE_TIMING // For debugging purposes.
+
+#if defined(__AVR__)
+#if defined(__AVR_ATtiny25__) || defined(__AVR_ATtiny45__) || defined(__AVR_ATtiny85__) // Digispark board. For use with ATTinyCore.
+#include "ATtinySerialOut.hpp" // TX is at pin 2 - Available as Arduino library "ATtinySerialOut". Saves 700 bytes program memory and 70 bytes RAM for ATtinyCore.
+#define IR_RECEIVE_PIN PIN_PB0
+#define IR_SEND_PIN PIN_PB4 // Pin 2 is serial output with ATtinySerialOut. Pin 1 is internal LED and Pin3 is USB+ with pullup on Digispark board.
+#define TONE_PIN PIN_PB3
+#define _IR_TIMING_TEST_PIN PIN_PB3
+
+# elif defined(__AVR_ATtiny87__) || defined(__AVR_ATtiny167__) // Digispark pro board
+#include "ATtinySerialOut.hpp" // Available as Arduino library "ATtinySerialOut"
+// For ATtiny167 Pins PB6 and PA3 are usable as interrupt source.
+# if defined(ARDUINO_AVR_DIGISPARKPRO)
+// For use with Digispark original core
+#define IR_RECEIVE_PIN 9 // PA3 - on Digispark board labeled as pin 9
+//#define IR_RECEIVE_PIN 14 // PB6 / INT0 is connected to USB+ on DigisparkPro boards
+#define IR_SEND_PIN 8 // PA2 - on Digispark board labeled as pin 8
+#define TONE_PIN 5 // PA7 - on Digispark board labeled as pin 5
+#define _IR_TIMING_TEST_PIN 10 // PA4
+# else
+// For use with ATTinyCore
+#define IR_RECEIVE_PIN PIN_PA3 // On Digispark board labeled as pin 9 - INT0 is connected to USB+ on DigisparkPro boards
+#define IR_SEND_PIN PIN_PA2 // On Digispark board labeled as pin 8
+#define TONE_PIN PIN_PA7 // On Digispark board labeled as pin 5
+# endif
+
+# elif defined(__AVR_ATtiny84__) // For use with ATTinyCore
+#include "ATtinySerialOut.hpp" // Available as Arduino library "ATtinySerialOut". Saves 128 bytes program memory.
+#define IR_RECEIVE_PIN PIN_PB2 // INT0
+#define IR_SEND_PIN PIN_PA4
+#define TONE_PIN PIN_PA3
+#define _IR_TIMING_TEST_PIN PIN_PA5
+
+# elif defined(__AVR_ATtiny88__) // MH-ET Tiny88 board. For use with ATTinyCore.
+#include "ATtinySerialOut.hpp" // Available as Arduino library "ATtinySerialOut". Saves 128 bytes program memory.
+// Pin 6 is TX, pin 7 is RX
+#define IR_RECEIVE_PIN PIN_PD3 // 3 - INT1
+#define IR_SEND_PIN PIN_PD4 // 4
+#define TONE_PIN PIN_PB1 // 9
+#define _IR_TIMING_TEST_PIN PIN_PB0 // 8
+
+# elif defined(__AVR_ATtiny1616__) || defined(__AVR_ATtiny3216__) || defined(__AVR_ATtiny3217__) // For use with megaTinyCore
+// Tiny Core Dev board
+// https://www.tindie.com/products/xkimi/tiny-core-16-dev-board-attiny1616/ - Out of Stock
+// https://www.tindie.com/products/xkimi/tiny-core-32-dev-board-attiny3217/ - Out of Stock
+#define IR_RECEIVE_PIN PIN_PA1 // use 18 instead of PIN_PA1 for TinyCore32
+#define IR_SEND_PIN PIN_PA2 // 19
+#define TONE_PIN PIN_PA3 // 20
+#define APPLICATION_PIN PIN_PA0 // 0
+#undef LED_BUILTIN // No LED available on the TinyCore 32 board, take the one on the programming board which is connected to the DAC output
+#define LED_BUILTIN PIN_PA6 // use 2 instead of PIN_PA6 for TinyCore32
+
+# elif defined(__AVR_ATtiny816__) // For use with megaTinyCore
+#define IR_RECEIVE_PIN PIN_PA1 // 14
+#define IR_SEND_PIN PIN_PA1 // 16
+#define TONE_PIN PIN_PA5 // 1
+#define APPLICATION_PIN PIN_PA4 // 0
+#undef LED_BUILTIN // No LED available, take the one which is connected to the DAC output
+#define LED_BUILTIN PIN_PB5 // 4
+
+# elif defined(__AVR_ATtiny1614__) // For use with megaTinyCore
+#define IR_RECEIVE_PIN PIN_PA1 // 8
+#define IR_SEND_PIN PIN_PA3 // 10
+#define TONE_PIN PIN_PA5 // 1
+#define APPLICATION_PIN PIN_PA4 // 0
+
+# elif defined(__AVR_ATtiny1604__) // For use with megaTinyCore
+#define IR_RECEIVE_PIN PIN_PA6 // 2 - To be compatible with interrupt example, pin 2 is chosen here.
+#define IR_SEND_PIN PIN_PA7 // 3
+#define APPLICATION_PIN PIN_PB2 // 5
+
+#define tone(...) void() // Define as void, since TCB0_INT_vect is also used by tone()
+#define noTone(a) void()
+#define TONE_PIN 42 // Dummy for examples using it
+
+# elif defined(__AVR_ATmega1284__) || defined(__AVR_ATmega1284P__) \
+|| defined(__AVR_ATmega644__) || defined(__AVR_ATmega644P__) \
+|| defined(__AVR_ATmega324P__) || defined(__AVR_ATmega324A__) \
+|| defined(__AVR_ATmega324PA__) || defined(__AVR_ATmega164A__) \
+|| defined(__AVR_ATmega164P__) || defined(__AVR_ATmega32__) \
+|| defined(__AVR_ATmega16__) || defined(__AVR_ATmega8535__) \
+|| defined(__AVR_ATmega64__) || defined(__AVR_ATmega128__) \
+|| defined(__AVR_ATmega1281__) || defined(__AVR_ATmega2561__) \
+|| defined(__AVR_ATmega8515__) || defined(__AVR_ATmega162__)
+#define IR_RECEIVE_PIN 2
+#define IR_SEND_PIN 13
+#define TONE_PIN 4
+#define APPLICATION_PIN 5
+#define ALTERNATIVE_IR_FEEDBACK_LED_PIN 6 // E.g. used for examples which use LED_BUILDIN for example output.
+#define _IR_TIMING_TEST_PIN 7
+
+# else // Default as for ATmega328 like on Uno, Nano, Leonardo, Teensy 2.0 etc.
+#define IR_RECEIVE_PIN 2 // To be compatible with interrupt example, pin 2 is chosen here.
+#define IR_SEND_PIN 3
+#define TONE_PIN 4
+#define APPLICATION_PIN 5
+#define ALTERNATIVE_IR_FEEDBACK_LED_PIN 6 // E.g. used for examples which use LED_BUILDIN for example output.
+#define _IR_TIMING_TEST_PIN 7
+
+# if defined(ARDUINO_AVR_PROMICRO) // Sparkfun Pro Micro is __AVR_ATmega32U4__ but has different external circuit
+// We have no built in LED at pin 13 -> reuse RX LED
+#undef LED_BUILTIN
+#define LED_BUILTIN LED_BUILTIN_RX
+# endif
+# endif // defined(__AVR_ATtiny25__)...
+
+#elif defined(ARDUINO_ARCH_RENESAS_UNO) // Uno R4
+// To be compatible with Uno R3.
+#define IR_RECEIVE_PIN 2
+#define IR_SEND_PIN 3
+#define TONE_PIN 4
+#define APPLICATION_PIN 5
+#define ALTERNATIVE_IR_FEEDBACK_LED_PIN 6 // E.g. used for examples which use LED_BUILDIN for example output.
+#define _IR_TIMING_TEST_PIN 7
+
+#elif defined(ESP8266)
+#define FEEDBACK_LED_IS_ACTIVE_LOW // The LED on my board (D4) is active LOW
+#define IR_RECEIVE_PIN 14 // D5
+#define IR_SEND_PIN 12 // D6 - D4/pin 2 is internal LED
+#define _IR_TIMING_TEST_PIN 2 // D4
+#define APPLICATION_PIN 13 // D7
+
+#define tone(...) void() // tone() inhibits receive timer
+#define noTone(a) void()
+#define TONE_PIN 42 // Dummy for examples using it#
+
+#elif defined(ARDUINO_NOLOGO_ESP32C3_SUPER_MINI)
+#define FEEDBACK_LED_IS_ACTIVE_LOW // The LED on my board (D8) is active LOW
+#define IR_RECEIVE_PIN 2
+#define IR_SEND_PIN 3
+#define TONE_PIN 4
+#define APPLICATION_PIN 10
+
+#elif defined(CONFIG_IDF_TARGET_ESP32C3) || defined(ARDUINO_ESP32C3_DEV)
+#define NO_LED_FEEDBACK_CODE // The WS2812 on pin 8 of AI-C3 board crashes if used as receive feedback LED, other I/O pins are working...
+#define IR_RECEIVE_PIN 6
+#define IR_SEND_PIN 7
+#define TONE_PIN 10
+#define APPLICATION_PIN 18
+
+#elif defined(ESP32)
+#include
+
+// tone() is included in ESP32 core since 2.0.2
+#if !defined(ESP_ARDUINO_VERSION_VAL)
+#define ESP_ARDUINO_VERSION_VAL(major, minor, patch) 12345678
+#endif
+#if ESP_ARDUINO_VERSION <= ESP_ARDUINO_VERSION_VAL(2, 0, 2)
+#define TONE_LEDC_CHANNEL 1 // Using channel 1 makes tone() independent of receiving timer -> No need to stop receiving timer.
+void tone(uint8_t aPinNumber, unsigned int aFrequency){
+ ledcAttachPin(aPinNumber, TONE_LEDC_CHANNEL);
+ ledcWriteTone(TONE_LEDC_CHANNEL, aFrequency);
+}
+void tone(uint8_t aPinNumber, unsigned int aFrequency, unsigned long aDuration){
+ ledcAttachPin(aPinNumber, TONE_LEDC_CHANNEL);
+ ledcWriteTone(TONE_LEDC_CHANNEL, aFrequency);
+ delay(aDuration);
+ ledcWriteTone(TONE_LEDC_CHANNEL, 0);
+}
+void noTone(uint8_t aPinNumber){
+ ledcWriteTone(TONE_LEDC_CHANNEL, 0);
+}
+#endif // ESP_ARDUINO_VERSION <= ESP_ARDUINO_VERSION_VAL(2, 0, 2)
+
+#define IR_RECEIVE_PIN 15 // D15
+#define IR_SEND_PIN 4 // D4
+#define TONE_PIN 27 // D27 25 & 26 are DAC0 and 1
+#define APPLICATION_PIN 16 // RX2 pin
+
+#elif defined(ARDUINO_ARCH_STM32) || defined(ARDUINO_ARCH_STM32F1) // BluePill
+// Timer 3 blocks PA6, PA7, PB0, PB1 for use by Servo or tone()
+#define IR_RECEIVE_PIN PA6
+#define IR_RECEIVE_PIN_STRING "PA6"
+#define IR_SEND_PIN PA7
+#define IR_SEND_PIN_STRING "PA7"
+#define TONE_PIN PA3
+#define _IR_TIMING_TEST_PIN PA5
+#define APPLICATION_PIN PA2
+#define APPLICATION_PIN_STRING "PA2"
+# if defined(ARDUINO_GENERIC_STM32F103C) || defined(ARDUINO_BLUEPILL_F103C8)
+// BluePill LED is active low
+#define FEEDBACK_LED_IS_ACTIVE_LOW
+# endif
+
+#elif defined(ARDUINO_ARCH_APOLLO3) // Sparkfun Apollo boards
+#define IR_RECEIVE_PIN 11
+#define IR_SEND_PIN 12
+#define TONE_PIN 5
+
+#elif defined(ARDUINO_ARCH_MBED) && defined(ARDUINO_ARCH_MBED_NANO) // Arduino Nano 33 BLE and Arduino Nano Connect layout for MBED
+// Must be before ARDUINO_ARCH_RP2040, since it is the layout for the MBED core of Arduino Nano Connect
+#define IR_RECEIVE_PIN 3 // GPIO15 Start with pin 3 since pin 2|GPIO25 is connected to LED on Pi pico
+#define IR_SEND_PIN 4 // GPIO16
+#define TONE_PIN 5
+#define APPLICATION_PIN 6
+#define ALTERNATIVE_IR_FEEDBACK_LED_PIN 7 // E.g. used for examples which use LED_BUILDIN for example output.
+#define _IR_TIMING_TEST_PIN 8
+
+#elif defined(ARDUINO_ARCH_RP2040) // Arduino Nano Connect, Pi Pico with arduino-pico core https://github.com/earlephilhower/arduino-pico
+#define IR_RECEIVE_PIN 15 // GPIO15 to be compatible with the Arduino Nano RP2040 Connect (pin3)
+#define IR_SEND_PIN 16 // GPIO16
+#define TONE_PIN 17
+#define APPLICATION_PIN 18
+#define ALTERNATIVE_IR_FEEDBACK_LED_PIN 19 // E.g. used for examples which use LED_BUILDIN for example output.
+#define _IR_TIMING_TEST_PIN 20
+
+// If you program the Nano RP2040 Connect with this core, then you must redefine LED_BUILTIN
+// and use the external reset with 1 kOhm to ground to enter UF2 mode
+#undef LED_BUILTIN
+#define LED_BUILTIN 6
+
+#elif defined(PARTICLE) // !!!UNTESTED!!!
+#define IR_RECEIVE_PIN A4
+#define IR_SEND_PIN A5 // Particle supports multiple pins
+
+#define LED_BUILTIN D7
+
+/*
+ * 4 times the same (default) layout for easy adaption in the future
+ */
+#elif defined(TEENSYDUINO) // Teensy 2.0 is handled at default for ATmega328 like on Uno, Nano, Leonardo etc.
+#define IR_RECEIVE_PIN 2
+#define IR_SEND_PIN 3
+#define TONE_PIN 4
+#define APPLICATION_PIN 5
+#define ALTERNATIVE_IR_FEEDBACK_LED_PIN 6 // E.g. used for examples which use LED_BUILDIN for example output.
+#define _IR_TIMING_TEST_PIN 7
+
+#elif defined(ARDUINO_ARCH_MBED) // Arduino Nano 33 BLE
+#define IR_RECEIVE_PIN 2
+#define IR_SEND_PIN 3
+#define TONE_PIN 4
+#define APPLICATION_PIN 5
+#define ALTERNATIVE_IR_FEEDBACK_LED_PIN 6 // E.g. used for examples which use LED_BUILDIN for example output.
+#define _IR_TIMING_TEST_PIN 7
+
+#elif defined(ARDUINO_ARCH_SAMD) || defined(ARDUINO_ARCH_SAM)
+#define IR_RECEIVE_PIN 2
+#define IR_SEND_PIN 3
+#define TONE_PIN 4
+#define APPLICATION_PIN 5
+#define ALTERNATIVE_IR_FEEDBACK_LED_PIN 6 // E.g. used for examples which use LED_BUILDIN for example output.
+#define _IR_TIMING_TEST_PIN 7
+
+#if !defined(ARDUINO_SAMD_ADAFRUIT) && !defined(ARDUINO_SEEED_XIAO_M0)
+// On the Zero and others we switch explicitly to SerialUSB
+#define Serial SerialUSB
+#endif
+
+// Definitions for the Chinese SAMD21 M0-Mini clone, which has no led connected to D13/PA17.
+// Attention!!! D2 and D4 are swapped on these boards!!!
+// If you connect the LED, it is on pin 24/PB11. In this case activate the next two lines.
+//#undef LED_BUILTIN
+//#define LED_BUILTIN 24 // PB11
+// As an alternative you can choose pin 25, it is the RX-LED pin (PB03), but active low.In this case activate the next 3 lines.
+//#undef LED_BUILTIN
+//#define LED_BUILTIN 25 // PB03
+//#define FEEDBACK_LED_IS_ACTIVE_LOW // The RX LED on the M0-Mini is active LOW
+
+#elif defined (NRF51) // BBC micro:bit
+#define IR_RECEIVE_PIN 2
+#define IR_SEND_PIN 3
+#define APPLICATION_PIN 1
+#define _IR_TIMING_TEST_PIN 4
+
+#define tone(...) void() // no tone() available
+#define noTone(a) void()
+#define TONE_PIN 42 // Dummy for examples using it
+
+#else
+#warning Board / CPU is not detected using pre-processor symbols -> using default values, which may not fit. Please extend PinDefinitionsAndMore.h.
+// Default valued for unidentified boards
+#define IR_RECEIVE_PIN 2
+#define IR_SEND_PIN 3
+#define TONE_PIN 4
+#define APPLICATION_PIN 5
+#define ALTERNATIVE_IR_FEEDBACK_LED_PIN 6 // E.g. used for examples which use LED_BUILDIN for example output.
+#define _IR_TIMING_TEST_PIN 7
+#endif // defined(ESP8266)
+
+#if defined(ESP32) || defined(ARDUINO_ARCH_RP2040) || defined(PARTICLE) || defined(ARDUINO_ARCH_MBED)
+#define SEND_PWM_BY_TIMER // We do not have pin restrictions for this CPU's, so lets use the hardware PWM for send carrier signal generation
+#else
+# if defined(SEND_PWM_BY_TIMER)
+#undef IR_SEND_PIN // SendPin is determined by timer! This avoids warnings in IRremote.hpp and IRTimer.hpp
+# endif
+#endif
+
+#if !defined (FLASHEND)
+#define FLASHEND 0xFFFF // Dummy value for platforms where FLASHEND is not defined
+#endif
+
+/*
+ * Helper macro for getting a macro definition as string
+ */
+#if !defined(STR_HELPER)
+#define STR_HELPER(x) #x
+#define STR(x) STR_HELPER(x)
+#endif
diff --git a/libraries/IRremote/examples/SimpleReceiverWithCallback/SimpleReceiverWithCallback.ino b/libraries/IRremote/examples/SimpleReceiverWithCallback/SimpleReceiverWithCallback.ino
new file mode 100644
index 0000000..0f8321c
--- /dev/null
+++ b/libraries/IRremote/examples/SimpleReceiverWithCallback/SimpleReceiverWithCallback.ino
@@ -0,0 +1,165 @@
+/*
+ * SimpleReceiverWithCallback.cpp
+ *
+ * Demonstrates receiving NEC IR codes with IRrecv
+ *
+ * This file is part of Arduino-IRremote https://github.com/Arduino-IRremote/Arduino-IRremote.
+ *
+ ************************************************************************************
+ * MIT License
+ *
+ * Copyright (c) 2022 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.
+ *
+ ************************************************************************************
+ */
+
+/*
+ * Specify which protocol(s) should be used for decoding.
+ * If no protocol is defined, all protocols (except Bang&Olufsen) are active.
+ * This must be done before the #include
+ */
+//#define DECODE_DENON // Includes Sharp
+//#define DECODE_JVC
+//#define DECODE_KASEIKYO
+//#define DECODE_PANASONIC // alias for DECODE_KASEIKYO
+//#define DECODE_LG
+#define DECODE_NEC // Includes Apple and Onkyo
+//#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 // Universal decoder for pulse distance width protocols
+//#define DECODE_HASH // special decoder for all protocols
+
+//#define DECODE_BEO // This protocol must always be enabled manually, i.e. it is NOT enabled if no protocol is defined. It prevents decoding of SONY!
+
+//#define DEBUG // Activate this for lots of lovely debug output from the decoders.
+
+//#define RAW_BUFFER_LENGTH 750 // For air condition remotes it requires 750. Default is 200.
+
+#include
+
+//#include "PinDefinitionsAndMore.h" // Define macros for input and output pin etc.
+#include
+
+/*
+ * Helper macro for getting a macro definition as string
+ */
+#if !defined(STR_HELPER)
+#define STR_HELPER(x) #x
+#define STR(x) STR_HELPER(x)
+#endif
+
+#define IR_RECEIVE_PIN 4 // P0_1
+
+/*
+ * For callback
+ */
+// #define PROCESS_IR_RESULT_IN_MAIN_LOOP
+// #if defined(PROCESS_IR_RESULT_IN_MAIN_LOOP) || defined(ARDUINO_ARCH_MBED) || defined(ESP32)
+volatile bool sIRDataJustReceived = false;
+// #endif
+void ReceiveCompleteCallbackHandler();
+
+void setup() {
+ Serial.begin(9600);
+ while (!Serial)
+ ; // Wait for Serial to become available. Is optimized away for some cores.
+
+ // Just to know which program is running on my Arduino
+ Serial.println(F("START " __FILE__ " from " __DATE__ "\r\nUsing library version " VERSION_IRREMOTE));
+
+ // Start the receiver and if not 3. parameter specified, take LED_BUILTIN pin from the internal boards definition as default feedback LED
+ IrReceiver.begin(IR_RECEIVE_PIN, ENABLE_LED_FEEDBACK);
+ IrReceiver.registerReceiveCompleteCallback(ReceiveCompleteCallbackHandler);
+
+ Serial.print(F("Ready to receive IR signals of protocols: "));
+ printActiveIRProtocols(&Serial);
+ Serial.println(F("at pin " STR(IR_RECEIVE_PIN)));
+}
+
+void loop() {
+ /*
+ * Print in loop (interrupts are enabled here) if received data is available.
+ */
+ if (sIRDataJustReceived) {
+ // Print a summary of received data
+ if (IrReceiver.decodedIRData.protocol == UNKNOWN) {
+ Serial.println(F("Received noise or an unknown (or not yet enabled) protocol"));
+ /*
+ * We have an unknown protocol here, print more info.
+ * !!!Attention!!! This prints incorrect values, if we are late (not in this simple example :-))
+ * and the the first mark of the next (repeat) data was yet received
+ */
+ IrReceiver.printIRResultRawFormatted(&Serial, true); //
+ } else {
+ IrReceiver.printIRResultShort(&Serial);
+ IrReceiver.printIRSendUsage(&Serial);
+ }
+ Serial.println();
+ sIRDataJustReceived = false;
+ }
+}
+
+/*
+ * Callback function
+ * Here we know, that data is available.
+ * This function is executed in ISR (Interrupt Service Routine) context (interrupts are blocked here).
+ * Make it short and fast and keep in mind, that you can not use delay(), prints longer than print buffer size etc.,
+ * because they require interrupts enabled to return.
+ * In order to enable other interrupts you can call sei() (enable interrupt again) after evaluating/copying data.
+ * Good practice, but somewhat more complex, is to copy relevant data and signal receiving to main loop.
+ */
+void ReceiveCompleteCallbackHandler() {
+ IrReceiver.decode(); // fill IrReceiver.decodedIRData
+ /*
+ * Enable receiving of the next value.
+ */
+ IrReceiver.resume();
+
+ /*
+ * Check the received data and perform actions according to the received command
+ * Decoded result is in the IrReceiver.decodedIRData structure.
+ *
+ * E.g. command is in IrReceiver.decodedIRData.command,
+ * address is in command is in IrReceiver.decodedIRData.address
+ * and up to 32 bit raw data in IrReceiver.decodedIRData.decodedRawData
+ */
+ if (IrReceiver.decodedIRData.command == 0x10) {
+ // do something SHORT here
+ } else if (IrReceiver.decodedIRData.command == 0x11) {
+ // do something SHORT here too
+ }
+
+ /*
+ * Set flag to trigger printing of results in main loop,
+ * since printing should not be done in a callback function
+ * running in ISR (Interrupt Service Routine) context where interrupts are disabled.
+ */
+ sIRDataJustReceived = true;
+
+}
diff --git a/libraries/IRremote/examples/SimpleSender/PinDefinitionsAndMore.h b/libraries/IRremote/examples/SimpleSender/PinDefinitionsAndMore.h
new file mode 100644
index 0000000..14573c7
--- /dev/null
+++ b/libraries/IRremote/examples/SimpleSender/PinDefinitionsAndMore.h
@@ -0,0 +1,349 @@
+/*
+ * PinDefinitionsAndMore.h
+ *
+ * Contains pin definitions for IRremote examples for various platforms
+ * as well as definitions for feedback LED and tone() and includes
+ *
+ * Copyright (C) 2021-2023 Armin Joachimsmeyer
+ * armin.joachimsmeyer@gmail.com
+ *
+ * This file is part of IRremote https://github.com/Arduino-IRremote/Arduino-IRremote.
+ *
+ * Arduino-IRremote is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
+ * See the GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see .
+ *
+ */
+
+/*
+ * Pin mapping table for different platforms
+ *
+ * Platform IR input IR output Tone Core/Pin schema
+ * --------------------------------------------------------------
+ * DEFAULT/AVR 2 3 4 Arduino
+ * ATtinyX5 0|PB0 4|PB4 3|PB3 ATTinyCore
+ * ATtiny167 3|PA3 2|PA2 7|PA7 ATTinyCore
+ * ATtiny167 9|PA3 8|PA2 5|PA7 Digispark original core
+ * ATtiny84 |PB2 |PA4 |PA3 ATTinyCore
+ * ATtiny88 3|PD3 4|PD4 9|PB1 ATTinyCore
+ * ATtiny3217 18|PA1 19|PA2 20|PA3 MegaTinyCore
+ * ATtiny1604 2 3|PA5 %
+ * ATtiny816 14|PA1 16|PA3 1|PA5 MegaTinyCore
+ * ATtiny1614 8|PA1 10|PA3 1|PA5 MegaTinyCore
+ * SAMD21 3 4 5
+ * ESP8266 14|D5 12|D6 %
+ * ESP32 15 4 27
+ * ESP32-C3 2 3 4
+ * BluePill PA6 PA7 PA3
+ * APOLLO3 11 12 5
+ * RP2040 3|GPIO15 4|GPIO16 5|GPIO17
+ */
+//#define _IR_MEASURE_TIMING // For debugging purposes.
+
+#if defined(__AVR__)
+#if defined(__AVR_ATtiny25__) || defined(__AVR_ATtiny45__) || defined(__AVR_ATtiny85__) // Digispark board. For use with ATTinyCore.
+#include "ATtinySerialOut.hpp" // TX is at pin 2 - Available as Arduino library "ATtinySerialOut". Saves 700 bytes program memory and 70 bytes RAM for ATtinyCore.
+#define IR_RECEIVE_PIN PIN_PB0
+#define IR_SEND_PIN PIN_PB4 // Pin 2 is serial output with ATtinySerialOut. Pin 1 is internal LED and Pin3 is USB+ with pullup on Digispark board.
+#define TONE_PIN PIN_PB3
+#define _IR_TIMING_TEST_PIN PIN_PB3
+
+# elif defined(__AVR_ATtiny87__) || defined(__AVR_ATtiny167__) // Digispark pro board
+#include "ATtinySerialOut.hpp" // Available as Arduino library "ATtinySerialOut"
+// For ATtiny167 Pins PB6 and PA3 are usable as interrupt source.
+# if defined(ARDUINO_AVR_DIGISPARKPRO)
+// For use with Digispark original core
+#define IR_RECEIVE_PIN 9 // PA3 - on Digispark board labeled as pin 9
+//#define IR_RECEIVE_PIN 14 // PB6 / INT0 is connected to USB+ on DigisparkPro boards
+#define IR_SEND_PIN 8 // PA2 - on Digispark board labeled as pin 8
+#define TONE_PIN 5 // PA7 - on Digispark board labeled as pin 5
+#define _IR_TIMING_TEST_PIN 10 // PA4
+# else
+// For use with ATTinyCore
+#define IR_RECEIVE_PIN PIN_PA3 // On Digispark board labeled as pin 9 - INT0 is connected to USB+ on DigisparkPro boards
+#define IR_SEND_PIN PIN_PA2 // On Digispark board labeled as pin 8
+#define TONE_PIN PIN_PA7 // On Digispark board labeled as pin 5
+# endif
+
+# elif defined(__AVR_ATtiny84__) // For use with ATTinyCore
+#include "ATtinySerialOut.hpp" // Available as Arduino library "ATtinySerialOut". Saves 128 bytes program memory.
+#define IR_RECEIVE_PIN PIN_PB2 // INT0
+#define IR_SEND_PIN PIN_PA4
+#define TONE_PIN PIN_PA3
+#define _IR_TIMING_TEST_PIN PIN_PA5
+
+# elif defined(__AVR_ATtiny88__) // MH-ET Tiny88 board. For use with ATTinyCore.
+#include "ATtinySerialOut.hpp" // Available as Arduino library "ATtinySerialOut". Saves 128 bytes program memory.
+// Pin 6 is TX, pin 7 is RX
+#define IR_RECEIVE_PIN PIN_PD3 // 3 - INT1
+#define IR_SEND_PIN PIN_PD4 // 4
+#define TONE_PIN PIN_PB1 // 9
+#define _IR_TIMING_TEST_PIN PIN_PB0 // 8
+
+# elif defined(__AVR_ATtiny1616__) || defined(__AVR_ATtiny3216__) || defined(__AVR_ATtiny3217__) // For use with megaTinyCore
+// Tiny Core Dev board
+// https://www.tindie.com/products/xkimi/tiny-core-16-dev-board-attiny1616/ - Out of Stock
+// https://www.tindie.com/products/xkimi/tiny-core-32-dev-board-attiny3217/ - Out of Stock
+#define IR_RECEIVE_PIN PIN_PA1 // use 18 instead of PIN_PA1 for TinyCore32
+#define IR_SEND_PIN PIN_PA2 // 19
+#define TONE_PIN PIN_PA3 // 20
+#define APPLICATION_PIN PIN_PA0 // 0
+#undef LED_BUILTIN // No LED available on the TinyCore 32 board, take the one on the programming board which is connected to the DAC output
+#define LED_BUILTIN PIN_PA6 // use 2 instead of PIN_PA6 for TinyCore32
+
+# elif defined(__AVR_ATtiny816__) // For use with megaTinyCore
+#define IR_RECEIVE_PIN PIN_PA1 // 14
+#define IR_SEND_PIN PIN_PA1 // 16
+#define TONE_PIN PIN_PA5 // 1
+#define APPLICATION_PIN PIN_PA4 // 0
+#undef LED_BUILTIN // No LED available, take the one which is connected to the DAC output
+#define LED_BUILTIN PIN_PB5 // 4
+
+# elif defined(__AVR_ATtiny1614__) // For use with megaTinyCore
+#define IR_RECEIVE_PIN PIN_PA1 // 8
+#define IR_SEND_PIN PIN_PA3 // 10
+#define TONE_PIN PIN_PA5 // 1
+#define APPLICATION_PIN PIN_PA4 // 0
+
+# elif defined(__AVR_ATtiny1604__) // For use with megaTinyCore
+#define IR_RECEIVE_PIN PIN_PA6 // 2 - To be compatible with interrupt example, pin 2 is chosen here.
+#define IR_SEND_PIN PIN_PA7 // 3
+#define APPLICATION_PIN PIN_PB2 // 5
+
+#define tone(...) void() // Define as void, since TCB0_INT_vect is also used by tone()
+#define noTone(a) void()
+#define TONE_PIN 42 // Dummy for examples using it
+
+# elif defined(__AVR_ATmega1284__) || defined(__AVR_ATmega1284P__) \
+|| defined(__AVR_ATmega644__) || defined(__AVR_ATmega644P__) \
+|| defined(__AVR_ATmega324P__) || defined(__AVR_ATmega324A__) \
+|| defined(__AVR_ATmega324PA__) || defined(__AVR_ATmega164A__) \
+|| defined(__AVR_ATmega164P__) || defined(__AVR_ATmega32__) \
+|| defined(__AVR_ATmega16__) || defined(__AVR_ATmega8535__) \
+|| defined(__AVR_ATmega64__) || defined(__AVR_ATmega128__) \
+|| defined(__AVR_ATmega1281__) || defined(__AVR_ATmega2561__) \
+|| defined(__AVR_ATmega8515__) || defined(__AVR_ATmega162__)
+#define IR_RECEIVE_PIN 2
+#define IR_SEND_PIN 13
+#define TONE_PIN 4
+#define APPLICATION_PIN 5
+#define ALTERNATIVE_IR_FEEDBACK_LED_PIN 6 // E.g. used for examples which use LED_BUILDIN for example output.
+#define _IR_TIMING_TEST_PIN 7
+
+# else // Default as for ATmega328 like on Uno, Nano, Leonardo, Teensy 2.0 etc.
+#define IR_RECEIVE_PIN 2 // To be compatible with interrupt example, pin 2 is chosen here.
+#define IR_SEND_PIN 3
+#define TONE_PIN 4
+#define APPLICATION_PIN 5
+#define ALTERNATIVE_IR_FEEDBACK_LED_PIN 6 // E.g. used for examples which use LED_BUILDIN for example output.
+#define _IR_TIMING_TEST_PIN 7
+
+# if defined(ARDUINO_AVR_PROMICRO) // Sparkfun Pro Micro is __AVR_ATmega32U4__ but has different external circuit
+// We have no built in LED at pin 13 -> reuse RX LED
+#undef LED_BUILTIN
+#define LED_BUILTIN LED_BUILTIN_RX
+# endif
+# endif // defined(__AVR_ATtiny25__)...
+
+#elif defined(ARDUINO_ARCH_RENESAS_UNO) // Uno R4
+// To be compatible with Uno R3.
+#define IR_RECEIVE_PIN 2
+#define IR_SEND_PIN 3
+#define TONE_PIN 4
+#define APPLICATION_PIN 5
+#define ALTERNATIVE_IR_FEEDBACK_LED_PIN 6 // E.g. used for examples which use LED_BUILDIN for example output.
+#define _IR_TIMING_TEST_PIN 7
+
+#elif defined(ESP8266)
+#define FEEDBACK_LED_IS_ACTIVE_LOW // The LED on my board (D4) is active LOW
+#define IR_RECEIVE_PIN 14 // D5
+#define IR_SEND_PIN 12 // D6 - D4/pin 2 is internal LED
+#define _IR_TIMING_TEST_PIN 2 // D4
+#define APPLICATION_PIN 13 // D7
+
+#define tone(...) void() // tone() inhibits receive timer
+#define noTone(a) void()
+#define TONE_PIN 42 // Dummy for examples using it#
+
+#elif defined(ARDUINO_NOLOGO_ESP32C3_SUPER_MINI)
+#define FEEDBACK_LED_IS_ACTIVE_LOW // The LED on my board (D8) is active LOW
+#define IR_RECEIVE_PIN 2
+#define IR_SEND_PIN 3
+#define TONE_PIN 4
+#define APPLICATION_PIN 10
+
+#elif defined(CONFIG_IDF_TARGET_ESP32C3) || defined(ARDUINO_ESP32C3_DEV)
+#define NO_LED_FEEDBACK_CODE // The WS2812 on pin 8 of AI-C3 board crashes if used as receive feedback LED, other I/O pins are working...
+#define IR_RECEIVE_PIN 6
+#define IR_SEND_PIN 7
+#define TONE_PIN 10
+#define APPLICATION_PIN 18
+
+#elif defined(ESP32)
+#include
+
+// tone() is included in ESP32 core since 2.0.2
+#if !defined(ESP_ARDUINO_VERSION_VAL)
+#define ESP_ARDUINO_VERSION_VAL(major, minor, patch) 12345678
+#endif
+#if ESP_ARDUINO_VERSION <= ESP_ARDUINO_VERSION_VAL(2, 0, 2)
+#define TONE_LEDC_CHANNEL 1 // Using channel 1 makes tone() independent of receiving timer -> No need to stop receiving timer.
+void tone(uint8_t aPinNumber, unsigned int aFrequency){
+ ledcAttachPin(aPinNumber, TONE_LEDC_CHANNEL);
+ ledcWriteTone(TONE_LEDC_CHANNEL, aFrequency);
+}
+void tone(uint8_t aPinNumber, unsigned int aFrequency, unsigned long aDuration){
+ ledcAttachPin(aPinNumber, TONE_LEDC_CHANNEL);
+ ledcWriteTone(TONE_LEDC_CHANNEL, aFrequency);
+ delay(aDuration);
+ ledcWriteTone(TONE_LEDC_CHANNEL, 0);
+}
+void noTone(uint8_t aPinNumber){
+ ledcWriteTone(TONE_LEDC_CHANNEL, 0);
+}
+#endif // ESP_ARDUINO_VERSION <= ESP_ARDUINO_VERSION_VAL(2, 0, 2)
+
+#define IR_RECEIVE_PIN 15 // D15
+#define IR_SEND_PIN 4 // D4
+#define TONE_PIN 27 // D27 25 & 26 are DAC0 and 1
+#define APPLICATION_PIN 16 // RX2 pin
+
+#elif defined(ARDUINO_ARCH_STM32) || defined(ARDUINO_ARCH_STM32F1) // BluePill
+// Timer 3 blocks PA6, PA7, PB0, PB1 for use by Servo or tone()
+#define IR_RECEIVE_PIN PA6
+#define IR_RECEIVE_PIN_STRING "PA6"
+#define IR_SEND_PIN PA7
+#define IR_SEND_PIN_STRING "PA7"
+#define TONE_PIN PA3
+#define _IR_TIMING_TEST_PIN PA5
+#define APPLICATION_PIN PA2
+#define APPLICATION_PIN_STRING "PA2"
+# if defined(ARDUINO_GENERIC_STM32F103C) || defined(ARDUINO_BLUEPILL_F103C8)
+// BluePill LED is active low
+#define FEEDBACK_LED_IS_ACTIVE_LOW
+# endif
+
+#elif defined(ARDUINO_ARCH_APOLLO3) // Sparkfun Apollo boards
+#define IR_RECEIVE_PIN 11
+#define IR_SEND_PIN 12
+#define TONE_PIN 5
+
+#elif defined(ARDUINO_ARCH_MBED) && defined(ARDUINO_ARCH_MBED_NANO) // Arduino Nano 33 BLE and Arduino Nano Connect layout for MBED
+// Must be before ARDUINO_ARCH_RP2040, since it is the layout for the MBED core of Arduino Nano Connect
+#define IR_RECEIVE_PIN 3 // GPIO15 Start with pin 3 since pin 2|GPIO25 is connected to LED on Pi pico
+#define IR_SEND_PIN 4 // GPIO16
+#define TONE_PIN 5
+#define APPLICATION_PIN 6
+#define ALTERNATIVE_IR_FEEDBACK_LED_PIN 7 // E.g. used for examples which use LED_BUILDIN for example output.
+#define _IR_TIMING_TEST_PIN 8
+
+#elif defined(ARDUINO_ARCH_RP2040) // Arduino Nano Connect, Pi Pico with arduino-pico core https://github.com/earlephilhower/arduino-pico
+#define IR_RECEIVE_PIN 15 // GPIO15 to be compatible with the Arduino Nano RP2040 Connect (pin3)
+#define IR_SEND_PIN 16 // GPIO16
+#define TONE_PIN 17
+#define APPLICATION_PIN 18
+#define ALTERNATIVE_IR_FEEDBACK_LED_PIN 19 // E.g. used for examples which use LED_BUILDIN for example output.
+#define _IR_TIMING_TEST_PIN 20
+
+// If you program the Nano RP2040 Connect with this core, then you must redefine LED_BUILTIN
+// and use the external reset with 1 kOhm to ground to enter UF2 mode
+#undef LED_BUILTIN
+#define LED_BUILTIN 6
+
+#elif defined(PARTICLE) // !!!UNTESTED!!!
+#define IR_RECEIVE_PIN A4
+#define IR_SEND_PIN A5 // Particle supports multiple pins
+
+#define LED_BUILTIN D7
+
+/*
+ * 4 times the same (default) layout for easy adaption in the future
+ */
+#elif defined(TEENSYDUINO) // Teensy 2.0 is handled at default for ATmega328 like on Uno, Nano, Leonardo etc.
+#define IR_RECEIVE_PIN 2
+#define IR_SEND_PIN 3
+#define TONE_PIN 4
+#define APPLICATION_PIN 5
+#define ALTERNATIVE_IR_FEEDBACK_LED_PIN 6 // E.g. used for examples which use LED_BUILDIN for example output.
+#define _IR_TIMING_TEST_PIN 7
+
+#elif defined(ARDUINO_ARCH_MBED) // Arduino Nano 33 BLE
+#define IR_RECEIVE_PIN 2
+#define IR_SEND_PIN 3
+#define TONE_PIN 4
+#define APPLICATION_PIN 5
+#define ALTERNATIVE_IR_FEEDBACK_LED_PIN 6 // E.g. used for examples which use LED_BUILDIN for example output.
+#define _IR_TIMING_TEST_PIN 7
+
+#elif defined(ARDUINO_ARCH_SAMD) || defined(ARDUINO_ARCH_SAM)
+#define IR_RECEIVE_PIN 2
+#define IR_SEND_PIN 3
+#define TONE_PIN 4
+#define APPLICATION_PIN 5
+#define ALTERNATIVE_IR_FEEDBACK_LED_PIN 6 // E.g. used for examples which use LED_BUILDIN for example output.
+#define _IR_TIMING_TEST_PIN 7
+
+#if !defined(ARDUINO_SAMD_ADAFRUIT) && !defined(ARDUINO_SEEED_XIAO_M0)
+// On the Zero and others we switch explicitly to SerialUSB
+#define Serial SerialUSB
+#endif
+
+// Definitions for the Chinese SAMD21 M0-Mini clone, which has no led connected to D13/PA17.
+// Attention!!! D2 and D4 are swapped on these boards!!!
+// If you connect the LED, it is on pin 24/PB11. In this case activate the next two lines.
+//#undef LED_BUILTIN
+//#define LED_BUILTIN 24 // PB11
+// As an alternative you can choose pin 25, it is the RX-LED pin (PB03), but active low.In this case activate the next 3 lines.
+//#undef LED_BUILTIN
+//#define LED_BUILTIN 25 // PB03
+//#define FEEDBACK_LED_IS_ACTIVE_LOW // The RX LED on the M0-Mini is active LOW
+
+#elif defined (NRF51) // BBC micro:bit
+#define IR_RECEIVE_PIN 2
+#define IR_SEND_PIN 3
+#define APPLICATION_PIN 1
+#define _IR_TIMING_TEST_PIN 4
+
+#define tone(...) void() // no tone() available
+#define noTone(a) void()
+#define TONE_PIN 42 // Dummy for examples using it
+
+#else
+#warning Board / CPU is not detected using pre-processor symbols -> using default values, which may not fit. Please extend PinDefinitionsAndMore.h.
+// Default valued for unidentified boards
+#define IR_RECEIVE_PIN 2
+#define IR_SEND_PIN 3
+#define TONE_PIN 4
+#define APPLICATION_PIN 5
+#define ALTERNATIVE_IR_FEEDBACK_LED_PIN 6 // E.g. used for examples which use LED_BUILDIN for example output.
+#define _IR_TIMING_TEST_PIN 7
+#endif // defined(ESP8266)
+
+#if defined(ESP32) || defined(ARDUINO_ARCH_RP2040) || defined(PARTICLE) || defined(ARDUINO_ARCH_MBED)
+#define SEND_PWM_BY_TIMER // We do not have pin restrictions for this CPU's, so lets use the hardware PWM for send carrier signal generation
+#else
+# if defined(SEND_PWM_BY_TIMER)
+#undef IR_SEND_PIN // SendPin is determined by timer! This avoids warnings in IRremote.hpp and IRTimer.hpp
+# endif
+#endif
+
+#if !defined (FLASHEND)
+#define FLASHEND 0xFFFF // Dummy value for platforms where FLASHEND is not defined
+#endif
+
+/*
+ * Helper macro for getting a macro definition as string
+ */
+#if !defined(STR_HELPER)
+#define STR_HELPER(x) #x
+#define STR(x) STR_HELPER(x)
+#endif
diff --git a/libraries/IRremote/examples/SimpleSender/SimpleSender.ino b/libraries/IRremote/examples/SimpleSender/SimpleSender.ino
new file mode 100644
index 0000000..66198eb
--- /dev/null
+++ b/libraries/IRremote/examples/SimpleSender/SimpleSender.ino
@@ -0,0 +1,91 @@
+/*
+ * SimpleSender.cpp
+ *
+ * Demonstrates sending IR codes in standard format with address and command
+ * An extended example for sending can be found as SendDemo.
+ *
+ * Copyright (C) 2020-2022 Armin Joachimsmeyer
+ * armin.joachimsmeyer@gmail.com
+ *
+ * This file is part of Arduino-IRremote https://github.com/Arduino-IRremote/Arduino-IRremote.
+ *
+ * MIT License
+ */
+#include
+
+//#define SEND_PWM_BY_TIMER // Disable carrier PWM generation in software and use (restricted) hardware PWM.
+//#define USE_NO_SEND_PWM // Use no carrier PWM, just simulate an active low receiver signal. Overrides SEND_PWM_BY_TIMER definition
+
+#define IR_SEND_PIN 3 // P0_0
+
+#include // include the library
+
+void setup() {
+ pinMode(LED_BUILTIN, OUTPUT);
+
+ Serial.begin(9600);
+ while (!Serial)
+ ; // Wait for Serial to become available. Is optimized away for some cores.
+
+ // Just to know which program is running on my Arduino
+ Serial.println(F("START " __FILE__ " from " __DATE__ "\r\nUsing library version " VERSION_IRREMOTE));
+ Serial.print(F("Send IR signals at pin "));
+ Serial.println(IR_SEND_PIN);
+
+ /*
+ * The IR library setup. That's all!
+ */
+ IrSender.begin(); // Start with IR_SEND_PIN -which is defined in PinDefinitionsAndMore.h- as send pin and enable feedback LED at default feedback LED pin
+ disableLEDFeedback(); // Disable feedback LED at default feedback LED pin
+}
+
+/*
+ * Set up the data to be sent.
+ * For most protocols, the data is build up with a constant 8 (or 16 byte) address
+ * and a variable 8 bit command.
+ * There are exceptions like Sony and Denon, which have 5 bit address.
+ */
+uint8_t sCommand = 0x34;
+uint8_t sRepeats = 0;
+
+void loop() {
+ /*
+ * Print current send values
+ */
+ Serial.println();
+ Serial.print(F("Send now: address=0x00, command=0x"));
+ Serial.print(sCommand, HEX);
+ Serial.print(F(", repeats="));
+ Serial.print(sRepeats);
+ Serial.println();
+
+ Serial.println(F("Send standard NEC with 8 bit address"));
+ Serial.flush();
+
+ // Receiver output for the first loop must be: Protocol=NEC Address=0x102 Command=0x34 Raw-Data=0xCB340102 (32 bits)
+ IrSender.sendNEC(0x00, sCommand, sRepeats);
+
+ /*
+ * If you want to send a raw HEX value directly like e.g. 0xCB340102 you must use sendNECRaw()
+ */
+// Serial.println(F("Send 32 bit LSB 0xCB340102 with NECRaw()"));
+// IrSender.sendNECRaw(0xCB340102, sRepeats);
+
+ /*
+ * If you want to send an "old" MSB HEX value used by IRremote versions before 3.0 like e.g. 0x40802CD3 you must use sendNECMSB()
+ */
+// Serial.println(F("Send old 32 bit MSB 0x40802CD3 with sendNECMSB()"));
+// IrSender.sendNECMSB(0x40802CD3, 32, sRepeats);
+
+ /*
+ * Increment send values
+ */
+ sCommand += 0x11;
+ sRepeats++;
+ // clip repeats at 4
+ if (sRepeats > 4) {
+ sRepeats = 4;
+ }
+
+ delay(1000); // delay must be greater than 5 ms (RECORD_GAP_MICROS), otherwise the receiver sees it as one long signal
+}
diff --git a/libraries/IRremote/examples/TinyReceiver/PinDefinitionsAndMore.h b/libraries/IRremote/examples/TinyReceiver/PinDefinitionsAndMore.h
new file mode 100644
index 0000000..14573c7
--- /dev/null
+++ b/libraries/IRremote/examples/TinyReceiver/PinDefinitionsAndMore.h
@@ -0,0 +1,349 @@
+/*
+ * PinDefinitionsAndMore.h
+ *
+ * Contains pin definitions for IRremote examples for various platforms
+ * as well as definitions for feedback LED and tone() and includes
+ *
+ * Copyright (C) 2021-2023 Armin Joachimsmeyer
+ * armin.joachimsmeyer@gmail.com
+ *
+ * This file is part of IRremote https://github.com/Arduino-IRremote/Arduino-IRremote.
+ *
+ * Arduino-IRremote is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
+ * See the GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see .
+ *
+ */
+
+/*
+ * Pin mapping table for different platforms
+ *
+ * Platform IR input IR output Tone Core/Pin schema
+ * --------------------------------------------------------------
+ * DEFAULT/AVR 2 3 4 Arduino
+ * ATtinyX5 0|PB0 4|PB4 3|PB3 ATTinyCore
+ * ATtiny167 3|PA3 2|PA2 7|PA7 ATTinyCore
+ * ATtiny167 9|PA3 8|PA2 5|PA7 Digispark original core
+ * ATtiny84 |PB2 |PA4 |PA3 ATTinyCore
+ * ATtiny88 3|PD3 4|PD4 9|PB1 ATTinyCore
+ * ATtiny3217 18|PA1 19|PA2 20|PA3 MegaTinyCore
+ * ATtiny1604 2 3|PA5 %
+ * ATtiny816 14|PA1 16|PA3 1|PA5 MegaTinyCore
+ * ATtiny1614 8|PA1 10|PA3 1|PA5 MegaTinyCore
+ * SAMD21 3 4 5
+ * ESP8266 14|D5 12|D6 %
+ * ESP32 15 4 27
+ * ESP32-C3 2 3 4
+ * BluePill PA6 PA7 PA3
+ * APOLLO3 11 12 5
+ * RP2040 3|GPIO15 4|GPIO16 5|GPIO17
+ */
+//#define _IR_MEASURE_TIMING // For debugging purposes.
+
+#if defined(__AVR__)
+#if defined(__AVR_ATtiny25__) || defined(__AVR_ATtiny45__) || defined(__AVR_ATtiny85__) // Digispark board. For use with ATTinyCore.
+#include "ATtinySerialOut.hpp" // TX is at pin 2 - Available as Arduino library "ATtinySerialOut". Saves 700 bytes program memory and 70 bytes RAM for ATtinyCore.
+#define IR_RECEIVE_PIN PIN_PB0
+#define IR_SEND_PIN PIN_PB4 // Pin 2 is serial output with ATtinySerialOut. Pin 1 is internal LED and Pin3 is USB+ with pullup on Digispark board.
+#define TONE_PIN PIN_PB3
+#define _IR_TIMING_TEST_PIN PIN_PB3
+
+# elif defined(__AVR_ATtiny87__) || defined(__AVR_ATtiny167__) // Digispark pro board
+#include "ATtinySerialOut.hpp" // Available as Arduino library "ATtinySerialOut"
+// For ATtiny167 Pins PB6 and PA3 are usable as interrupt source.
+# if defined(ARDUINO_AVR_DIGISPARKPRO)
+// For use with Digispark original core
+#define IR_RECEIVE_PIN 9 // PA3 - on Digispark board labeled as pin 9
+//#define IR_RECEIVE_PIN 14 // PB6 / INT0 is connected to USB+ on DigisparkPro boards
+#define IR_SEND_PIN 8 // PA2 - on Digispark board labeled as pin 8
+#define TONE_PIN 5 // PA7 - on Digispark board labeled as pin 5
+#define _IR_TIMING_TEST_PIN 10 // PA4
+# else
+// For use with ATTinyCore
+#define IR_RECEIVE_PIN PIN_PA3 // On Digispark board labeled as pin 9 - INT0 is connected to USB+ on DigisparkPro boards
+#define IR_SEND_PIN PIN_PA2 // On Digispark board labeled as pin 8
+#define TONE_PIN PIN_PA7 // On Digispark board labeled as pin 5
+# endif
+
+# elif defined(__AVR_ATtiny84__) // For use with ATTinyCore
+#include "ATtinySerialOut.hpp" // Available as Arduino library "ATtinySerialOut". Saves 128 bytes program memory.
+#define IR_RECEIVE_PIN PIN_PB2 // INT0
+#define IR_SEND_PIN PIN_PA4
+#define TONE_PIN PIN_PA3
+#define _IR_TIMING_TEST_PIN PIN_PA5
+
+# elif defined(__AVR_ATtiny88__) // MH-ET Tiny88 board. For use with ATTinyCore.
+#include "ATtinySerialOut.hpp" // Available as Arduino library "ATtinySerialOut". Saves 128 bytes program memory.
+// Pin 6 is TX, pin 7 is RX
+#define IR_RECEIVE_PIN PIN_PD3 // 3 - INT1
+#define IR_SEND_PIN PIN_PD4 // 4
+#define TONE_PIN PIN_PB1 // 9
+#define _IR_TIMING_TEST_PIN PIN_PB0 // 8
+
+# elif defined(__AVR_ATtiny1616__) || defined(__AVR_ATtiny3216__) || defined(__AVR_ATtiny3217__) // For use with megaTinyCore
+// Tiny Core Dev board
+// https://www.tindie.com/products/xkimi/tiny-core-16-dev-board-attiny1616/ - Out of Stock
+// https://www.tindie.com/products/xkimi/tiny-core-32-dev-board-attiny3217/ - Out of Stock
+#define IR_RECEIVE_PIN PIN_PA1 // use 18 instead of PIN_PA1 for TinyCore32
+#define IR_SEND_PIN PIN_PA2 // 19
+#define TONE_PIN PIN_PA3 // 20
+#define APPLICATION_PIN PIN_PA0 // 0
+#undef LED_BUILTIN // No LED available on the TinyCore 32 board, take the one on the programming board which is connected to the DAC output
+#define LED_BUILTIN PIN_PA6 // use 2 instead of PIN_PA6 for TinyCore32
+
+# elif defined(__AVR_ATtiny816__) // For use with megaTinyCore
+#define IR_RECEIVE_PIN PIN_PA1 // 14
+#define IR_SEND_PIN PIN_PA1 // 16
+#define TONE_PIN PIN_PA5 // 1
+#define APPLICATION_PIN PIN_PA4 // 0
+#undef LED_BUILTIN // No LED available, take the one which is connected to the DAC output
+#define LED_BUILTIN PIN_PB5 // 4
+
+# elif defined(__AVR_ATtiny1614__) // For use with megaTinyCore
+#define IR_RECEIVE_PIN PIN_PA1 // 8
+#define IR_SEND_PIN PIN_PA3 // 10
+#define TONE_PIN PIN_PA5 // 1
+#define APPLICATION_PIN PIN_PA4 // 0
+
+# elif defined(__AVR_ATtiny1604__) // For use with megaTinyCore
+#define IR_RECEIVE_PIN PIN_PA6 // 2 - To be compatible with interrupt example, pin 2 is chosen here.
+#define IR_SEND_PIN PIN_PA7 // 3
+#define APPLICATION_PIN PIN_PB2 // 5
+
+#define tone(...) void() // Define as void, since TCB0_INT_vect is also used by tone()
+#define noTone(a) void()
+#define TONE_PIN 42 // Dummy for examples using it
+
+# elif defined(__AVR_ATmega1284__) || defined(__AVR_ATmega1284P__) \
+|| defined(__AVR_ATmega644__) || defined(__AVR_ATmega644P__) \
+|| defined(__AVR_ATmega324P__) || defined(__AVR_ATmega324A__) \
+|| defined(__AVR_ATmega324PA__) || defined(__AVR_ATmega164A__) \
+|| defined(__AVR_ATmega164P__) || defined(__AVR_ATmega32__) \
+|| defined(__AVR_ATmega16__) || defined(__AVR_ATmega8535__) \
+|| defined(__AVR_ATmega64__) || defined(__AVR_ATmega128__) \
+|| defined(__AVR_ATmega1281__) || defined(__AVR_ATmega2561__) \
+|| defined(__AVR_ATmega8515__) || defined(__AVR_ATmega162__)
+#define IR_RECEIVE_PIN 2
+#define IR_SEND_PIN 13
+#define TONE_PIN 4
+#define APPLICATION_PIN 5
+#define ALTERNATIVE_IR_FEEDBACK_LED_PIN 6 // E.g. used for examples which use LED_BUILDIN for example output.
+#define _IR_TIMING_TEST_PIN 7
+
+# else // Default as for ATmega328 like on Uno, Nano, Leonardo, Teensy 2.0 etc.
+#define IR_RECEIVE_PIN 2 // To be compatible with interrupt example, pin 2 is chosen here.
+#define IR_SEND_PIN 3
+#define TONE_PIN 4
+#define APPLICATION_PIN 5
+#define ALTERNATIVE_IR_FEEDBACK_LED_PIN 6 // E.g. used for examples which use LED_BUILDIN for example output.
+#define _IR_TIMING_TEST_PIN 7
+
+# if defined(ARDUINO_AVR_PROMICRO) // Sparkfun Pro Micro is __AVR_ATmega32U4__ but has different external circuit
+// We have no built in LED at pin 13 -> reuse RX LED
+#undef LED_BUILTIN
+#define LED_BUILTIN LED_BUILTIN_RX
+# endif
+# endif // defined(__AVR_ATtiny25__)...
+
+#elif defined(ARDUINO_ARCH_RENESAS_UNO) // Uno R4
+// To be compatible with Uno R3.
+#define IR_RECEIVE_PIN 2
+#define IR_SEND_PIN 3
+#define TONE_PIN 4
+#define APPLICATION_PIN 5
+#define ALTERNATIVE_IR_FEEDBACK_LED_PIN 6 // E.g. used for examples which use LED_BUILDIN for example output.
+#define _IR_TIMING_TEST_PIN 7
+
+#elif defined(ESP8266)
+#define FEEDBACK_LED_IS_ACTIVE_LOW // The LED on my board (D4) is active LOW
+#define IR_RECEIVE_PIN 14 // D5
+#define IR_SEND_PIN 12 // D6 - D4/pin 2 is internal LED
+#define _IR_TIMING_TEST_PIN 2 // D4
+#define APPLICATION_PIN 13 // D7
+
+#define tone(...) void() // tone() inhibits receive timer
+#define noTone(a) void()
+#define TONE_PIN 42 // Dummy for examples using it#
+
+#elif defined(ARDUINO_NOLOGO_ESP32C3_SUPER_MINI)
+#define FEEDBACK_LED_IS_ACTIVE_LOW // The LED on my board (D8) is active LOW
+#define IR_RECEIVE_PIN 2
+#define IR_SEND_PIN 3
+#define TONE_PIN 4
+#define APPLICATION_PIN 10
+
+#elif defined(CONFIG_IDF_TARGET_ESP32C3) || defined(ARDUINO_ESP32C3_DEV)
+#define NO_LED_FEEDBACK_CODE // The WS2812 on pin 8 of AI-C3 board crashes if used as receive feedback LED, other I/O pins are working...
+#define IR_RECEIVE_PIN 6
+#define IR_SEND_PIN 7
+#define TONE_PIN 10
+#define APPLICATION_PIN 18
+
+#elif defined(ESP32)
+#include
+
+// tone() is included in ESP32 core since 2.0.2
+#if !defined(ESP_ARDUINO_VERSION_VAL)
+#define ESP_ARDUINO_VERSION_VAL(major, minor, patch) 12345678
+#endif
+#if ESP_ARDUINO_VERSION <= ESP_ARDUINO_VERSION_VAL(2, 0, 2)
+#define TONE_LEDC_CHANNEL 1 // Using channel 1 makes tone() independent of receiving timer -> No need to stop receiving timer.
+void tone(uint8_t aPinNumber, unsigned int aFrequency){
+ ledcAttachPin(aPinNumber, TONE_LEDC_CHANNEL);
+ ledcWriteTone(TONE_LEDC_CHANNEL, aFrequency);
+}
+void tone(uint8_t aPinNumber, unsigned int aFrequency, unsigned long aDuration){
+ ledcAttachPin(aPinNumber, TONE_LEDC_CHANNEL);
+ ledcWriteTone(TONE_LEDC_CHANNEL, aFrequency);
+ delay(aDuration);
+ ledcWriteTone(TONE_LEDC_CHANNEL, 0);
+}
+void noTone(uint8_t aPinNumber){
+ ledcWriteTone(TONE_LEDC_CHANNEL, 0);
+}
+#endif // ESP_ARDUINO_VERSION <= ESP_ARDUINO_VERSION_VAL(2, 0, 2)
+
+#define IR_RECEIVE_PIN 15 // D15
+#define IR_SEND_PIN 4 // D4
+#define TONE_PIN 27 // D27 25 & 26 are DAC0 and 1
+#define APPLICATION_PIN 16 // RX2 pin
+
+#elif defined(ARDUINO_ARCH_STM32) || defined(ARDUINO_ARCH_STM32F1) // BluePill
+// Timer 3 blocks PA6, PA7, PB0, PB1 for use by Servo or tone()
+#define IR_RECEIVE_PIN PA6
+#define IR_RECEIVE_PIN_STRING "PA6"
+#define IR_SEND_PIN PA7
+#define IR_SEND_PIN_STRING "PA7"
+#define TONE_PIN PA3
+#define _IR_TIMING_TEST_PIN PA5
+#define APPLICATION_PIN PA2
+#define APPLICATION_PIN_STRING "PA2"
+# if defined(ARDUINO_GENERIC_STM32F103C) || defined(ARDUINO_BLUEPILL_F103C8)
+// BluePill LED is active low
+#define FEEDBACK_LED_IS_ACTIVE_LOW
+# endif
+
+#elif defined(ARDUINO_ARCH_APOLLO3) // Sparkfun Apollo boards
+#define IR_RECEIVE_PIN 11
+#define IR_SEND_PIN 12
+#define TONE_PIN 5
+
+#elif defined(ARDUINO_ARCH_MBED) && defined(ARDUINO_ARCH_MBED_NANO) // Arduino Nano 33 BLE and Arduino Nano Connect layout for MBED
+// Must be before ARDUINO_ARCH_RP2040, since it is the layout for the MBED core of Arduino Nano Connect
+#define IR_RECEIVE_PIN 3 // GPIO15 Start with pin 3 since pin 2|GPIO25 is connected to LED on Pi pico
+#define IR_SEND_PIN 4 // GPIO16
+#define TONE_PIN 5
+#define APPLICATION_PIN 6
+#define ALTERNATIVE_IR_FEEDBACK_LED_PIN 7 // E.g. used for examples which use LED_BUILDIN for example output.
+#define _IR_TIMING_TEST_PIN 8
+
+#elif defined(ARDUINO_ARCH_RP2040) // Arduino Nano Connect, Pi Pico with arduino-pico core https://github.com/earlephilhower/arduino-pico
+#define IR_RECEIVE_PIN 15 // GPIO15 to be compatible with the Arduino Nano RP2040 Connect (pin3)
+#define IR_SEND_PIN 16 // GPIO16
+#define TONE_PIN 17
+#define APPLICATION_PIN 18
+#define ALTERNATIVE_IR_FEEDBACK_LED_PIN 19 // E.g. used for examples which use LED_BUILDIN for example output.
+#define _IR_TIMING_TEST_PIN 20
+
+// If you program the Nano RP2040 Connect with this core, then you must redefine LED_BUILTIN
+// and use the external reset with 1 kOhm to ground to enter UF2 mode
+#undef LED_BUILTIN
+#define LED_BUILTIN 6
+
+#elif defined(PARTICLE) // !!!UNTESTED!!!
+#define IR_RECEIVE_PIN A4
+#define IR_SEND_PIN A5 // Particle supports multiple pins
+
+#define LED_BUILTIN D7
+
+/*
+ * 4 times the same (default) layout for easy adaption in the future
+ */
+#elif defined(TEENSYDUINO) // Teensy 2.0 is handled at default for ATmega328 like on Uno, Nano, Leonardo etc.
+#define IR_RECEIVE_PIN 2
+#define IR_SEND_PIN 3
+#define TONE_PIN 4
+#define APPLICATION_PIN 5
+#define ALTERNATIVE_IR_FEEDBACK_LED_PIN 6 // E.g. used for examples which use LED_BUILDIN for example output.
+#define _IR_TIMING_TEST_PIN 7
+
+#elif defined(ARDUINO_ARCH_MBED) // Arduino Nano 33 BLE
+#define IR_RECEIVE_PIN 2
+#define IR_SEND_PIN 3
+#define TONE_PIN 4
+#define APPLICATION_PIN 5
+#define ALTERNATIVE_IR_FEEDBACK_LED_PIN 6 // E.g. used for examples which use LED_BUILDIN for example output.
+#define _IR_TIMING_TEST_PIN 7
+
+#elif defined(ARDUINO_ARCH_SAMD) || defined(ARDUINO_ARCH_SAM)
+#define IR_RECEIVE_PIN 2
+#define IR_SEND_PIN 3
+#define TONE_PIN 4
+#define APPLICATION_PIN 5
+#define ALTERNATIVE_IR_FEEDBACK_LED_PIN 6 // E.g. used for examples which use LED_BUILDIN for example output.
+#define _IR_TIMING_TEST_PIN 7
+
+#if !defined(ARDUINO_SAMD_ADAFRUIT) && !defined(ARDUINO_SEEED_XIAO_M0)
+// On the Zero and others we switch explicitly to SerialUSB
+#define Serial SerialUSB
+#endif
+
+// Definitions for the Chinese SAMD21 M0-Mini clone, which has no led connected to D13/PA17.
+// Attention!!! D2 and D4 are swapped on these boards!!!
+// If you connect the LED, it is on pin 24/PB11. In this case activate the next two lines.
+//#undef LED_BUILTIN
+//#define LED_BUILTIN 24 // PB11
+// As an alternative you can choose pin 25, it is the RX-LED pin (PB03), but active low.In this case activate the next 3 lines.
+//#undef LED_BUILTIN
+//#define LED_BUILTIN 25 // PB03
+//#define FEEDBACK_LED_IS_ACTIVE_LOW // The RX LED on the M0-Mini is active LOW
+
+#elif defined (NRF51) // BBC micro:bit
+#define IR_RECEIVE_PIN 2
+#define IR_SEND_PIN 3
+#define APPLICATION_PIN 1
+#define _IR_TIMING_TEST_PIN 4
+
+#define tone(...) void() // no tone() available
+#define noTone(a) void()
+#define TONE_PIN 42 // Dummy for examples using it
+
+#else
+#warning Board / CPU is not detected using pre-processor symbols -> using default values, which may not fit. Please extend PinDefinitionsAndMore.h.
+// Default valued for unidentified boards
+#define IR_RECEIVE_PIN 2
+#define IR_SEND_PIN 3
+#define TONE_PIN 4
+#define APPLICATION_PIN 5
+#define ALTERNATIVE_IR_FEEDBACK_LED_PIN 6 // E.g. used for examples which use LED_BUILDIN for example output.
+#define _IR_TIMING_TEST_PIN 7
+#endif // defined(ESP8266)
+
+#if defined(ESP32) || defined(ARDUINO_ARCH_RP2040) || defined(PARTICLE) || defined(ARDUINO_ARCH_MBED)
+#define SEND_PWM_BY_TIMER // We do not have pin restrictions for this CPU's, so lets use the hardware PWM for send carrier signal generation
+#else
+# if defined(SEND_PWM_BY_TIMER)
+#undef IR_SEND_PIN // SendPin is determined by timer! This avoids warnings in IRremote.hpp and IRTimer.hpp
+# endif
+#endif
+
+#if !defined (FLASHEND)
+#define FLASHEND 0xFFFF // Dummy value for platforms where FLASHEND is not defined
+#endif
+
+/*
+ * Helper macro for getting a macro definition as string
+ */
+#if !defined(STR_HELPER)
+#define STR_HELPER(x) #x
+#define STR(x) STR_HELPER(x)
+#endif
diff --git a/libraries/IRremote/examples/TinyReceiver/TinyReceiver.ino b/libraries/IRremote/examples/TinyReceiver/TinyReceiver.ino
new file mode 100644
index 0000000..a887982
--- /dev/null
+++ b/libraries/IRremote/examples/TinyReceiver/TinyReceiver.ino
@@ -0,0 +1,147 @@
+/*
+ * TinyReceiver.cpp
+ *
+ * Small memory footprint and no timer usage!
+ *
+ * Receives IR protocol data of NEC protocol using pin change interrupts.
+ * On complete received IR command the function handleReceivedIRData(uint16_t aAddress, uint8_t aCommand, uint8_t aFlags)
+ * is called in Interrupt context but with interrupts being enabled to enable use of delay() etc.
+ * !!!!!!!!!!!!!!!!!!!!!!
+ * Functions called in interrupt context should be running as short as possible,
+ * so if you require longer action, save the data (address + command) and handle it in the main loop.
+ * !!!!!!!!!!!!!!!!!!!!!
+ *
+ * The FAST protocol is a proprietary modified JVC protocol without address, with parity and with a shorter header.
+ * FAST Protocol characteristics:
+ * - Bit timing is like NEC or JVC
+ * - The header is shorter, 3156 vs. 12500
+ * - No address and 16 bit data, interpreted as 8 bit command and 8 bit inverted command,
+ * leading to a fixed protocol length of (6 + (16 * 3) + 1) * 526 = 55 * 526 = 28930 microseconds or 29 ms.
+ * - Repeats are sent as complete frames but in a 50 ms period / with a 21 ms distance.
+ *
+ *
+ * This file is part of IRMP https://github.com/IRMP-org/IRMP.
+ * This file is part of Arduino-IRremote https://github.com/Arduino-IRremote/Arduino-IRremote.
+ *
+ ************************************************************************************
+ * MIT License
+ *
+ * Copyright (c) 2022-2024 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.
+ *
+ ************************************************************************************
+ */
+
+#include
+
+// IR_RECEIVE_PIN must be avialable to use in attachInterrupt()
+#define IR_RECEIVE_PIN 4 // 4 P1_9
+
+
+/*
+ * Protocol selection
+ */
+//#define DISABLE_PARITY_CHECKS // Disable parity checks. Saves 48 bytes of program memory.
+//#define USE_EXTENDED_NEC_PROTOCOL // Like NEC, but take the 16 bit address as one 16 bit value and not as 8 bit normal and 8 bit inverted value.
+//#define USE_ONKYO_PROTOCOL // Like NEC, but take the 16 bit address and command each as one 16 bit value and not as 8 bit normal and 8 bit inverted value.
+//#define USE_FAST_PROTOCOL // Use FAST protocol instead of NEC / ONKYO.
+//#define ENABLE_NEC2_REPEATS // Instead of sending / receiving the NEC special repeat code, send / receive the original frame for repeat.
+/*
+ * Set compile options to modify the generated code.
+ */
+//#define DISABLE_PARITY_CHECKS // Disable parity checks. Saves 48 bytes of program memory.
+//#define USE_CALLBACK_FOR_TINY_RECEIVER // Call the fixed function "void handleReceivedTinyIRData()" each time a frame or repeat is received.
+
+#include "TinyIRReceiver.hpp" // include the code
+/*
+ * Helper macro for getting a macro definition as string
+ */
+#if !defined(STR_HELPER)
+#define STR_HELPER(x) #x
+#define STR(x) STR_HELPER(x)
+#endif
+
+void setup() {
+ Serial.begin(9600);
+ while (!Serial)
+ ; // Wait for Serial to become available. Is optimized away for some cores.
+
+ // Just to know which program is running on my Arduino
+ Serial.println(F("START " __FILE__ " from " __DATE__ "\r\nUsing library version " VERSION_TINYIR));
+
+ // Enables the interrupt generation on change of IR input signal
+ if (!initPCIInterruptForTinyReceiver()) {
+ Serial.println(F("No interrupt available for pin " STR(IR_RECEIVE_PIN))); // optimized out by the compiler, if not required :-)
+ }
+#if defined(USE_FAST_PROTOCOL)
+ Serial.println(F("Ready to receive Fast IR signals at pin " STR(IR_RECEIVE_PIN)));
+#else
+ Serial.println(F("Ready to receive NEC IR signals at pin " STR(IR_RECEIVE_PIN)));
+#endif
+}
+
+void loop() {
+ if (TinyReceiverDecode()) {
+
+#if !defined(USE_FAST_PROTOCOL)
+ // We have no address at FAST protocol
+ Serial.print(F("Address=0x"));
+ Serial.print(TinyIRReceiverData.Address, HEX);
+ Serial.print(' ');
+#endif
+
+ Serial.print(F("Command=0x"));
+ Serial.print(TinyIRReceiverData.Command, HEX);
+ if (TinyIRReceiverData.Flags == IRDATA_FLAGS_IS_REPEAT) {
+ Serial.print(F(" Repeat"));
+ }
+ if (TinyIRReceiverData.Flags == IRDATA_FLAGS_PARITY_FAILED) {
+ Serial.print(F(" Parity failed"));
+
+#if !defined(USE_EXTENDED_NEC_PROTOCOL) && !defined(USE_ONKYO_PROTOCOL)
+ Serial.print(F(", try USE_EXTENDED_NEC_PROTOCOL or USE_ONKYO_PROTOCOL"));
+#endif
+
+ }
+ Serial.println();
+ }
+ /*
+ * Put your code here
+ */
+
+ /*
+ * No resume() required :-)
+ */
+}
+
+/*
+ * Optional code, if you require a callback
+ */
+#if defined(USE_CALLBACK_FOR_TINY_RECEIVER)
+/*
+ * This is the function, which is called if a complete frame was received
+ * It runs in an ISR context with interrupts enabled, so functions like delay() etc. should work here
+ */
+
+void handleReceivedTinyIRData() {
+ // As an example, print very short output, since we are in an interrupt context and do not want to miss the next interrupts of the repeats coming soon
+ printTinyReceiverResultMinimal(&Serial);
+}
+#endif
+
diff --git a/libraries/IRremote/examples/TinySender/PinDefinitionsAndMore.h b/libraries/IRremote/examples/TinySender/PinDefinitionsAndMore.h
new file mode 100644
index 0000000..14573c7
--- /dev/null
+++ b/libraries/IRremote/examples/TinySender/PinDefinitionsAndMore.h
@@ -0,0 +1,349 @@
+/*
+ * PinDefinitionsAndMore.h
+ *
+ * Contains pin definitions for IRremote examples for various platforms
+ * as well as definitions for feedback LED and tone() and includes
+ *
+ * Copyright (C) 2021-2023 Armin Joachimsmeyer
+ * armin.joachimsmeyer@gmail.com
+ *
+ * This file is part of IRremote https://github.com/Arduino-IRremote/Arduino-IRremote.
+ *
+ * Arduino-IRremote is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
+ * See the GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see .
+ *
+ */
+
+/*
+ * Pin mapping table for different platforms
+ *
+ * Platform IR input IR output Tone Core/Pin schema
+ * --------------------------------------------------------------
+ * DEFAULT/AVR 2 3 4 Arduino
+ * ATtinyX5 0|PB0 4|PB4 3|PB3 ATTinyCore
+ * ATtiny167 3|PA3 2|PA2 7|PA7 ATTinyCore
+ * ATtiny167 9|PA3 8|PA2 5|PA7 Digispark original core
+ * ATtiny84 |PB2 |PA4 |PA3 ATTinyCore
+ * ATtiny88 3|PD3 4|PD4 9|PB1 ATTinyCore
+ * ATtiny3217 18|PA1 19|PA2 20|PA3 MegaTinyCore
+ * ATtiny1604 2 3|PA5 %
+ * ATtiny816 14|PA1 16|PA3 1|PA5 MegaTinyCore
+ * ATtiny1614 8|PA1 10|PA3 1|PA5 MegaTinyCore
+ * SAMD21 3 4 5
+ * ESP8266 14|D5 12|D6 %
+ * ESP32 15 4 27
+ * ESP32-C3 2 3 4
+ * BluePill PA6 PA7 PA3
+ * APOLLO3 11 12 5
+ * RP2040 3|GPIO15 4|GPIO16 5|GPIO17
+ */
+//#define _IR_MEASURE_TIMING // For debugging purposes.
+
+#if defined(__AVR__)
+#if defined(__AVR_ATtiny25__) || defined(__AVR_ATtiny45__) || defined(__AVR_ATtiny85__) // Digispark board. For use with ATTinyCore.
+#include "ATtinySerialOut.hpp" // TX is at pin 2 - Available as Arduino library "ATtinySerialOut". Saves 700 bytes program memory and 70 bytes RAM for ATtinyCore.
+#define IR_RECEIVE_PIN PIN_PB0
+#define IR_SEND_PIN PIN_PB4 // Pin 2 is serial output with ATtinySerialOut. Pin 1 is internal LED and Pin3 is USB+ with pullup on Digispark board.
+#define TONE_PIN PIN_PB3
+#define _IR_TIMING_TEST_PIN PIN_PB3
+
+# elif defined(__AVR_ATtiny87__) || defined(__AVR_ATtiny167__) // Digispark pro board
+#include "ATtinySerialOut.hpp" // Available as Arduino library "ATtinySerialOut"
+// For ATtiny167 Pins PB6 and PA3 are usable as interrupt source.
+# if defined(ARDUINO_AVR_DIGISPARKPRO)
+// For use with Digispark original core
+#define IR_RECEIVE_PIN 9 // PA3 - on Digispark board labeled as pin 9
+//#define IR_RECEIVE_PIN 14 // PB6 / INT0 is connected to USB+ on DigisparkPro boards
+#define IR_SEND_PIN 8 // PA2 - on Digispark board labeled as pin 8
+#define TONE_PIN 5 // PA7 - on Digispark board labeled as pin 5
+#define _IR_TIMING_TEST_PIN 10 // PA4
+# else
+// For use with ATTinyCore
+#define IR_RECEIVE_PIN PIN_PA3 // On Digispark board labeled as pin 9 - INT0 is connected to USB+ on DigisparkPro boards
+#define IR_SEND_PIN PIN_PA2 // On Digispark board labeled as pin 8
+#define TONE_PIN PIN_PA7 // On Digispark board labeled as pin 5
+# endif
+
+# elif defined(__AVR_ATtiny84__) // For use with ATTinyCore
+#include "ATtinySerialOut.hpp" // Available as Arduino library "ATtinySerialOut". Saves 128 bytes program memory.
+#define IR_RECEIVE_PIN PIN_PB2 // INT0
+#define IR_SEND_PIN PIN_PA4
+#define TONE_PIN PIN_PA3
+#define _IR_TIMING_TEST_PIN PIN_PA5
+
+# elif defined(__AVR_ATtiny88__) // MH-ET Tiny88 board. For use with ATTinyCore.
+#include "ATtinySerialOut.hpp" // Available as Arduino library "ATtinySerialOut". Saves 128 bytes program memory.
+// Pin 6 is TX, pin 7 is RX
+#define IR_RECEIVE_PIN PIN_PD3 // 3 - INT1
+#define IR_SEND_PIN PIN_PD4 // 4
+#define TONE_PIN PIN_PB1 // 9
+#define _IR_TIMING_TEST_PIN PIN_PB0 // 8
+
+# elif defined(__AVR_ATtiny1616__) || defined(__AVR_ATtiny3216__) || defined(__AVR_ATtiny3217__) // For use with megaTinyCore
+// Tiny Core Dev board
+// https://www.tindie.com/products/xkimi/tiny-core-16-dev-board-attiny1616/ - Out of Stock
+// https://www.tindie.com/products/xkimi/tiny-core-32-dev-board-attiny3217/ - Out of Stock
+#define IR_RECEIVE_PIN PIN_PA1 // use 18 instead of PIN_PA1 for TinyCore32
+#define IR_SEND_PIN PIN_PA2 // 19
+#define TONE_PIN PIN_PA3 // 20
+#define APPLICATION_PIN PIN_PA0 // 0
+#undef LED_BUILTIN // No LED available on the TinyCore 32 board, take the one on the programming board which is connected to the DAC output
+#define LED_BUILTIN PIN_PA6 // use 2 instead of PIN_PA6 for TinyCore32
+
+# elif defined(__AVR_ATtiny816__) // For use with megaTinyCore
+#define IR_RECEIVE_PIN PIN_PA1 // 14
+#define IR_SEND_PIN PIN_PA1 // 16
+#define TONE_PIN PIN_PA5 // 1
+#define APPLICATION_PIN PIN_PA4 // 0
+#undef LED_BUILTIN // No LED available, take the one which is connected to the DAC output
+#define LED_BUILTIN PIN_PB5 // 4
+
+# elif defined(__AVR_ATtiny1614__) // For use with megaTinyCore
+#define IR_RECEIVE_PIN PIN_PA1 // 8
+#define IR_SEND_PIN PIN_PA3 // 10
+#define TONE_PIN PIN_PA5 // 1
+#define APPLICATION_PIN PIN_PA4 // 0
+
+# elif defined(__AVR_ATtiny1604__) // For use with megaTinyCore
+#define IR_RECEIVE_PIN PIN_PA6 // 2 - To be compatible with interrupt example, pin 2 is chosen here.
+#define IR_SEND_PIN PIN_PA7 // 3
+#define APPLICATION_PIN PIN_PB2 // 5
+
+#define tone(...) void() // Define as void, since TCB0_INT_vect is also used by tone()
+#define noTone(a) void()
+#define TONE_PIN 42 // Dummy for examples using it
+
+# elif defined(__AVR_ATmega1284__) || defined(__AVR_ATmega1284P__) \
+|| defined(__AVR_ATmega644__) || defined(__AVR_ATmega644P__) \
+|| defined(__AVR_ATmega324P__) || defined(__AVR_ATmega324A__) \
+|| defined(__AVR_ATmega324PA__) || defined(__AVR_ATmega164A__) \
+|| defined(__AVR_ATmega164P__) || defined(__AVR_ATmega32__) \
+|| defined(__AVR_ATmega16__) || defined(__AVR_ATmega8535__) \
+|| defined(__AVR_ATmega64__) || defined(__AVR_ATmega128__) \
+|| defined(__AVR_ATmega1281__) || defined(__AVR_ATmega2561__) \
+|| defined(__AVR_ATmega8515__) || defined(__AVR_ATmega162__)
+#define IR_RECEIVE_PIN 2
+#define IR_SEND_PIN 13
+#define TONE_PIN 4
+#define APPLICATION_PIN 5
+#define ALTERNATIVE_IR_FEEDBACK_LED_PIN 6 // E.g. used for examples which use LED_BUILDIN for example output.
+#define _IR_TIMING_TEST_PIN 7
+
+# else // Default as for ATmega328 like on Uno, Nano, Leonardo, Teensy 2.0 etc.
+#define IR_RECEIVE_PIN 2 // To be compatible with interrupt example, pin 2 is chosen here.
+#define IR_SEND_PIN 3
+#define TONE_PIN 4
+#define APPLICATION_PIN 5
+#define ALTERNATIVE_IR_FEEDBACK_LED_PIN 6 // E.g. used for examples which use LED_BUILDIN for example output.
+#define _IR_TIMING_TEST_PIN 7
+
+# if defined(ARDUINO_AVR_PROMICRO) // Sparkfun Pro Micro is __AVR_ATmega32U4__ but has different external circuit
+// We have no built in LED at pin 13 -> reuse RX LED
+#undef LED_BUILTIN
+#define LED_BUILTIN LED_BUILTIN_RX
+# endif
+# endif // defined(__AVR_ATtiny25__)...
+
+#elif defined(ARDUINO_ARCH_RENESAS_UNO) // Uno R4
+// To be compatible with Uno R3.
+#define IR_RECEIVE_PIN 2
+#define IR_SEND_PIN 3
+#define TONE_PIN 4
+#define APPLICATION_PIN 5
+#define ALTERNATIVE_IR_FEEDBACK_LED_PIN 6 // E.g. used for examples which use LED_BUILDIN for example output.
+#define _IR_TIMING_TEST_PIN 7
+
+#elif defined(ESP8266)
+#define FEEDBACK_LED_IS_ACTIVE_LOW // The LED on my board (D4) is active LOW
+#define IR_RECEIVE_PIN 14 // D5
+#define IR_SEND_PIN 12 // D6 - D4/pin 2 is internal LED
+#define _IR_TIMING_TEST_PIN 2 // D4
+#define APPLICATION_PIN 13 // D7
+
+#define tone(...) void() // tone() inhibits receive timer
+#define noTone(a) void()
+#define TONE_PIN 42 // Dummy for examples using it#
+
+#elif defined(ARDUINO_NOLOGO_ESP32C3_SUPER_MINI)
+#define FEEDBACK_LED_IS_ACTIVE_LOW // The LED on my board (D8) is active LOW
+#define IR_RECEIVE_PIN 2
+#define IR_SEND_PIN 3
+#define TONE_PIN 4
+#define APPLICATION_PIN 10
+
+#elif defined(CONFIG_IDF_TARGET_ESP32C3) || defined(ARDUINO_ESP32C3_DEV)
+#define NO_LED_FEEDBACK_CODE // The WS2812 on pin 8 of AI-C3 board crashes if used as receive feedback LED, other I/O pins are working...
+#define IR_RECEIVE_PIN 6
+#define IR_SEND_PIN 7
+#define TONE_PIN 10
+#define APPLICATION_PIN 18
+
+#elif defined(ESP32)
+#include
+
+// tone() is included in ESP32 core since 2.0.2
+#if !defined(ESP_ARDUINO_VERSION_VAL)
+#define ESP_ARDUINO_VERSION_VAL(major, minor, patch) 12345678
+#endif
+#if ESP_ARDUINO_VERSION <= ESP_ARDUINO_VERSION_VAL(2, 0, 2)
+#define TONE_LEDC_CHANNEL 1 // Using channel 1 makes tone() independent of receiving timer -> No need to stop receiving timer.
+void tone(uint8_t aPinNumber, unsigned int aFrequency){
+ ledcAttachPin(aPinNumber, TONE_LEDC_CHANNEL);
+ ledcWriteTone(TONE_LEDC_CHANNEL, aFrequency);
+}
+void tone(uint8_t aPinNumber, unsigned int aFrequency, unsigned long aDuration){
+ ledcAttachPin(aPinNumber, TONE_LEDC_CHANNEL);
+ ledcWriteTone(TONE_LEDC_CHANNEL, aFrequency);
+ delay(aDuration);
+ ledcWriteTone(TONE_LEDC_CHANNEL, 0);
+}
+void noTone(uint8_t aPinNumber){
+ ledcWriteTone(TONE_LEDC_CHANNEL, 0);
+}
+#endif // ESP_ARDUINO_VERSION <= ESP_ARDUINO_VERSION_VAL(2, 0, 2)
+
+#define IR_RECEIVE_PIN 15 // D15
+#define IR_SEND_PIN 4 // D4
+#define TONE_PIN 27 // D27 25 & 26 are DAC0 and 1
+#define APPLICATION_PIN 16 // RX2 pin
+
+#elif defined(ARDUINO_ARCH_STM32) || defined(ARDUINO_ARCH_STM32F1) // BluePill
+// Timer 3 blocks PA6, PA7, PB0, PB1 for use by Servo or tone()
+#define IR_RECEIVE_PIN PA6
+#define IR_RECEIVE_PIN_STRING "PA6"
+#define IR_SEND_PIN PA7
+#define IR_SEND_PIN_STRING "PA7"
+#define TONE_PIN PA3
+#define _IR_TIMING_TEST_PIN PA5
+#define APPLICATION_PIN PA2
+#define APPLICATION_PIN_STRING "PA2"
+# if defined(ARDUINO_GENERIC_STM32F103C) || defined(ARDUINO_BLUEPILL_F103C8)
+// BluePill LED is active low
+#define FEEDBACK_LED_IS_ACTIVE_LOW
+# endif
+
+#elif defined(ARDUINO_ARCH_APOLLO3) // Sparkfun Apollo boards
+#define IR_RECEIVE_PIN 11
+#define IR_SEND_PIN 12
+#define TONE_PIN 5
+
+#elif defined(ARDUINO_ARCH_MBED) && defined(ARDUINO_ARCH_MBED_NANO) // Arduino Nano 33 BLE and Arduino Nano Connect layout for MBED
+// Must be before ARDUINO_ARCH_RP2040, since it is the layout for the MBED core of Arduino Nano Connect
+#define IR_RECEIVE_PIN 3 // GPIO15 Start with pin 3 since pin 2|GPIO25 is connected to LED on Pi pico
+#define IR_SEND_PIN 4 // GPIO16
+#define TONE_PIN 5
+#define APPLICATION_PIN 6
+#define ALTERNATIVE_IR_FEEDBACK_LED_PIN 7 // E.g. used for examples which use LED_BUILDIN for example output.
+#define _IR_TIMING_TEST_PIN 8
+
+#elif defined(ARDUINO_ARCH_RP2040) // Arduino Nano Connect, Pi Pico with arduino-pico core https://github.com/earlephilhower/arduino-pico
+#define IR_RECEIVE_PIN 15 // GPIO15 to be compatible with the Arduino Nano RP2040 Connect (pin3)
+#define IR_SEND_PIN 16 // GPIO16
+#define TONE_PIN 17
+#define APPLICATION_PIN 18
+#define ALTERNATIVE_IR_FEEDBACK_LED_PIN 19 // E.g. used for examples which use LED_BUILDIN for example output.
+#define _IR_TIMING_TEST_PIN 20
+
+// If you program the Nano RP2040 Connect with this core, then you must redefine LED_BUILTIN
+// and use the external reset with 1 kOhm to ground to enter UF2 mode
+#undef LED_BUILTIN
+#define LED_BUILTIN 6
+
+#elif defined(PARTICLE) // !!!UNTESTED!!!
+#define IR_RECEIVE_PIN A4
+#define IR_SEND_PIN A5 // Particle supports multiple pins
+
+#define LED_BUILTIN D7
+
+/*
+ * 4 times the same (default) layout for easy adaption in the future
+ */
+#elif defined(TEENSYDUINO) // Teensy 2.0 is handled at default for ATmega328 like on Uno, Nano, Leonardo etc.
+#define IR_RECEIVE_PIN 2
+#define IR_SEND_PIN 3
+#define TONE_PIN 4
+#define APPLICATION_PIN 5
+#define ALTERNATIVE_IR_FEEDBACK_LED_PIN 6 // E.g. used for examples which use LED_BUILDIN for example output.
+#define _IR_TIMING_TEST_PIN 7
+
+#elif defined(ARDUINO_ARCH_MBED) // Arduino Nano 33 BLE
+#define IR_RECEIVE_PIN 2
+#define IR_SEND_PIN 3
+#define TONE_PIN 4
+#define APPLICATION_PIN 5
+#define ALTERNATIVE_IR_FEEDBACK_LED_PIN 6 // E.g. used for examples which use LED_BUILDIN for example output.
+#define _IR_TIMING_TEST_PIN 7
+
+#elif defined(ARDUINO_ARCH_SAMD) || defined(ARDUINO_ARCH_SAM)
+#define IR_RECEIVE_PIN 2
+#define IR_SEND_PIN 3
+#define TONE_PIN 4
+#define APPLICATION_PIN 5
+#define ALTERNATIVE_IR_FEEDBACK_LED_PIN 6 // E.g. used for examples which use LED_BUILDIN for example output.
+#define _IR_TIMING_TEST_PIN 7
+
+#if !defined(ARDUINO_SAMD_ADAFRUIT) && !defined(ARDUINO_SEEED_XIAO_M0)
+// On the Zero and others we switch explicitly to SerialUSB
+#define Serial SerialUSB
+#endif
+
+// Definitions for the Chinese SAMD21 M0-Mini clone, which has no led connected to D13/PA17.
+// Attention!!! D2 and D4 are swapped on these boards!!!
+// If you connect the LED, it is on pin 24/PB11. In this case activate the next two lines.
+//#undef LED_BUILTIN
+//#define LED_BUILTIN 24 // PB11
+// As an alternative you can choose pin 25, it is the RX-LED pin (PB03), but active low.In this case activate the next 3 lines.
+//#undef LED_BUILTIN
+//#define LED_BUILTIN 25 // PB03
+//#define FEEDBACK_LED_IS_ACTIVE_LOW // The RX LED on the M0-Mini is active LOW
+
+#elif defined (NRF51) // BBC micro:bit
+#define IR_RECEIVE_PIN 2
+#define IR_SEND_PIN 3
+#define APPLICATION_PIN 1
+#define _IR_TIMING_TEST_PIN 4
+
+#define tone(...) void() // no tone() available
+#define noTone(a) void()
+#define TONE_PIN 42 // Dummy for examples using it
+
+#else
+#warning Board / CPU is not detected using pre-processor symbols -> using default values, which may not fit. Please extend PinDefinitionsAndMore.h.
+// Default valued for unidentified boards
+#define IR_RECEIVE_PIN 2
+#define IR_SEND_PIN 3
+#define TONE_PIN 4
+#define APPLICATION_PIN 5
+#define ALTERNATIVE_IR_FEEDBACK_LED_PIN 6 // E.g. used for examples which use LED_BUILDIN for example output.
+#define _IR_TIMING_TEST_PIN 7
+#endif // defined(ESP8266)
+
+#if defined(ESP32) || defined(ARDUINO_ARCH_RP2040) || defined(PARTICLE) || defined(ARDUINO_ARCH_MBED)
+#define SEND_PWM_BY_TIMER // We do not have pin restrictions for this CPU's, so lets use the hardware PWM for send carrier signal generation
+#else
+# if defined(SEND_PWM_BY_TIMER)
+#undef IR_SEND_PIN // SendPin is determined by timer! This avoids warnings in IRremote.hpp and IRTimer.hpp
+# endif
+#endif
+
+#if !defined (FLASHEND)
+#define FLASHEND 0xFFFF // Dummy value for platforms where FLASHEND is not defined
+#endif
+
+/*
+ * Helper macro for getting a macro definition as string
+ */
+#if !defined(STR_HELPER)
+#define STR_HELPER(x) #x
+#define STR(x) STR_HELPER(x)
+#endif
diff --git a/libraries/IRremote/examples/TinySender/TinySender.ino b/libraries/IRremote/examples/TinySender/TinySender.ino
new file mode 100644
index 0000000..426aad6
--- /dev/null
+++ b/libraries/IRremote/examples/TinySender/TinySender.ino
@@ -0,0 +1,138 @@
+/*
+ * TinySender.cpp
+ *
+ * Example for sending using TinyIR. By default sends simultaneously using all supported protocols
+ * To use a single protocol, simply delete or comment out all unneeded protocols in the main loop
+ * Program size is significantly reduced when using a single protocol
+ * For example, sending only 8 bit address and command NEC codes saves 780 bytes program memory and 26 bytes RAM compared to SimpleSender,
+ * which does the same, but uses the IRRemote library (and is therefore much more flexible).
+ *
+ *
+ * The FAST protocol is a proprietary modified JVC protocol without address, with parity and with a shorter header.
+ * FAST Protocol characteristics:
+ * - Bit timing is like NEC or JVC
+ * - The header is shorter, 3156 vs. 12500
+ * - No address and 16 bit data, interpreted as 8 bit command and 8 bit inverted command,
+ * leading to a fixed protocol length of (6 + (16 * 3) + 1) * 526 = 55 * 526 = 28930 microseconds or 29 ms.
+ * - Repeats are sent as complete frames but in a 50 ms period / with a 21 ms distance.
+ *
+ *
+ * This file is part of IRMP https://github.com/IRMP-org/IRMP.
+ * This file is part of Arduino-IRremote https://github.com/Arduino-IRremote/Arduino-IRremote.
+ *
+ ************************************************************************************
+ * MIT License
+ *
+ * Copyright (c) 2022-2024 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.
+ *
+ ************************************************************************************
+ */
+#include
+
+#define IR_SEND_PIN 3 // P0_0
+
+
+#include "TinyIRSender.hpp"
+
+void setup() {
+ pinMode(LED_BUILTIN, OUTPUT);
+
+ Serial.begin(9600);
+ while (!Serial)
+ ; // Wait for Serial to become available. Is optimized away for some cores.
+
+ // Just to know which program is running on my Arduino
+ Serial.println(F("START " __FILE__ " from " __DATE__ "\r\nUsing library version " VERSION_TINYIR));
+ Serial.print(F("Send IR signals at pin "));
+ Serial.println(IR_SEND_PIN);
+}
+
+/*
+ * Set up the data to be sent.
+ * The compiler is intelligent and removes the code for 16 bit address handling if we call it with an uint8_t address :-).
+ * Using an uint16_t address or data requires additional 28 bytes program memory for NEC and 56 bytes program memory for FAST.
+ */
+uint8_t sAddress = 0x02;
+//uint16_t sAddress = 0x02;
+uint8_t sCommand = 0x34;
+//uint16_t sCommand = 0x34;
+uint8_t sRepeats = 0;
+
+void loop() {
+ /*
+ * Print current send values
+ */
+ Serial.println();
+ Serial.print(F("Send now:"));
+ Serial.print(F(" address=0x"));
+ Serial.print(sAddress, HEX);
+ Serial.print(F(" command=0x"));
+ Serial.print(sCommand, HEX);
+ Serial.print(F(" repeats="));
+ Serial.print(sRepeats);
+ Serial.println();
+
+ // Send with FAST
+ // No address and only 16 bits of data, interpreted as 8 bit command and 8 bit inverted command for parity checking
+ Serial.println(F("Send FAST with 8 bit command"));
+ Serial.flush();
+ sendFAST(IR_SEND_PIN, sCommand, sRepeats);
+
+ // Send with NEC
+ // NEC uses 8 bit address and 8 bit command each with 8 bit inverted parity checks
+ // However, sendNEC will accept 16 bit address and commands too (but remove the parity checks)
+ Serial.println(F("Send NEC with 8 bit address and command"));
+ Serial.flush();
+ sendNEC(IR_SEND_PIN, sAddress, sCommand, sRepeats);
+
+ // Send with Extended NEC
+ // Like NEC, but the address is forced 16 bits with no parity check
+ Serial.println(F("Send ExtendedNEC with 16 bit address and 8 bit command"));
+ Serial.flush();
+ sendExtendedNEC(IR_SEND_PIN, sAddress, sCommand, sRepeats);
+
+ // Send with ONKYO
+ // Like NEC, but both the address and command are forced 16 bits with no parity check
+ Serial.println(F("Send ONKYO with 16 bit address and command"));
+ Serial.flush();
+ sendONKYO(IR_SEND_PIN, sAddress, sCommand, sRepeats);
+
+ // Send with NEC2
+ // Instead of sending the NEC special repeat code, sends the full original frame for repeats
+ // Sending NEC2 is done by setting the optional bool NEC2Repeats argument to true (defaults to false)
+ // sendExtendedNEC and sendONKYO also support the NEC2Repeats argument for full frame repeats (not demonstrated here)
+ Serial.println(F("Send NEC2 with 8 bit address and command and original frame repeats"));
+ Serial.flush();
+ sendNEC(IR_SEND_PIN, sAddress, sCommand, sRepeats, true);
+
+ /*
+ * Increment send values
+ * Also increment address just for demonstration, which normally makes no sense
+ */
+ sAddress += 0x0101;
+ sCommand += 0x11;
+ sRepeats++;
+ // clip repeats at 4
+ if (sRepeats > 4) {
+ sRepeats = 4;
+ }
+
+ delay(1000); // delay must be greater than 5 ms (RECORD_GAP_MICROS), otherwise the receiver sees it as one long signal
+}
diff --git a/libraries/IRremote/examples/UnitTest/PinDefinitionsAndMore.h b/libraries/IRremote/examples/UnitTest/PinDefinitionsAndMore.h
new file mode 100644
index 0000000..14573c7
--- /dev/null
+++ b/libraries/IRremote/examples/UnitTest/PinDefinitionsAndMore.h
@@ -0,0 +1,349 @@
+/*
+ * PinDefinitionsAndMore.h
+ *
+ * Contains pin definitions for IRremote examples for various platforms
+ * as well as definitions for feedback LED and tone() and includes
+ *
+ * Copyright (C) 2021-2023 Armin Joachimsmeyer
+ * armin.joachimsmeyer@gmail.com
+ *
+ * This file is part of IRremote https://github.com/Arduino-IRremote/Arduino-IRremote.
+ *
+ * Arduino-IRremote is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
+ * See the GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see .
+ *
+ */
+
+/*
+ * Pin mapping table for different platforms
+ *
+ * Platform IR input IR output Tone Core/Pin schema
+ * --------------------------------------------------------------
+ * DEFAULT/AVR 2 3 4 Arduino
+ * ATtinyX5 0|PB0 4|PB4 3|PB3 ATTinyCore
+ * ATtiny167 3|PA3 2|PA2 7|PA7 ATTinyCore
+ * ATtiny167 9|PA3 8|PA2 5|PA7 Digispark original core
+ * ATtiny84 |PB2 |PA4 |PA3 ATTinyCore
+ * ATtiny88 3|PD3 4|PD4 9|PB1 ATTinyCore
+ * ATtiny3217 18|PA1 19|PA2 20|PA3 MegaTinyCore
+ * ATtiny1604 2 3|PA5 %
+ * ATtiny816 14|PA1 16|PA3 1|PA5 MegaTinyCore
+ * ATtiny1614 8|PA1 10|PA3 1|PA5 MegaTinyCore
+ * SAMD21 3 4 5
+ * ESP8266 14|D5 12|D6 %
+ * ESP32 15 4 27
+ * ESP32-C3 2 3 4
+ * BluePill PA6 PA7 PA3
+ * APOLLO3 11 12 5
+ * RP2040 3|GPIO15 4|GPIO16 5|GPIO17
+ */
+//#define _IR_MEASURE_TIMING // For debugging purposes.
+
+#if defined(__AVR__)
+#if defined(__AVR_ATtiny25__) || defined(__AVR_ATtiny45__) || defined(__AVR_ATtiny85__) // Digispark board. For use with ATTinyCore.
+#include "ATtinySerialOut.hpp" // TX is at pin 2 - Available as Arduino library "ATtinySerialOut". Saves 700 bytes program memory and 70 bytes RAM for ATtinyCore.
+#define IR_RECEIVE_PIN PIN_PB0
+#define IR_SEND_PIN PIN_PB4 // Pin 2 is serial output with ATtinySerialOut. Pin 1 is internal LED and Pin3 is USB+ with pullup on Digispark board.
+#define TONE_PIN PIN_PB3
+#define _IR_TIMING_TEST_PIN PIN_PB3
+
+# elif defined(__AVR_ATtiny87__) || defined(__AVR_ATtiny167__) // Digispark pro board
+#include "ATtinySerialOut.hpp" // Available as Arduino library "ATtinySerialOut"
+// For ATtiny167 Pins PB6 and PA3 are usable as interrupt source.
+# if defined(ARDUINO_AVR_DIGISPARKPRO)
+// For use with Digispark original core
+#define IR_RECEIVE_PIN 9 // PA3 - on Digispark board labeled as pin 9
+//#define IR_RECEIVE_PIN 14 // PB6 / INT0 is connected to USB+ on DigisparkPro boards
+#define IR_SEND_PIN 8 // PA2 - on Digispark board labeled as pin 8
+#define TONE_PIN 5 // PA7 - on Digispark board labeled as pin 5
+#define _IR_TIMING_TEST_PIN 10 // PA4
+# else
+// For use with ATTinyCore
+#define IR_RECEIVE_PIN PIN_PA3 // On Digispark board labeled as pin 9 - INT0 is connected to USB+ on DigisparkPro boards
+#define IR_SEND_PIN PIN_PA2 // On Digispark board labeled as pin 8
+#define TONE_PIN PIN_PA7 // On Digispark board labeled as pin 5
+# endif
+
+# elif defined(__AVR_ATtiny84__) // For use with ATTinyCore
+#include "ATtinySerialOut.hpp" // Available as Arduino library "ATtinySerialOut". Saves 128 bytes program memory.
+#define IR_RECEIVE_PIN PIN_PB2 // INT0
+#define IR_SEND_PIN PIN_PA4
+#define TONE_PIN PIN_PA3
+#define _IR_TIMING_TEST_PIN PIN_PA5
+
+# elif defined(__AVR_ATtiny88__) // MH-ET Tiny88 board. For use with ATTinyCore.
+#include "ATtinySerialOut.hpp" // Available as Arduino library "ATtinySerialOut". Saves 128 bytes program memory.
+// Pin 6 is TX, pin 7 is RX
+#define IR_RECEIVE_PIN PIN_PD3 // 3 - INT1
+#define IR_SEND_PIN PIN_PD4 // 4
+#define TONE_PIN PIN_PB1 // 9
+#define _IR_TIMING_TEST_PIN PIN_PB0 // 8
+
+# elif defined(__AVR_ATtiny1616__) || defined(__AVR_ATtiny3216__) || defined(__AVR_ATtiny3217__) // For use with megaTinyCore
+// Tiny Core Dev board
+// https://www.tindie.com/products/xkimi/tiny-core-16-dev-board-attiny1616/ - Out of Stock
+// https://www.tindie.com/products/xkimi/tiny-core-32-dev-board-attiny3217/ - Out of Stock
+#define IR_RECEIVE_PIN PIN_PA1 // use 18 instead of PIN_PA1 for TinyCore32
+#define IR_SEND_PIN PIN_PA2 // 19
+#define TONE_PIN PIN_PA3 // 20
+#define APPLICATION_PIN PIN_PA0 // 0
+#undef LED_BUILTIN // No LED available on the TinyCore 32 board, take the one on the programming board which is connected to the DAC output
+#define LED_BUILTIN PIN_PA6 // use 2 instead of PIN_PA6 for TinyCore32
+
+# elif defined(__AVR_ATtiny816__) // For use with megaTinyCore
+#define IR_RECEIVE_PIN PIN_PA1 // 14
+#define IR_SEND_PIN PIN_PA1 // 16
+#define TONE_PIN PIN_PA5 // 1
+#define APPLICATION_PIN PIN_PA4 // 0
+#undef LED_BUILTIN // No LED available, take the one which is connected to the DAC output
+#define LED_BUILTIN PIN_PB5 // 4
+
+# elif defined(__AVR_ATtiny1614__) // For use with megaTinyCore
+#define IR_RECEIVE_PIN PIN_PA1 // 8
+#define IR_SEND_PIN PIN_PA3 // 10
+#define TONE_PIN PIN_PA5 // 1
+#define APPLICATION_PIN PIN_PA4 // 0
+
+# elif defined(__AVR_ATtiny1604__) // For use with megaTinyCore
+#define IR_RECEIVE_PIN PIN_PA6 // 2 - To be compatible with interrupt example, pin 2 is chosen here.
+#define IR_SEND_PIN PIN_PA7 // 3
+#define APPLICATION_PIN PIN_PB2 // 5
+
+#define tone(...) void() // Define as void, since TCB0_INT_vect is also used by tone()
+#define noTone(a) void()
+#define TONE_PIN 42 // Dummy for examples using it
+
+# elif defined(__AVR_ATmega1284__) || defined(__AVR_ATmega1284P__) \
+|| defined(__AVR_ATmega644__) || defined(__AVR_ATmega644P__) \
+|| defined(__AVR_ATmega324P__) || defined(__AVR_ATmega324A__) \
+|| defined(__AVR_ATmega324PA__) || defined(__AVR_ATmega164A__) \
+|| defined(__AVR_ATmega164P__) || defined(__AVR_ATmega32__) \
+|| defined(__AVR_ATmega16__) || defined(__AVR_ATmega8535__) \
+|| defined(__AVR_ATmega64__) || defined(__AVR_ATmega128__) \
+|| defined(__AVR_ATmega1281__) || defined(__AVR_ATmega2561__) \
+|| defined(__AVR_ATmega8515__) || defined(__AVR_ATmega162__)
+#define IR_RECEIVE_PIN 2
+#define IR_SEND_PIN 13
+#define TONE_PIN 4
+#define APPLICATION_PIN 5
+#define ALTERNATIVE_IR_FEEDBACK_LED_PIN 6 // E.g. used for examples which use LED_BUILDIN for example output.
+#define _IR_TIMING_TEST_PIN 7
+
+# else // Default as for ATmega328 like on Uno, Nano, Leonardo, Teensy 2.0 etc.
+#define IR_RECEIVE_PIN 2 // To be compatible with interrupt example, pin 2 is chosen here.
+#define IR_SEND_PIN 3
+#define TONE_PIN 4
+#define APPLICATION_PIN 5
+#define ALTERNATIVE_IR_FEEDBACK_LED_PIN 6 // E.g. used for examples which use LED_BUILDIN for example output.
+#define _IR_TIMING_TEST_PIN 7
+
+# if defined(ARDUINO_AVR_PROMICRO) // Sparkfun Pro Micro is __AVR_ATmega32U4__ but has different external circuit
+// We have no built in LED at pin 13 -> reuse RX LED
+#undef LED_BUILTIN
+#define LED_BUILTIN LED_BUILTIN_RX
+# endif
+# endif // defined(__AVR_ATtiny25__)...
+
+#elif defined(ARDUINO_ARCH_RENESAS_UNO) // Uno R4
+// To be compatible with Uno R3.
+#define IR_RECEIVE_PIN 2
+#define IR_SEND_PIN 3
+#define TONE_PIN 4
+#define APPLICATION_PIN 5
+#define ALTERNATIVE_IR_FEEDBACK_LED_PIN 6 // E.g. used for examples which use LED_BUILDIN for example output.
+#define _IR_TIMING_TEST_PIN 7
+
+#elif defined(ESP8266)
+#define FEEDBACK_LED_IS_ACTIVE_LOW // The LED on my board (D4) is active LOW
+#define IR_RECEIVE_PIN 14 // D5
+#define IR_SEND_PIN 12 // D6 - D4/pin 2 is internal LED
+#define _IR_TIMING_TEST_PIN 2 // D4
+#define APPLICATION_PIN 13 // D7
+
+#define tone(...) void() // tone() inhibits receive timer
+#define noTone(a) void()
+#define TONE_PIN 42 // Dummy for examples using it#
+
+#elif defined(ARDUINO_NOLOGO_ESP32C3_SUPER_MINI)
+#define FEEDBACK_LED_IS_ACTIVE_LOW // The LED on my board (D8) is active LOW
+#define IR_RECEIVE_PIN 2
+#define IR_SEND_PIN 3
+#define TONE_PIN 4
+#define APPLICATION_PIN 10
+
+#elif defined(CONFIG_IDF_TARGET_ESP32C3) || defined(ARDUINO_ESP32C3_DEV)
+#define NO_LED_FEEDBACK_CODE // The WS2812 on pin 8 of AI-C3 board crashes if used as receive feedback LED, other I/O pins are working...
+#define IR_RECEIVE_PIN 6
+#define IR_SEND_PIN 7
+#define TONE_PIN 10
+#define APPLICATION_PIN 18
+
+#elif defined(ESP32)
+#include
+
+// tone() is included in ESP32 core since 2.0.2
+#if !defined(ESP_ARDUINO_VERSION_VAL)
+#define ESP_ARDUINO_VERSION_VAL(major, minor, patch) 12345678
+#endif
+#if ESP_ARDUINO_VERSION <= ESP_ARDUINO_VERSION_VAL(2, 0, 2)
+#define TONE_LEDC_CHANNEL 1 // Using channel 1 makes tone() independent of receiving timer -> No need to stop receiving timer.
+void tone(uint8_t aPinNumber, unsigned int aFrequency){
+ ledcAttachPin(aPinNumber, TONE_LEDC_CHANNEL);
+ ledcWriteTone(TONE_LEDC_CHANNEL, aFrequency);
+}
+void tone(uint8_t aPinNumber, unsigned int aFrequency, unsigned long aDuration){
+ ledcAttachPin(aPinNumber, TONE_LEDC_CHANNEL);
+ ledcWriteTone(TONE_LEDC_CHANNEL, aFrequency);
+ delay(aDuration);
+ ledcWriteTone(TONE_LEDC_CHANNEL, 0);
+}
+void noTone(uint8_t aPinNumber){
+ ledcWriteTone(TONE_LEDC_CHANNEL, 0);
+}
+#endif // ESP_ARDUINO_VERSION <= ESP_ARDUINO_VERSION_VAL(2, 0, 2)
+
+#define IR_RECEIVE_PIN 15 // D15
+#define IR_SEND_PIN 4 // D4
+#define TONE_PIN 27 // D27 25 & 26 are DAC0 and 1
+#define APPLICATION_PIN 16 // RX2 pin
+
+#elif defined(ARDUINO_ARCH_STM32) || defined(ARDUINO_ARCH_STM32F1) // BluePill
+// Timer 3 blocks PA6, PA7, PB0, PB1 for use by Servo or tone()
+#define IR_RECEIVE_PIN PA6
+#define IR_RECEIVE_PIN_STRING "PA6"
+#define IR_SEND_PIN PA7
+#define IR_SEND_PIN_STRING "PA7"
+#define TONE_PIN PA3
+#define _IR_TIMING_TEST_PIN PA5
+#define APPLICATION_PIN PA2
+#define APPLICATION_PIN_STRING "PA2"
+# if defined(ARDUINO_GENERIC_STM32F103C) || defined(ARDUINO_BLUEPILL_F103C8)
+// BluePill LED is active low
+#define FEEDBACK_LED_IS_ACTIVE_LOW
+# endif
+
+#elif defined(ARDUINO_ARCH_APOLLO3) // Sparkfun Apollo boards
+#define IR_RECEIVE_PIN 11
+#define IR_SEND_PIN 12
+#define TONE_PIN 5
+
+#elif defined(ARDUINO_ARCH_MBED) && defined(ARDUINO_ARCH_MBED_NANO) // Arduino Nano 33 BLE and Arduino Nano Connect layout for MBED
+// Must be before ARDUINO_ARCH_RP2040, since it is the layout for the MBED core of Arduino Nano Connect
+#define IR_RECEIVE_PIN 3 // GPIO15 Start with pin 3 since pin 2|GPIO25 is connected to LED on Pi pico
+#define IR_SEND_PIN 4 // GPIO16
+#define TONE_PIN 5
+#define APPLICATION_PIN 6
+#define ALTERNATIVE_IR_FEEDBACK_LED_PIN 7 // E.g. used for examples which use LED_BUILDIN for example output.
+#define _IR_TIMING_TEST_PIN 8
+
+#elif defined(ARDUINO_ARCH_RP2040) // Arduino Nano Connect, Pi Pico with arduino-pico core https://github.com/earlephilhower/arduino-pico
+#define IR_RECEIVE_PIN 15 // GPIO15 to be compatible with the Arduino Nano RP2040 Connect (pin3)
+#define IR_SEND_PIN 16 // GPIO16
+#define TONE_PIN 17
+#define APPLICATION_PIN 18
+#define ALTERNATIVE_IR_FEEDBACK_LED_PIN 19 // E.g. used for examples which use LED_BUILDIN for example output.
+#define _IR_TIMING_TEST_PIN 20
+
+// If you program the Nano RP2040 Connect with this core, then you must redefine LED_BUILTIN
+// and use the external reset with 1 kOhm to ground to enter UF2 mode
+#undef LED_BUILTIN
+#define LED_BUILTIN 6
+
+#elif defined(PARTICLE) // !!!UNTESTED!!!
+#define IR_RECEIVE_PIN A4
+#define IR_SEND_PIN A5 // Particle supports multiple pins
+
+#define LED_BUILTIN D7
+
+/*
+ * 4 times the same (default) layout for easy adaption in the future
+ */
+#elif defined(TEENSYDUINO) // Teensy 2.0 is handled at default for ATmega328 like on Uno, Nano, Leonardo etc.
+#define IR_RECEIVE_PIN 2
+#define IR_SEND_PIN 3
+#define TONE_PIN 4
+#define APPLICATION_PIN 5
+#define ALTERNATIVE_IR_FEEDBACK_LED_PIN 6 // E.g. used for examples which use LED_BUILDIN for example output.
+#define _IR_TIMING_TEST_PIN 7
+
+#elif defined(ARDUINO_ARCH_MBED) // Arduino Nano 33 BLE
+#define IR_RECEIVE_PIN 2
+#define IR_SEND_PIN 3
+#define TONE_PIN 4
+#define APPLICATION_PIN 5
+#define ALTERNATIVE_IR_FEEDBACK_LED_PIN 6 // E.g. used for examples which use LED_BUILDIN for example output.
+#define _IR_TIMING_TEST_PIN 7
+
+#elif defined(ARDUINO_ARCH_SAMD) || defined(ARDUINO_ARCH_SAM)
+#define IR_RECEIVE_PIN 2
+#define IR_SEND_PIN 3
+#define TONE_PIN 4
+#define APPLICATION_PIN 5
+#define ALTERNATIVE_IR_FEEDBACK_LED_PIN 6 // E.g. used for examples which use LED_BUILDIN for example output.
+#define _IR_TIMING_TEST_PIN 7
+
+#if !defined(ARDUINO_SAMD_ADAFRUIT) && !defined(ARDUINO_SEEED_XIAO_M0)
+// On the Zero and others we switch explicitly to SerialUSB
+#define Serial SerialUSB
+#endif
+
+// Definitions for the Chinese SAMD21 M0-Mini clone, which has no led connected to D13/PA17.
+// Attention!!! D2 and D4 are swapped on these boards!!!
+// If you connect the LED, it is on pin 24/PB11. In this case activate the next two lines.
+//#undef LED_BUILTIN
+//#define LED_BUILTIN 24 // PB11
+// As an alternative you can choose pin 25, it is the RX-LED pin (PB03), but active low.In this case activate the next 3 lines.
+//#undef LED_BUILTIN
+//#define LED_BUILTIN 25 // PB03
+//#define FEEDBACK_LED_IS_ACTIVE_LOW // The RX LED on the M0-Mini is active LOW
+
+#elif defined (NRF51) // BBC micro:bit
+#define IR_RECEIVE_PIN 2
+#define IR_SEND_PIN 3
+#define APPLICATION_PIN 1
+#define _IR_TIMING_TEST_PIN 4
+
+#define tone(...) void() // no tone() available
+#define noTone(a) void()
+#define TONE_PIN 42 // Dummy for examples using it
+
+#else
+#warning Board / CPU is not detected using pre-processor symbols -> using default values, which may not fit. Please extend PinDefinitionsAndMore.h.
+// Default valued for unidentified boards
+#define IR_RECEIVE_PIN 2
+#define IR_SEND_PIN 3
+#define TONE_PIN 4
+#define APPLICATION_PIN 5
+#define ALTERNATIVE_IR_FEEDBACK_LED_PIN 6 // E.g. used for examples which use LED_BUILDIN for example output.
+#define _IR_TIMING_TEST_PIN 7
+#endif // defined(ESP8266)
+
+#if defined(ESP32) || defined(ARDUINO_ARCH_RP2040) || defined(PARTICLE) || defined(ARDUINO_ARCH_MBED)
+#define SEND_PWM_BY_TIMER // We do not have pin restrictions for this CPU's, so lets use the hardware PWM for send carrier signal generation
+#else
+# if defined(SEND_PWM_BY_TIMER)
+#undef IR_SEND_PIN // SendPin is determined by timer! This avoids warnings in IRremote.hpp and IRTimer.hpp
+# endif
+#endif
+
+#if !defined (FLASHEND)
+#define FLASHEND 0xFFFF // Dummy value for platforms where FLASHEND is not defined
+#endif
+
+/*
+ * Helper macro for getting a macro definition as string
+ */
+#if !defined(STR_HELPER)
+#define STR_HELPER(x) #x
+#define STR(x) STR_HELPER(x)
+#endif
diff --git a/libraries/IRremote/examples/UnitTest/UnitTest.ino b/libraries/IRremote/examples/UnitTest/UnitTest.ino
new file mode 100644
index 0000000..930124c
--- /dev/null
+++ b/libraries/IRremote/examples/UnitTest/UnitTest.ino
@@ -0,0 +1,790 @@
+/*
+ * UnitTest.cpp
+ *
+ * Demonstrates sending IR codes in standard format with address and command and
+ * simultaneously receiving. Both values are checked for consistency.
+ *
+ * This file is part of Arduino-IRremote https://github.com/Arduino-IRremote/Arduino-IRremote.
+ *
+ ************************************************************************************
+ * MIT License
+ *
+ * Copyright (c) 2020-2024 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.
+ *
+ ************************************************************************************
+ */
+
+#include
+
+#define IR_SEND_PIN 3
+
+#if !defined(RAW_BUFFER_LENGTH)
+#define RAW_BUFFER_LENGTH 400 // 400 is OK with Pronto and 1000 is OK without Pronto. 1200 is too much here, because then variables are overwritten.
+#endif
+
+//#define EXCLUDE_UNIVERSAL_PROTOCOLS // Saves up to 1000 bytes program memory.
+//#define EXCLUDE_EXOTIC_PROTOCOLS // Saves around 240 bytes program memory if IrSender.write is used
+//#define SEND_PWM_BY_TIMER // Disable carrier PWM generation in software and use (restricted) hardware PWM.
+//#define USE_NO_SEND_PWM // Use no carrier PWM, just simulate an active low receiver signal. Overrides SEND_PWM_BY_TIMER definition
+
+// MARK_EXCESS_MICROS is subtracted from all marks and added to all spaces before decoding,
+//#define USE_MSB_DECODING_FOR_DISTANCE_DECODER
+// to compensate for the signal forming of different IR receiver modules. See also IRremote.hpp line 142.
+//#define MARK_EXCESS_MICROS 20 // Adapt it to your IR receiver module. 40 is taken for the cheap VS1838 module her, since we have high intensity.
+
+//#define RECORD_GAP_MICROS 12000 // Default is 8000. Activate it for some LG air conditioner protocols.
+
+//#define TRACE // For internal usage
+//#define DEBUG // Activate this for lots of lovely debug output from the decoders.
+
+#define DECODE_DENON // Includes Sharp
+#define DECODE_KASEIKYO
+#define DECODE_PANASONIC // alias for DECODE_KASEIKYO
+#define DECODE_NEC // Includes Apple and Onkyo
+
+#define DECODE_JVC
+#define DECODE_RC5
+#define DECODE_RC6
+
+#define DECODE_DISTANCE_WIDTH // Universal decoder for pulse distance width protocols
+#define DECODE_HASH // special decoder for all protocols
+
+#define DECODE_SONY
+#define DECODE_SAMSUNG
+#define DECODE_LG
+
+#define DECODE_BEO // It prevents decoding of SONY (default repeats), which we are not using here.
+//#define ENABLE_BEO_WITHOUT_FRAME_GAP // !!!For successful unit testing we must see the warning at ir_BangOlufsen.hpp:100:2!!!
+#define RECORD_GAP_MICROS 16000 // Force to get the complete frame including the 3. space of 15 ms in the receive buffer
+#define BEO_KHZ 38 // We send and receive Bang&Olufsen with 38 kHz here (instead of 455 kHz).
+
+#define DECODE_BOSEWAVE
+#define DECODE_MAGIQUEST
+#define DECODE_FAST
+
+//#define DECODE_WHYNTER
+//#define DECODE_LEGO_PF
+
+/*
+ * Helper macro for getting a macro definition as string
+ */
+#if !defined(STR_HELPER)
+#define STR_HELPER(x) #x
+#define STR(x) STR_HELPER(x)
+#endif
+
+#define IR_SEND_PIN 3 // P0_0
+#define IR_RECEIVE_PIN 4 // P0_1
+
+#define BTN_ACTIVE_STATE HIGH // HIGH for Elbear boards, LOW for Start board
+
+#include
+
+#define DELAY_AFTER_SEND 1000
+#define DELAY_AFTER_LOOP 5000
+
+#if defined(SEND_PWM_BY_TIMER) && !defined(SEND_PWM_DOES_NOT_USE_RECEIVE_TIMER)
+#error Unit test cannot run if SEND_PWM_BY_TIMER is enabled i.e. receive timer us also used by send
+#endif
+
+/*
+ * For callback
+ */
+volatile bool sDataJustReceived = false;
+void ReceiveCompleteCallbackHandler();
+
+void setup() {
+ pinMode(BTN_BUILTIN, INPUT);
+
+ Serial.begin(9600);
+ while (!Serial)
+ ; // Wait for Serial to become available. Is optimized away for some cores.
+
+ // Just to know which program is running on my Arduino
+ Serial.println(F("START " __FILE__ " from " __DATE__ "\r\nUsing library version " VERSION_IRREMOTE));
+
+ // Start the receiver and if not 3. parameter specified, take LED_BUILTIN pin from the internal boards definition as default feedback LED
+ IrReceiver.begin(IR_RECEIVE_PIN, ENABLE_LED_FEEDBACK);
+ IrReceiver.registerReceiveCompleteCallback(ReceiveCompleteCallbackHandler);
+
+ Serial.print(F("Ready to receive IR signals of protocols: "));
+ printActiveIRProtocols(&Serial);
+
+ Serial.println(F("at pin " STR(IR_RECEIVE_PIN)));
+
+
+#if defined(LED_BUILTIN) && !defined(NO_LED_FEEDBACK_CODE)
+ Serial.print(F("FeedbackLED at pin "));
+ Serial.println(LED_BUILTIN);
+#endif
+
+ Serial.println(F("Use ReceiveCompleteCallback"));
+ Serial.println(F("Receive buffer length is " STR(RAW_BUFFER_LENGTH)));
+
+#if defined(IR_SEND_PIN)
+ IrSender.begin(); // Start with IR_SEND_PIN as send pin and enable feedback LED at default feedback LED pin
+ Serial.println(F("Send IR signals at pin " STR(IR_SEND_PIN)));
+#else
+ // Here the macro IR_SEND_PIN is not defined or undefined above with #undef IR_SEND_PIN
+ uint8_t tSendPin = 3;
+ IrSender.begin(tSendPin, ENABLE_LED_FEEDBACK, USE_DEFAULT_FEEDBACK_LED_PIN); // Specify send pin and enable feedback LED at default feedback LED pin
+ // You can change send pin later with IrSender.setSendPin();
+
+ Serial.print(F("Send IR signals at pin "));
+ Serial.println(tSendPin);
+#endif
+
+ Serial.print(F("If you press button "));
+ Serial.print(BTN_BUILTIN);
+ Serial.println(F(" raw data is always printed"));
+
+# if !defined(SEND_PWM_BY_TIMER)
+ /*
+ * Print internal software PWM generation info
+ */
+ IrSender.enableIROut(38); // Call it with 38 kHz to initialize the values printed below
+ Serial.print(F("Send signal mark duration for 38kHz is "));
+ Serial.print(IrSender.periodOnTimeMicros);
+ Serial.print(F(" us, pulse narrowing correction is "));
+ Serial.print(IrSender.getPulseCorrectionNanos());
+ Serial.print(F(" ns, total period is "));
+ Serial.print(IrSender.periodTimeMicros);
+ Serial.println(F(" us"));
+# endif
+
+ // infos for receive
+ Serial.print(RECORD_GAP_MICROS);
+ Serial.println(F(" us is the (minimum) gap, after which the start of a new IR packet is assumed"));
+ Serial.print(MARK_EXCESS_MICROS);
+ Serial.println(F(" us are subtracted from all marks and added to all spaces for decoding"));
+
+ delay(DELAY_AFTER_SEND);
+
+}
+
+void checkReceivedRawData(IRRawDataType aRawData) {
+ // wait until signal has received
+ while (!sDataJustReceived) {
+ };
+ sDataJustReceived = false;
+
+ if (IrReceiver.decode()) {
+ // Print a short summary of received data
+ IrReceiver.printIRResultShort(&Serial);
+ IrReceiver.printIRSendUsage(&Serial);
+ if (IrReceiver.decodedIRData.protocol == UNKNOWN || digitalRead(BTN_BUILTIN) == BTN_ACTIVE_STATE) {
+ // We have an unknown protocol, print more info
+ IrReceiver.printIRResultRawFormatted(&Serial, true);
+ }
+
+ if (IrReceiver.decodedIRData.protocol == PULSE_DISTANCE || IrReceiver.decodedIRData.protocol == PULSE_WIDTH) {
+ if (IrReceiver.decodedIRData.decodedRawData != aRawData) {
+ Serial.print(F("ERROR: Received data=0x"));
+ Serial.print(IrReceiver.decodedIRData.decodedRawData, HEX);
+ Serial.print(F(" != sent data=0x"));
+ Serial.print(aRawData, HEX);
+ Serial.println();
+ }
+ }
+ IrReceiver.resume();
+ } else {
+ Serial.println(F("No data received"));
+ }
+ Serial.println();
+}
+
+#if defined(DECODE_DISTANCE_WIDTH)
+void checkReceivedArray(IRRawDataType *aRawDataArrayPointer, uint8_t aArraySize) {
+ // wait until signal has received
+ while (!sDataJustReceived) {
+ };
+ sDataJustReceived = false;
+
+ if (IrReceiver.decode()) {
+ // Print a short summary of received data
+ IrReceiver.printIRResultShort(&Serial);
+ IrReceiver.printIRSendUsage(&Serial);
+
+ if (IrReceiver.decodedIRData.protocol == UNKNOWN || digitalRead(BTN_BUILTIN) == BTN_ACTIVE_STATE) {
+ // We have an unknown protocol, print more info
+ IrReceiver.printIRResultRawFormatted(&Serial, true);
+ }
+
+ if (IrReceiver.decodedIRData.protocol == PULSE_DISTANCE || IrReceiver.decodedIRData.protocol == PULSE_WIDTH) {
+ for (uint_fast8_t i = 0; i < aArraySize; ++i) {
+ if (IrReceiver.decodedIRData.decodedRawDataArray[i] != *aRawDataArrayPointer) {
+ Serial.print(F("ERROR: Received data=0x"));
+ Serial.print(IrReceiver.decodedIRData.decodedRawDataArray[i], HEX);
+ Serial.print(F(" != sent data=0x"));
+ Serial.println(*aRawDataArrayPointer, HEX);
+ }
+ aRawDataArrayPointer++;
+ }
+ }
+ IrReceiver.resume();
+ } else {
+ Serial.println(F("No data received"));
+ }
+ Serial.println();
+}
+#endif
+
+/*
+ * Test callback function
+ * Has the same functionality as a check with available()
+ */
+void ReceiveCompleteCallbackHandler() {
+ sDataJustReceived = true;
+}
+
+void checkReceive(uint16_t aSentAddress, uint16_t aSentCommand) {
+ // wait until signal has received
+ uint16_t tTimeoutCounter = 1000; // gives 10 seconds timeout
+ while (!sDataJustReceived) {
+ delay(10);
+ if (tTimeoutCounter == 0) {
+ Serial.println(F("Receive timeout happened"));
+ break;
+ }
+ tTimeoutCounter--;
+ }
+ sDataJustReceived = false;
+
+ if (IrReceiver.decode()) {
+ // Print a short summary of received data
+ IrReceiver.printIRResultShort(&Serial);
+ IrReceiver.printIRSendUsage(&Serial);
+
+ if (IrReceiver.decodedIRData.flags & IRDATA_FLAGS_WAS_OVERFLOW) {
+ Serial.println(F("Try to increase the \"RAW_BUFFER_LENGTH\" value of " STR(RAW_BUFFER_LENGTH) " in " __FILE__));
+ // see also https://github.com/Arduino-IRremote/Arduino-IRremote#compile-options--macros-for-this-library
+ }
+
+ if (IrReceiver.decodedIRData.protocol == UNKNOWN || digitalRead(BTN_BUILTIN) == BTN_ACTIVE_STATE) {
+ // We have an unknown protocol, print more info
+ IrReceiver.printIRResultRawFormatted(&Serial, true);
+ }
+ IrReceiver.resume(); // Early resume
+
+ if (IrReceiver.decodedIRData.protocol == UNKNOWN) {
+ Serial.println(F("ERROR: Unknown protocol"));
+ } else {
+ /*
+ * Check address
+ */
+ if (IrReceiver.decodedIRData.address != aSentAddress) {
+ Serial.print(F("ERROR: Received address=0x"));
+ Serial.print(IrReceiver.decodedIRData.address, HEX);
+ Serial.print(F(" != sent address=0x"));
+ Serial.println(aSentAddress, HEX);
+ }
+ /*
+ * Check command
+ */
+ if (IrReceiver.decodedIRData.command != aSentCommand) {
+ Serial.print(F("ERROR: Received command=0x"));
+ Serial.print(IrReceiver.decodedIRData.command, HEX);
+ Serial.print(F(" != sent command=0x"));
+ Serial.println(aSentCommand, HEX);
+ }
+ }
+
+ } else {
+ Serial.println(F("No data received"));
+ IrReceiver.resume();
+ }
+ Serial.println();
+}
+
+/*
+ * Set up the data to be sent.
+ * For most protocols, the data is build up with a constant 8 (or 16 byte) address
+ * and a variable 8 bit command.
+ * There are exceptions like Sony and Denon, which have 5 bit address.
+ */
+uint16_t sAddress = 0xFFF1;
+uint8_t sCommand = 0x76;
+uint16_t s16BitCommand = 0x9876;
+uint8_t sRepeats = 0;
+
+void loop() {
+ /*
+ * Print values
+ */
+ Serial.println();
+ Serial.print(F("address=0x"));
+ Serial.print(sAddress, HEX);
+ Serial.print(F(" command=0x"));
+ Serial.print(sCommand, HEX);
+ Serial.println();
+ Serial.println();
+
+ Serial.print(F("Send NEC with 8 bit address"));
+ if (sRepeats > 0) {
+ Serial.print(F(" and complete NEC frames as repeats to force decoding as NEC2"));
+ }
+ Serial.println();
+ Serial.flush();
+ IrSender.sendNEC(sAddress & 0xFF, sCommand, 0);
+ checkReceive(sAddress & 0xFF, sCommand);
+
+ /*
+ * Complete NEC frames as repeats to force decoding as NEC2 are tested here
+ */
+ for (int8_t i = 0; i < sRepeats; i++) {
+ if (digitalRead(BTN_BUILTIN) != BTN_ACTIVE_STATE) {
+ // If debug is enabled, printing time (50 ms) is sufficient as delay
+ delayMicroseconds(NEC_REPEAT_DISTANCE - 20000); // 20000 is just a guess
+ }
+ IrSender.sendNEC(sAddress & 0xFF, sCommand, 0);
+ checkReceive(sAddress & 0xFF, sCommand);
+ }
+
+ delay(DELAY_AFTER_SEND); // delay must be greater than 5 ms (RECORD_GAP_MICROS), otherwise the receiver sees it as one long signal
+
+ Serial.println(F("Send NEC with 16 bit address"));
+ Serial.flush();
+ IrSender.sendNEC(sAddress, sCommand, 0);
+ checkReceive(sAddress, sCommand);
+ delay(DELAY_AFTER_SEND);
+
+ Serial.println(F("Send NEC2 with 16 bit address"));
+ Serial.flush();
+ IrSender.sendNEC2(sAddress, sCommand, 0);
+ checkReceive(sAddress, sCommand);
+ delay(DELAY_AFTER_SEND);
+
+ if (sAddress == 0xFFF1) {
+ /*
+ * Send constant values only once in this demo
+ */
+ Serial.println(F("Send NEC Pronto data with 8 bit address 0x80 and command 0x45 and no repeats"));
+ Serial.flush();
+ // This is copied to stack/ram internally
+ IrSender.sendPronto(F("0000 006D 0022 0000 015E 00AB " /* Pronto header + start bit */
+ "0017 0015 0017 0015 0017 0017 0015 0017 0017 0015 0017 0015 0017 0015 0017 003F " /* Lower address byte */
+ "0017 003F 0017 003E 0017 003F 0015 003F 0017 003E 0017 003F 0017 003E 0017 0015 " /* Upper address byte (inverted at 8 bit mode) */
+ "0017 003E 0017 0015 0017 003F 0017 0015 0017 0015 0017 0015 0017 003F 0017 0015 " /* command byte */
+ "0019 0013 0019 003C 0017 0015 0017 003F 0017 003E 0017 003F 0017 0015 0017 003E " /* inverted command byte */
+ "0017 0806"), 0); //stop bit, no repeat possible, because of missing repeat pattern
+ checkReceive(0x80, 0x45);
+ delay(DELAY_AFTER_SEND);
+
+ Serial.println(
+ F("Send NEC sendRaw data with 8 bit address=0xFB04 and command 0x08 and exact timing (16 bit array format)"));
+ Serial.flush();
+ const uint16_t irSignal[] = { 9000, 4500/*Start bit*/, 560, 560, 560, 560, 560, 1690, 560,
+ 560/*0010 0x4 of 16 bit address LSB first*/, 560, 560, 560, 560, 560, 560, 560, 560/*0000*/, 560, 1690, 560, 1690,
+ 560, 560, 560, 1690/*1101 0xB*/, 560, 1690, 560, 1690, 560, 1690, 560, 1690/*1111*/, 560, 560, 560, 560, 560, 560,
+ 560, 1690/*0001 0x08 of command LSB first*/, 560, 560, 560, 560, 560, 560, 560, 560/*0000 0x00*/, 560, 1690, 560,
+ 1690, 560, 1690, 560, 560/*1110 Inverted 8 of command*/, 560, 1690, 560, 1690, 560, 1690, 560,
+ 1690/*1111 inverted 0 of command*/, 560 /*stop bit*/}; // Using exact NEC timing
+ IrSender.sendRaw(irSignal, sizeof(irSignal) / sizeof(irSignal[0]), NEC_KHZ); // Note the approach used to automatically calculate the size of the array.
+ checkReceive(0xFB04 & 0xFF, 0x08);
+ delay(DELAY_AFTER_SEND);
+
+ /*
+ * With sendNECRaw() you can send 32 bit codes directly, i.e. without parity etc.
+ */
+ Serial.println(F("Send ONKYO with 16 bit address 0x0102 and 16 bit command 0x0304 with NECRaw(0x03040102)"));
+ Serial.flush();
+ IrSender.sendNECRaw(0x03040102, 0);
+ checkReceive(0x0102, 0x304);
+ delay(DELAY_AFTER_SEND);
+
+ /*
+ * With Send sendNECMSB() you can send your old 32 bit codes.
+ * To convert one into the other, you must reverse the byte positions and then reverse all positions of each byte.
+ * Use bitreverse32Bit().
+ * Example:
+ * 0xCB340102 byte reverse -> 0x020134CB bit reverse-> 40802CD3
+ */
+ Serial.println(F("Send ONKYO with 16 bit address 0x0102 and command 0x34 with old 32 bit format MSB first (0x40802CD3)"));
+ Serial.flush();
+ IrSender.sendNECMSB(0x40802CD3, 32, false);
+ checkReceive(0x0102, 0x34);
+ delay(DELAY_AFTER_SEND);
+
+# if defined(DECODE_PANASONIC) || defined(DECODE_KASEIKYO)
+ Serial.println(F("Send Panasonic 0xB, 0x10 as 48 bit PulseDistance using ProtocolConstants"));
+ Serial.flush();
+ IrSender.sendPulseDistanceWidth(&KaseikyoProtocolConstants, 0xA010B02002, 48, NO_REPEATS); // Panasonic is a Kaseikyo variant
+ checkReceivedRawData(0xA010B02002);
+ delay(DELAY_AFTER_SEND);
+
+ /*
+ * Send 2 Panasonic 48 bit codes as Pulse Distance data, once with LSB and once with MSB first
+ */
+ Serial.println(F("Send Panasonic 0xB, 0x10 as 48 bit PulseDistance"));
+ Serial.println(F("-LSB first"));
+ Serial.flush();
+ IrSender.sendPulseDistanceWidth(38, 3450, 1700, 450, 1250, 450, 400, 0xA010B02002, 48, PROTOCOL_IS_LSB_FIRST, 0,
+ NO_REPEATS);
+ checkReceivedRawData(0xA010B02002);
+ delay(DELAY_AFTER_SEND);
+
+ // The same with MSB first. Use bit reversed raw data of LSB first part
+ Serial.println(F("-MSB first"));
+ IrSender.sendPulseDistanceWidth(38, 3450, 1700, 450, 1250, 450, 400, 0x40040D000805, 48, PROTOCOL_IS_MSB_FIRST, 0,
+ NO_REPEATS);
+ checkReceivedRawData(0x40040D000805);
+
+ delay(DELAY_AFTER_SEND);
+# endif // defined(DECODE_PANASONIC) || defined(DECODE_KASEIKYO)
+
+# if defined(DECODE_DISTANCE_WIDTH)
+# if defined(USE_MSB_DECODING_FOR_DISTANCE_DECODER)
+ Serial.println(F("Send 52 bit PulseDistance 0x43D8613C and 0x3BC3B MSB first"));
+ Serial.flush();
+ IrSender.sendPulseDistanceWidth(38, 8900, 4450, 550, 1700, 550, 600, 0x43D8613CBC3B, 52, PROTOCOL_IS_MSB_FIRST, 0, NO_REPEATS);
+ checkReceivedRawData(0x43D8613CBC3B);
+ delay(DELAY_AFTER_SEND);
+
+ Serial.println(F("Send 52 bit PulseDistanceWidth 0x43D8613C and 0x3BC3B MSB first"));
+ Serial.flush();
+ // Real PulseDistanceWidth (constant bit length) does not require a stop bit
+ IrSender.sendPulseDistanceWidth(38, 300, 600, 600, 300, 300, 600, 0x123456789ABC, 52, PROTOCOL_IS_MSB_FIRST, 0, 0);
+ checkReceivedRawData(0x123456789ABC);
+ delay(DELAY_AFTER_SEND);
+ Serial.println(F("Send 32 bit PulseWidth 0x43D8613C MSB first"));
+ Serial.flush();
+ // Real PulseDistanceWidth (constant bit length) does not require a stop bit
+ IrSender.sendPulseDistanceWidth(38, 1000, 500, 600, 300, 300, 300, 0x43D8613C, 32, PROTOCOL_IS_MSB_FIRST, 0, 0);
+ checkReceivedRawData(0x43D8613C);
+ delay(DELAY_AFTER_SEND);
+
+# else // defined(USE_MSB_DECODING_FOR_DISTANCE_DECODER)
+ Serial.println(F("Send 72 bit PulseDistance 0x5A AFEDCBA9 87654321 LSB first"));
+ Serial.flush();
+ IRRawDataType tRawData[] = { 0xAFEDCBA987654321, 0x5A }; // LSB of tRawData[0] is sent first
+ IrSender.sendPulseDistanceWidthFromArray(38, 8900, 4450, 550, 1700, 550, 600, &tRawData[0], 72, PROTOCOL_IS_LSB_FIRST, 0,
+ NO_REPEATS);
+ checkReceivedArray(tRawData, 2);
+ delay(DELAY_AFTER_SEND);
+
+ Serial.println(F("Send 52 bit PulseDistanceWidth 0xDCBA9 87654321 LSB first"));
+ Serial.flush();
+ // Real PulseDistanceWidth (constant bit length) does theoretically not require a stop bit, but we know the stop bit from serial transmission
+ IrSender.sendPulseDistanceWidth(38, 300, 600, 300, 600, 600, 300, 0xDCBA987654321, 52, PROTOCOL_IS_LSB_FIRST, 0, 0);
+ checkReceivedRawData(0xDCBA987654321);
+ delay(DELAY_AFTER_SEND);
+
+ Serial.println(F("Send 52 bit PulseDistanceWidth 0xDCBA9 87654321 LSB first with inverse timing and data"));
+ Serial.flush();
+ IrSender.sendPulseDistanceWidth(38, 300, 600, 600, 300, 300, 600, ~0xDCBA987654321, 52, PROTOCOL_IS_LSB_FIRST, 0, 0);
+ checkReceivedRawData(0xDCBA987654321);
+ delay(DELAY_AFTER_SEND);
+
+ Serial.println(F("Send 7 bit ASCII character with PulseDistanceWidth LSB first"));
+ Serial.flush();
+ // Real PulseDistanceWidth (constant bit length) does theoretically not require a stop bit, but we know the stop bit from serial transmission
+ IrSender.sendPulseDistanceWidth(38, 6000, 500, 500, 1500, 1500, 500, sCommand, 7, PROTOCOL_IS_LSB_FIRST, 0, 0);
+ checkReceivedRawData(sCommand);
+ delay(DELAY_AFTER_SEND);
+
+ Serial.println(F("Send Sony12 as PulseWidth LSB first"));
+ Serial.flush();
+ uint32_t tData = (uint32_t) sAddress << 7 | (sCommand & 0x7F);
+ IrSender.sendPulseDistanceWidth(38, 2400, 600, 1200, 600, 600, 600, tData, SIRCS_12_PROTOCOL, PROTOCOL_IS_LSB_FIRST, 0, 0);
+ checkReceive(sAddress & 0x1F, sCommand & 0x7F);
+ delay(DELAY_AFTER_SEND);
+
+ Serial.println(F("Send 32 bit PulseWidth 0x87654321 LSB first"));
+ Serial.flush();
+ IrSender.sendPulseDistanceWidth(38, 1000, 500, 600, 300, 300, 300, 0x87654321, 32, PROTOCOL_IS_LSB_FIRST, 0, 0);
+ checkReceivedRawData(0x87654321);
+ delay(DELAY_AFTER_SEND);
+
+# endif // defined(USE_MSB_DECODING_FOR_DISTANCE_DECODER)
+# endif // defined(DECODE_DISTANCE_WIDTH)
+
+# if defined(DECODE_MAGIQUEST)
+ Serial.println(F("Send MagiQuest 0x6BCDFF00, 0x176 as 55 bit PulseDistanceWidth MSB first"));
+ Serial.flush();
+ // 0xD79BFE00 is 0x6BCDFF00 is shifted 1 left
+ IrSender.sendPulseDistanceWidth(38, 287, 864, 576, 576, 287, 864, 0xD79BFE017619, 55, PROTOCOL_IS_MSB_FIRST, 0, 0);
+ checkReceive(0xFF00, 0x176);
+ if (IrReceiver.decodedIRData.decodedRawData != 0x6BCDFF00) {
+ Serial.print(F("ERROR: Received address=0x"));
+ Serial.print(IrReceiver.decodedIRData.decodedRawData, HEX);
+ Serial.println(F(" != sent address=0x6BCDFF00"));
+ Serial.println();
+ }
+ delay(DELAY_AFTER_SEND);
+# endif // defined(DECODE_MAGIQUEST)
+
+ }
+
+ Serial.println(F("Send Onkyo (NEC with 16 bit command)"));
+ Serial.flush();
+ IrSender.sendOnkyo(sAddress, (sCommand + 1) << 8 | sCommand, 0);
+ checkReceive(sAddress, (sCommand + 1) << 8 | sCommand);
+ delay(DELAY_AFTER_SEND);
+
+ Serial.println(F("Send Apple"));
+ Serial.flush();
+ IrSender.sendApple(sAddress & 0xFF, sCommand, 0);
+ checkReceive(sAddress & 0xFF, sCommand);
+ delay(DELAY_AFTER_SEND);
+
+#if defined(DECODE_PANASONIC) || defined(DECODE_KASEIKYO)
+ Serial.println(F("Send Panasonic"));
+ Serial.flush();
+ IrSender.sendPanasonic(sAddress & 0xFFF, sCommand, 0);
+ checkReceive(sAddress & 0xFFF, sCommand);
+ delay(DELAY_AFTER_SEND);
+
+ Serial.println(F("Send Kaseikyo with 0x4711 as Vendor ID"));
+ Serial.flush();
+ IrSender.sendKaseikyo(sAddress & 0xFFF, sCommand, 0, 0x4711);
+ checkReceive(sAddress & 0xFFF, sCommand);
+ delay(DELAY_AFTER_SEND);
+
+ Serial.println(F("Send Kaseikyo_Denon variant"));
+ Serial.flush();
+ IrSender.sendKaseikyo_Denon(sAddress & 0xFFF, sCommand, 0);
+ checkReceive(sAddress & 0xFFF, sCommand);
+ delay(DELAY_AFTER_SEND);
+#endif
+
+#if defined(DECODE_DENON)
+ Serial.println(F("Send Denon"));
+ Serial.flush();
+ IrSender.sendDenon(sAddress & 0x1F, sCommand, 0);
+ checkReceive(sAddress & 0x1F, sCommand);
+ delay(DELAY_AFTER_SEND);
+
+ Serial.println(F("Send Denon/Sharp variant"));
+ Serial.flush();
+ IrSender.sendSharp(sAddress & 0x1F, sCommand, 0);
+ checkReceive(sAddress & 0x1F, sCommand);
+ delay(DELAY_AFTER_SEND);
+#endif
+
+#if defined(DECODE_SONY)
+ Serial.println(F("Send Sony/SIRCS with 7 command and 5 address bits"));
+ Serial.flush();
+ IrSender.sendSony(sAddress & 0x1F, sCommand, 0); // SIRCS_12_PROTOCOL is default
+ checkReceive(sAddress & 0x1F, sCommand & 0x7F);
+ delay(DELAY_AFTER_SEND);
+
+ Serial.println(F("Send Sony/SIRCS with 7 command and 8 address bits"));
+ Serial.flush();
+ IrSender.sendSony(sAddress & 0xFF, sCommand, 0, SIRCS_15_PROTOCOL);
+ checkReceive(sAddress & 0xFF, sCommand & 0x7F);
+ delay(DELAY_AFTER_SEND);
+
+ Serial.println(F("Send Sony/SIRCS with 7 command and 13 address bits"));
+ Serial.flush();
+ IrSender.sendSony(sAddress & 0x1FFF, sCommand, 0, SIRCS_20_PROTOCOL);
+ checkReceive(sAddress & 0x1FFF, sCommand & 0x7F);
+ delay(DELAY_AFTER_SEND);
+#endif
+
+#if defined(DECODE_SAMSUNG)
+ Serial.println(F("Send Samsung 8 bit command and 8 bit address"));
+ Serial.flush();
+ IrSender.sendSamsung(sAddress & 0xFF, sCommand, 0);
+ checkReceive(sAddress & 0xFF, sCommand);
+ delay(DELAY_AFTER_SEND);
+
+ Serial.println(F("Send Samsung 16 bit command and address"));
+ Serial.flush();
+ IrSender.sendSamsung16BitAddressAndCommand(sAddress, s16BitCommand, 0);
+ checkReceive(sAddress, s16BitCommand);
+ delay(DELAY_AFTER_SEND);
+
+ Serial.println(F("Send Samsung48 16 bit command"));
+ Serial.flush();
+ IrSender.sendSamsung48(sAddress, s16BitCommand, 0);
+ checkReceive(sAddress, s16BitCommand);
+ delay(DELAY_AFTER_SEND);
+#endif
+
+#if defined(DECODE_RC5)
+ Serial.println(F("Send RC5"));
+ Serial.flush();
+ IrSender.sendRC5(sAddress & 0x1F, sCommand & 0x3F, 0, true); // 5 address, 6 command bits
+ checkReceive(sAddress & 0x1F, sCommand & 0x3F);
+ delay(DELAY_AFTER_SEND);
+
+ Serial.println(F("Send RC5X with 7.th MSB of command set"));
+ Serial.flush();
+ IrSender.sendRC5(sAddress & 0x1F, (sCommand & 0x3F) + 0x40, 0, true); // 5 address, 7 command bits
+ checkReceive(sAddress & 0x1F, (sCommand & 0x3F) + 0x40);
+ delay(DELAY_AFTER_SEND);
+#endif
+
+#if defined(DECODE_RC6)
+ Serial.println(F("Send RC6"));
+ Serial.flush();
+ sLastSendToggleValue = sAddress & 0x01; // to modify toggling at each loop
+
+ IrSender.sendRC6(sAddress & 0xFF, sCommand, 0, true);
+ checkReceive(sAddress & 0xFF, sCommand);
+ delay(DELAY_AFTER_SEND);
+
+ Serial.println(F("Send RC6A with 14 bit 0x2711 as extra"));
+ Serial.flush();
+ IrSender.sendRC6A(sAddress & 0xFF, sCommand, 0, 0x2711, true);
+ checkReceive(sAddress & 0xFF, sCommand);
+ delay(DELAY_AFTER_SEND);
+#endif
+
+#if defined(DECODE_BEO)
+ Serial.println(F("Send Bang&Olufsen"));
+ Serial.flush();
+ IrSender.sendBangOlufsen(sAddress & 0x0FF, sCommand, 0);
+# if defined(ENABLE_BEO_WITHOUT_FRAME_GAP)
+ delay((RECORD_GAP_MICROS / 1000) + 1);
+ Serial.println(F("- ENABLE_BEO_WITHOUT_FRAME_GAP is enabled"));
+ Serial.println(F("- Now print raw data and try to decode the first 6 entries, which results in rawData 0x0"));
+ IrReceiver.printIRResultRawFormatted(&Serial, true);
+ uint8_t tOriginalRawlen = IrReceiver.decodedIRData.rawDataPtr->rawlen;
+ IrReceiver.decodedIRData.rawDataPtr->rawlen = 6;
+ /*
+ * decode first part / AGC part of frame
+ */
+ IrReceiver.decode(); // sets IrReceiver.decodedIRData.rawlen to 6
+ IrReceiver.printIRResultShort(&Serial); // -> Protocol=Bang&Olufsen Address=0x0 Command=0x0 Raw-Data=0x0 0 bits MSB first
+
+ // Remove trailing 6 entries for second decode try
+ Serial.println();
+ Serial.println(
+ F(
+ "- Remove trailing 6 entries, which is equivalent to define RECORD_GAP_MICROS < 15000, to enable successful B&O decode"));
+ IrReceiver.decodedIRData.rawlen = tOriginalRawlen - 6;
+ IrReceiver.decodedIRData.rawDataPtr->rawlen = tOriginalRawlen - 6;
+ for (uint_fast8_t i = 0; i < IrReceiver.decodedIRData.rawlen; ++i) {
+ IrReceiver.decodedIRData.rawDataPtr->rawbuf[i] = IrReceiver.decodedIRData.rawDataPtr->rawbuf[i + 6];
+ }
+# endif
+ checkReceive(sAddress & 0x0FF, sCommand);
+ delay(DELAY_AFTER_SEND);
+#endif
+
+#if defined(DECODE_MAGIQUEST)
+ Serial.println(F("Send MagiQuest"));
+ Serial.flush();
+ IrSender.sendMagiQuest(0x6BCD0000 | (uint32_t) sAddress, s16BitCommand); // we have 31 bit address
+ checkReceive(sAddress, s16BitCommand & 0x1FF); // we have 9 bit command
+ delay(DELAY_AFTER_SEND);
+#endif
+
+ /*
+ * Next example how to use the IrSender.write function
+ */
+ IRData IRSendData;
+ // prepare data
+ IRSendData.address = sAddress;
+ IRSendData.command = sCommand;
+ IRSendData.flags = IRDATA_FLAGS_EMPTY;
+
+ Serial.println(F("Send next protocols with IrSender.write"));
+ Serial.println();
+ Serial.flush();
+
+#if defined(DECODE_JVC)
+ IRSendData.protocol = JVC; // switch protocol
+ Serial.print(F("Send "));
+ Serial.println(getProtocolString(IRSendData.protocol));
+ Serial.flush();
+ IrSender.write(&IRSendData, 0);
+ checkReceive(IRSendData.address & 0xFF, IRSendData.command);
+ delay(DELAY_AFTER_SEND);
+#endif
+
+#if defined(DECODE_LG) || defined(DECODE_MAGIQUEST)
+ IRSendData.command = s16BitCommand; // LG support more than 8 bit command
+#endif
+
+#if defined(DECODE_LG)
+ IRSendData.protocol = LG;
+ Serial.print(F("Send "));
+ Serial.println(getProtocolString(IRSendData.protocol));
+ Serial.flush();
+ IrSender.write(&IRSendData, 0);
+ checkReceive(IRSendData.address & 0xFF, IRSendData.command);
+ delay(DELAY_AFTER_SEND);
+#endif
+
+#if defined(DECODE_BOSEWAVE)
+ IRSendData.protocol = BOSEWAVE;
+ Serial.println(F("Send Bosewave with no address and 8 command bits"));
+ Serial.flush();
+ IrSender.write(&IRSendData, 0);
+ checkReceive(0, IRSendData.command & 0xFF);
+ delay(DELAY_AFTER_SEND);
+#endif
+
+#if defined(DECODE_FAST)
+ IRSendData.protocol = FAST;
+ Serial.print(F("Send "));
+ Serial.println(getProtocolString(IRSendData.protocol));
+ Serial.flush();
+ IrSender.write(&IRSendData, 0);
+ checkReceive(0, IRSendData.command & 0xFF);
+ delay(DELAY_AFTER_SEND);
+#endif
+
+ /*
+ * LEGO is skipped, since it is difficult to receive because of its short marks and spaces
+ */
+// Serial.println(F("Send Lego with 2 channel and with 4 command bits"));
+// Serial.flush();
+// IrSender.sendLegoPowerFunctions(sAddress, sCommand, LEGO_MODE_COMBO, true);
+// checkReceive(sAddress, sCommand); // never has success for Lego protocol :-(
+// delay(DELAY_AFTER_SEND);
+ /*
+ * Force buffer overflow
+ */
+ Serial.println(F("Force buffer overflow by sending 450 marks and spaces"));
+ for (unsigned int i = 0; i < 225; ++i) {
+ // 400 + 400 should be received as 8/8 and sometimes as 9/7 or 7/9 if compensation by MARK_EXCESS_MICROS is optimal.
+ // 210 + 540 = 750 should be received as 5/10 or 4/11 if compensation by MARK_EXCESS_MICROS is optimal.
+ IrSender.mark(210); // 8 pulses at 38 kHz
+ IrSender.space(540); // to fill up to 750 us
+ }
+ checkReceive(sAddress, sCommand);
+ delay(DELAY_AFTER_SEND);
+
+ /*
+ * Increment values
+ * Also increment address just for demonstration, which normally makes no sense
+ */
+ sAddress += 0x0101;
+ sCommand += 0x11;
+ s16BitCommand += 0x1111;
+ sRepeats++;
+ // clip repeats at 4
+ if (sRepeats > 4) {
+ sRepeats = 4;
+ }
+
+ /*
+ * Test stop and start of 50 us receiver timer
+ */
+ Serial.println(F("Stop receiver"));
+ IrReceiver.stop();
+ delay(DELAY_AFTER_LOOP); // additional delay at the end of each loop
+ Serial.println(F("Start receiver"));
+ IrReceiver.start(); // For ESP32 timerEnableReceiveInterrupt() is sufficient here, since timer is not reconfigured by another task
+}
+
diff --git a/libraries/IRremote/examples/UnitTest/UnitTest.log b/libraries/IRremote/examples/UnitTest/UnitTest.log
new file mode 100644
index 0000000..99acf3f
--- /dev/null
+++ b/libraries/IRremote/examples/UnitTest/UnitTest.log
@@ -0,0 +1,851 @@
+START ../src/UnitTest.cpp from Jun 22 2024
+Using library version 4.4.0
+Ready to receive IR signals of protocols: NEC/NEC2/Onkyo/Apple, Panasonic/Kaseikyo, Denon/Sharp, Sony, RC5, RC6, LG, JVC, Samsung, Bang & Olufsen, FAST, Bosewave, MagiQuest, Universal Pulse Distance Width, Hash at pin 2
+Use ReceiveCompleteCallback
+Receive buffer length is 200
+Send IR signals at pin 3
+If you connect debug pin 5 to ground, raw data is always printed
+Send signal mark duration for 38kHz is 8 us, pulse narrowing correction is 3000 ns, total period is 26 us
+16000 us is the (minimum) gap, after which the start of a new IR packet is assumed
+20 us are subtracted from all marks and added to all spaces for decoding
+
+address=0xFFF1 command=0x76
+
+Send NEC with 8 bit address
+Protocol=NEC Address=0xF1 Command=0x76 Raw-Data=0x89760EF1 32 bits LSB first
+Send with: IrSender.sendNEC(0xF1, 0x76, );
+rawData[68]:
+ -1049200
+ +8900,-445
+ + 600,-1600 + 600,- 550 + 600,- 500 + 600,- 550
+ + 600,-1600 + 600,-1650 + 600,-1650 + 600,-1650
+ + 600,- 550 + 600,-1600 + 600,-1650 + 600,-1650
+ + 600,- 500 + 600,- 550 + 600,- 500 + 600,- 550
+ + 600,- 500 + 600,-1650 + 600,-1650 + 600,- 550
+ + 600,-1600 + 600,-1650 + 600,-1650 + 600,- 500
+ + 600,-1650 + 600,- 550 + 600,- 500 + 600,-1650
+ + 600,- 550 + 600,- 500 + 600,- 550 + 600,-1650
+ + 600
+Sum: 67800
+
+Send NEC with 16 bit address
+Protocol=NEC Address=0xFFF1 Command=0x76 Raw-Data=0x8976FFF1 32 bits LSB first
+Send with: IrSender.sendNEC(0xFFF1, 0x76, );
+rawData[68]:
+ -1058500
+ +8950,-4450
+ + 550,-1650 + 600,- 500 + 600,- 550 + 600,- 500
+ + 600,-1650 + 600,-1650 + 600,-1650 + 600,-1650
+ + 600,-1600 + 600,-1650 + 600,-1650 + 600,-1600
+ + 600,-1650 + 600,-1650 + 600,-1650 + 600,-1650
+ + 600,- 500 + 600,-1650 + 600,-1650 + 600,- 550
+ + 600,-1600 + 600,-1650 + 600,-1650 + 600,- 550
+ + 600,-1600 + 600,- 550 + 600,- 500 + 600,-1650
+ + 600,- 550 + 600,- 500 + 600,- 550 + 600,-1600
+ + 600
+Sum: 73350
+
+Send NEC2 with 16 bit address
+Protocol=NEC Address=0xFFF1 Command=0x76 Raw-Data=0x8976FFF1 32 bits LSB first
+Send with: IrSender.sendNEC(0xFFF1, 0x76, );
+rawData[68]:
+ -1059050
+ +8950,-4400
+ + 600,-1600 + 600,- 550 + 600,- 550 + 600,- 500
+ + 600,-1650 + 600,-1650 + 600,-1650 + 600,-1600
+ + 600,-1650 + 600,-1650 + 600,-1600 + 650,-1600
+ + 600,-1650 + 600,-1650 + 600,-1600 + 650,-1600
+ + 600,- 550 + 600,-1600 + 600,-1650 + 600,- 550
+ + 600,-1600 + 600,-1650 + 600,-1650 + 600,- 550
+ + 600,-1600 + 600,- 550 + 600,- 550 + 600,-1600
+ + 600,- 550 + 600,- 500 + 600,- 550 + 600,-1600
+ + 600
+Sum: 73300
+
+Send Panasonic 0xB, 0x10 as 48 bit PulseDistance using ProtocolConstants
+Protocol=Panasonic Address=0xB Command=0x10 Raw-Data=0xA01000B0 48 bits LSB first
+Send with: IrSender.sendPanasonic(0xB, 0x10,