1
votes

Im trying to use the Arduino IDE to work with an ESP32 board and implement an IR transmit sketch.

So I found that the IRRemote library included with the IDE won't work with the ESP32 but it has been forked and patched here https://github.com/SensorsIot/Definitive-Guide-to-IR/tree/master/ESP32-IRremote

The problems I have are I don't know the best way to download this library and put into the Arduino IDE's include path. Also once I have done that, how can know i'm including the correct header files (IRRemote.h/IRSend.h), as both the unpatched Arduino version and this new ESP32 version are now installed?

Thanks NFV

1

1 Answers

0
votes

Who can read has an advantage:

Installation

  • Navigate to the Releases page.
  • Download the latest release.
  • Extract the zip file
  • Move the "IRremote" folder that has been extracted to your libraries directory.
  • Make sure to delete Arduino_Root/libraries/RobotIRremote. Where Arduino_Root refers to the install directory of Arduino. The library RobotIRremote has similar definitions to IRremote and causes errors.

EDIT
To install depending on the used hardware the correct library you use guards:

 #ifdef ESP32
 #include myLibrary1.h
 #include myLibrary2.h
 #else
#include theirLibrary1.h
#include theirLibrary2.h
#endif

There are more options of course but for your case its sufficient. So when choosing an ESP32 it will compile the correct lib for all others it uses the second option (if you need more differentiation you use #elif ) .