diff --git a/tasmota/my_user_config.h b/tasmota/my_user_config.h index fc108ce9f..7c354c8bf 100644 --- a/tasmota/my_user_config.h +++ b/tasmota/my_user_config.h @@ -719,6 +719,10 @@ // -- IR Remote features - subset of IR protocols -------------------------- #define USE_IR_REMOTE // Send IR remote commands using library IRremoteESP8266 and ArduinoJson (+4k3 code, 0k3 mem, 48 iram) + #define IR_SEND_INVERTED false // Invert the output. (default = false) e.g. LED is illuminated when GPIO is LOW rather than HIGH. + // Setting inverted to something other than the default could easily destroy your IR LED if you are overdriving it. + // Unless you REALLY know what you are doing, don't change this. + #define IR_SEND_USE_MODULATION true // Do we do frequency modulation during transmission? i.e. If not, assume a 100% duty cycle. #define USE_IR_SEND_NEC // Support IRsend NEC protocol #define USE_IR_SEND_RC5 // Support IRsend Philips RC5 protocol #define USE_IR_SEND_RC6 // Support IRsend Philips RC6 protocol diff --git a/tasmota/xdrv_05_irremote.ino b/tasmota/xdrv_05_irremote.ino index 881ce62bf..efa048465 100644 --- a/tasmota/xdrv_05_irremote.ino +++ b/tasmota/xdrv_05_irremote.ino @@ -128,7 +128,7 @@ IRsend *irsend = nullptr; void IrSendInit(void) { - irsend = new IRsend(Pin(GPIO_IRSEND)); // an IR led is at GPIO_IRSEND + irsend = new IRsend(Pin(GPIO_IRSEND), IR_SEND_INVERTED, IR_SEND_USE_MODULATION); // an IR led is at GPIO_IRSEND irsend->begin(); } diff --git a/tasmota/xdrv_05_irremote_full.ino b/tasmota/xdrv_05_irremote_full.ino index 31dd22968..4bfd00da2 100644 --- a/tasmota/xdrv_05_irremote_full.ino +++ b/tasmota/xdrv_05_irremote_full.ino @@ -136,7 +136,7 @@ StateModes strToStateMode(class JsonParserToken token, StateModes def); // decla void IrSendInit(void) { - irsend = new IRsend(Pin(GPIO_IRSEND)); // an IR led is at GPIO_IRSEND + irsend = new IRsend(Pin(GPIO_IRSEND), IR_SEND_INVERTED, IR_SEND_USE_MODULATION); // an IR led is at GPIO_IRSEND irsend->begin(); } @@ -470,7 +470,7 @@ uint32_t IrRemoteCmndIrHvacJson(void) if (!IR_RCV_WHILE_SENDING && (irrecv != nullptr)) { irrecv->disableIRIn(); } if (stateMode == StateModes::SEND_ONLY || stateMode == StateModes::SEND_STORE) { - IRac ac(Pin(GPIO_IRSEND)); + IRac ac(Pin(GPIO_IRSEND), IR_SEND_INVERTED, IR_SEND_USE_MODULATION); bool success = ac.sendAc(state, irhvac_stateful && irac_prev_state.protocol == state.protocol ? &irac_prev_state : nullptr); if (!success) { return IE_SYNTAX_IRHVAC; } }