Library Installation

There are number of Arduino software libraries that must be installed for this project. You should configure your Arduino IDE to operate Feather M0 BLE and Trinket M0 boards. You also need to install a number of libraries for the TFT Display board. See the learning guides for those particular boards for complete details on what software is necessary to operate those boards. As suggested earlier, you should run some of the Bluefruit demo sketches as well as graphics test sketches as described in those tutorials.

All of the IR functions for this project depend on my IRLib2 libraries which are available on GitHub at this link:

That library cannot be installed using the Library Manager. You have to install manually. Installation of the IRLib2 library is as follows:

  1. Visit the IRLib2 page on GitHib.
  2. Select the “Download ZIP” button, or simply click this link to download directly.
  3. Uncompress the ZIP file after it’s finished downloading.
  4. The resulting folder should be named "IRLib2-master" and will contain 5 separate folders. That is because IRLib 2.x is actually a collection of 5 libraries that work together. Sometimes in Windows you’ll get an intermediate-level folder and need to move things around.
  5. Copy all five folders into your Arduino library folder alongside your other Arduino libraries, typically in your (home folder)/Documents/Arduino/Libraries folder. Libraries should not be installed alongside the Arduino application itself.
  6. Restart the Arduino IDE if it’s currently running

This repository consists of a total of five libraries each of which must be in your arduino/libraries/ folder. So for example it should be installed as follows…

  • arduino/libraries/IRLib2
  • arduino/libraries/IRLibFreq
  • arduino/libraries/IRLibProtocols
  • arduino/libraries/IRLibRecv
  • arduino/libraries/IRLibRecvPCI

Do not install them in a single folder such as this…

  • arduino/libraries/IRLib2_master
    • IRLib2
    • IRLibFreq
    • IRLibProtocols
    • IRLibRecv
    • IRLibRecvPCI

Here is a tutorial that walks through the process of manually installing libraries that are not available through the Arduino Library Manager.

There is a minor modification that you need to make to IRLib in order to get it to work with this project. The default output pin for an Adafruit Feather M0 is pin 9. However that particular pin is used to control the TFT Display. So we have to change the default to pin 12 which is how we wired this device.

Find the file Arduino/libraries/IRLibProtocols/IRLibSAMD21.h. This file contains the defaults for using any board that uses the SAMD21 processor. At approximately line 91 you will find the following code:

#elif (defined(ADAFRUIT_FEATHER_M0) || defined(ARDUINO_SAMD_FEATHER_M0_EXPRESS) )
  //Settings for Adafruit Feather M0 or Adafruit Feather M0 Express
  //Default is 9. Available on all Feather M0 are 0,1,5,6,9-13,17/A3,18/A4
  //On the standard M0 20/SDA, 21/SCL, 22/MISO, 23/MOSI, 24/SCK
  //On the M0 Express  26/SDA, 27/SCL, 28/MISO, 29/MOSI, 30/SCK
  //Only the pin numbers are different so use the labels.
  #define IR_SEND_PWM_PIN 9

You must change the last line to read:

  #define IR_SEND_PWM_PIN 12
Warning: If you are using IRLib for other projects that expect the default to be pin 9, you will have to edit this line again to put it back to its normal default. Unfortunately there is no way to specify output pin number in your end-user sketch. You must edit the library.

Sketch Installation

There are three sketches in the repository that you downloaded for this project. The one called ultimate_remote should be uploaded to your Feather M0 BLE board. The one called trinket_dongle should be uploaded to the Trinket dongle obviously. The software has already been configured to work with my Samsung 3d TV, my Spectrum Cable DVR, my Sony amplifier surround sound system, and a Samsung 3d Blu-ray player. The chance that you have the same model using the same protocol as I do is pretty slim. But there is one part of the remote that you can test immediately and that is the mouse and keyboard functions. See the section "Mouse and Keyboard Pages" on the page Operating the Device and give it a try.

You will need to reconfigure the software to work with your particular TV, DVR or other consumer electronic device. We suggest you play around with the mouse and keyboard features first because it does not need configuration or customization. If you did not build a dongle and do not plan use your device for mouse and keyboard emulation, then you can still learn to navigate the menus, but of course it won't do you much good until you can configure it for your own devices. After playing around a bit, you should proceed to section Configuring for Your IR Devices.

This guide was first published on Sep 23, 2019. It was last updated on Sep 23, 2019.

This page (Installing Libraries and the Sketch Software) was last updated on Mar 31, 2021.

Text editor powered by tinymce.