Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add IR emitter inverter #738

Merged
merged 1 commit into from
Aug 23, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion main/ZgatewayIR.ino
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ IRrecv irrecv(IR_RECEIVER_GPIO, 1024, 15U, true);
# else
IRrecv irrecv(IR_RECEIVER_GPIO);
# endif
IRsend irsend(IR_EMITTER_GPIO);
IRsend irsend(IR_EMITTER_GPIO, IR_EMITTER_INVERTED);
# else
# include <IRremote.h>
IRrecv irrecv(IR_RECEIVER_GPIO);
Expand Down
6 changes: 6 additions & 0 deletions main/config_IR.h
Original file line number Diff line number Diff line change
Expand Up @@ -156,6 +156,12 @@ extern void MQTTtoIR(char* topicOri, JsonObject& RFdata);
//#define IR_PANASONIC
#endif

#ifndef IR_EMITTER_INVERTED
# if defined(ESP8266) || defined(ESP32)
# define IR_EMITTER_INVERTED false //set to true if yuou want to reverse the LED signal for the emitter
# endif
#endif

/*-------------------PIN DEFINITIONS----------------------*/
#ifndef IR_RECEIVER_GPIO
# ifdef ESP8266
Expand Down
1 change: 1 addition & 0 deletions platformio.ini
Original file line number Diff line number Diff line change
Expand Up @@ -348,6 +348,7 @@ build_flags =
'-DLOW_POWER_LED_OFF=1'
'-DSLEEP_BUTTON=39'
'-DTRIGGER_GPIO=39'
'-DIR_EMITTER_INVERTED=true'
'-DIR_EMITTER_GPIO=9'
'-DGateway_Name="OpenMQTTGateway_ESP32_M5STICK_C_BLE_IR"'
board_upload.speed = 1500000
Expand Down