 #include "user_interface.h"
 }
 
+int RECV_PIN = D1; // an IR detector/demodulatord
+IRrecv irrecv(RECV_PIN);
+decode_results results;
+
 void setup() {
 
   irsend.begin();
+  irrecv.enableIRIn(); // Start the receiver
   mySwitch.enableTransmit(3); // Pin 3 is RXD; 433 MHz
 
   ////////////

          }

          if (inData == "get_IRL") {
            send(i, "IR Learner Disabled"); // TODO: Implement capture (once IRremoteESP8266 supports it)
          }

          if (inData == "stop_IRL") {
            send(i, "IR Learner Disabled"); // TODO: Implement capture (once IRremoteESP8266 supports it)
          }

          if (inData == "getversion,0")

*/

/*
  Circuit:
  To get good range, attach a resistor to pin 12 of the ESP-12E and connect the resistor to the G pin of a 2N7000 transistor.
  If you look at the flat side of the 2N7000 you have S, G, D pins.
  Connect S to GND, G to the resistor to the MCU, and D to the IR LED short pin.
  The long pin of the IR LED is connected to +3.3V.
  I picked the 2N7000 because unlike others it will not pull pin 2 down which would prevent the chip from booting.
*/

#include <ESP8266WiFi.h>
