You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I'm encountering issues when trying to send IR signals using the LG protocol with the IRremoteESP8266 library on an Arduino ESP8266 board. The default irsend.sendLG() function is not functioning as expected for my specific device, and I need assistance in setting up a custom bit pattern or finding an alternative solution.
Steps Taken:
I set up the IR receiver and sender as follows:
#include<IRremoteESP8266.h>
#include<IRrecv.h>
#include<IRutils.h>
#include<IRsend.h>constuint16_tkRecvPin = D6; // HX1838 OUT pin connected hereconstuint16_tkIrLedPin = D0; // Pin connected to IR LEDconstuint16_tkButtonPin = D1; // Button connected here
IRrecv irrecv(kRecvPin);
IRsend irsend(kIrLedPin);
decode_results results;
voidsetup() {
Serial.begin(115200);
Serial.println("\nStarting IR system");
irrecv.enableIRIn(); // Start the receiver
Serial.println("Ready to receive IR signals");
irsend.begin();
Serial.println("Ready to send IR signals");
pinMode(kButtonPin, INPUT_PULLUP); // Button is active LOW
}
voidloop() {
if (irrecv.decode(&results)) {
Serial.println("\nIR Signal received:");
Serial.print("Hex Code: ");
Serial.println(resultToHexidecimal(&results)); // Display HEX code
Serial.print("Protocol: ");
Serial.println(results.decode_type); // Display Protocol (e.g., NEC, SONY)sendCustomLGSignal(0x805); // Send IR signal using protocol 1
Serial.println("Sent IR signal: 0x805 using LG protocol");
delay(2000); // Wait 2 seconds before sending again
irrecv.resume(); // Ready to receive the next signal
}
if (digitalRead(kButtonPin) == LOW) {
Serial.println("Button pressed! Sending IR signal: 0x805 using LG protocol");
sendCustomLGSignal(0x805); // Send IR signal using protocol 1delay(500); // Debounce delay
}
}
voidsendCustomLGSignal(uint32_t code) {
constint bitCount = 32;
constuint16_t timings[] = {
9000, 4500, 560, 1690, 560, 560, 560, 560, 560, 1690, 560, 560, 560, 560, 560, 1690, 560, 560, 560, 560, 560, 560, 1690, 560, 560, 560, 560, 560, 1690, 560, 560
};
irsend.sendRaw(timings, bitCount, 38); // Send timings in microseconds and bitCount = 38
}
Issue: Despite sending signals with protocol 1, my target LG device does not respond correctly. It appears that the IR timings might not be accurately configured for this device. Button pressed! Sending IR signal: 0x805 using protocol 1 IR Signal received: Hex Code: 0x39ABC918 Protocol: -1
I always receive random value.
Expected Behavior: I expect the irsend.sendRaw() function to successfully send the IR signal using the custom timings specified for the LG protocol.
What I've Tried:
Adjusting Timings: I've tried modifying the timings array to better match the device specifications, but it hasn’t yielded the desired response.
Alternative Libraries: I've explored using other libraries like IRremote and IRLib, but they do not seem to provide a straightforward method for custom protocols like protocol 1 in IRremoteESP8266.
Questions:
Is there a specific method or additional function in IRremoteESP8266 that can be used to send IR signals using a custom bit pattern for the LG protocol?
Could there be a specific set of timings required for protocol 1 (LG) that I am unaware of?
Has anyone successfully used protocol 1 with LG signals on the IRremoteESP8266 library and could share their setup or adjustments?
The text was updated successfully, but these errors were encountered:
Since you are using sendRaw the LG protocol in the library is irrelevant, you could verify that the sent code is what you expect by using a different receiver with the dump sketch on it.
I'm encountering issues when trying to send IR signals using the LG protocol with the
IRremoteESP8266
library on an Arduino ESP8266 board. The defaultirsend.sendLG()
function is not functioning as expected for my specific device, and I need assistance in setting up a custom bit pattern or finding an alternative solution.Steps Taken:
I set up the IR receiver and sender as follows:
Issue: Despite sending signals with protocol 1, my target LG device does not respond correctly. It appears that the IR timings might not be accurately configured for this device.
Button pressed! Sending IR signal: 0x805 using protocol 1 IR Signal received: Hex Code: 0x39ABC918 Protocol: -1
I always receive random value.
Expected Behavior: I expect the
irsend.sendRaw()
function to successfully send the IR signal using the custom timings specified for the LG protocol.What I've Tried:
timings
array to better match the device specifications, but it hasn’t yielded the desired response.IRremote
andIRLib
, but they do not seem to provide a straightforward method for custom protocols like protocol 1 inIRremoteESP8266
.Questions:
IRremoteESP8266
that can be used to send IR signals using a custom bit pattern for the LG protocol?The text was updated successfully, but these errors were encountered: