title: Is there a way to turn ESP32-WROOM-32D on a SparkFun Thing Plus into an IR Transmitter for a remote replacement on an old Benq Projector?
body: <p>I'm still new to learning about Arduino, ESP32, and IR Transmission in general. So bare with me as I'm a bit uneducated with some of the terminology.</p>
  <p>As the title states, I have a SparkFun Thing Plus module I'd like to try to turn into a replacement remote for an older Benq Projector. That way I can sent up Alexa commands for it and automate it blanking the screen, etc. I have managed to work my way to connecting it to WiFi, as well as using Alexa to turn on the built in blue LED (pin13). However, trying to get it to send to a transmitter I have (audiojack plug in, 3.3V plus signal wire) I've ran into it just not working. Could be my code, could be my lack of understanding of how it works, or maybe I'm just putting things on the wrong pins. I dont know at this point, I just know it compiles without errors.</p>
  <p>Let me know what you think, maybe I'm just using the wrong type of device? Or maybe I'm missing something completely about making a transition for this. Thanks again in advance!</p>
  <p><a href="https://learn.sparkfun.com/tutorials/esp32-thing-plus-hookup-guide/all" rel="nofollow noreferrer">https://learn.sparkfun.com/tutorials/esp32-thing-plus-hookup-guide/all</a></p>
  <pre><code>#include &lt;Arduino.h&gt;
  #define ESP32
  #include &lt;WiFi.h&gt;
  #include &quot;fauxmoESP.h&quot;
  #include &quot;login.h&quot;
  fauxmoESP fauxmo;
  // -----------------------------------------------------------------------------
  #define SERIAL_BAUDRATE     115200
  #define LED_BLUE            13
  #define ID_BLUE             &quot;TEST_ON_LED&quot;
  #define IRSensor            5                 //NOT SURE HOW TO IMPLEMENT THIS
  #define ID_IR               &quot;IRSensor&quot;        //NOT SURE HOW TO IMPLEMENT THIS
  // -----------------------------------------------------------------------------
  #include &lt;IRremote.h&gt;
  IRsend irpower;
  #define BLANK_CODE  0xCE01F
  #define OK          0xCA857
  #define RIGHT_ARROW 0xC708F
  #define LEFT_ARROW  0xCB04F
  #define UP_ARROW    0xCD02F
  #define DOWN_ARROW  0xC30CF
  #define BLANK       0xCE01F
  #define RETURN      0xCA15E
  #define POWER       0xC40BF
  #define MENU        0xC20DF
  #define AUTO        0xC10EF
  #define SETTINGS    0xCF00F
  
  // -----------------------------------------------------------------------------
  
  void wifiSetup() {          //THIS SECTION WORKS
    WiFi.mode(WIFI_STA);
    Serial.printf(&quot;[WIFI] Connecting to %s &quot;, WIFI_SSID);
    WiFi.begin(WIFI_SSID, WIFI_PASS);
    while (WiFi.status() != WL_CONNECTED) {
      Serial.print(&quot;.&quot;);
      delay(100);
    }
    Serial.println();
    Serial.printf(&quot;[WIFI] STATION Mode, SSID: %s, IP address: %s\n&quot;, WiFi.SSID().c_str(), 
    WiFi.localIP().toString().c_str());
  }
  
  void setup() { 
  
    Serial.begin(SERIAL_BAUDRATE);
    Serial.println();
    Serial.println();
  
    pinMode(LED_BLUE, OUTPUT);
    digitalWrite(LED_BLUE, LOW);
  
    // Wifi
    wifiSetup();
  
    fauxmo.createServer(true);
    fauxmo.setPort(80);
  
    fauxmo.enable(true);
  
    // Add virtual devices
    fauxmo.addDevice(ID_BLUE);
    fauxmo.addDevice(ID_IR);
  
    fauxmo.onSetState([](unsigned char device_id, const char * device_name, bool state, unsigned char value) {
        uint8_t len = 32;
        uint32_t datab = BLANK;
  
      Serial.printf(&quot;[MAIN] Device #%d (%s) state: %s value: %d\n&quot;, device_id, device_name, state ? &quot;ON&quot; : &quot;OFF&quot;, value);
  
      if (strcmp(device_name, ID_BLUE) == 0) {
        digitalWrite(LED_BLUE, state ? HIGH : LOW);       //INDICATES IF ALEXA IS WORKING WITH COMMAND
      }
      if (strcmp(device_name, ID_IR) == 0) {
        irpower.sendNEC(datab,len);
      }
    });
  
  }
  
  void loop() {
    
    fauxmo.handle();
  
  } ```
  </code></pre>