Update IRRemoteESP8266 version to 2.5.5
factorize IR send signal function between the 2 types of receiving Add new IRRemoteESP8266 protocols replace pins on mega according schema remove unecessaries spaces
This commit is contained in:
1 parent
0180a0dbd5
commit
f0305236db
149 files changed
+20957
-7850
No files matched your search
@@ -5,7 +5,7 @@
|
||||
* JVC and Panasonic protocol added by Kristian Lauszus (Thanks to zenwheel and other people at the original blog post)
|
||||
*
|
||||
* An IR LED circuit *MUST* be connected to the ESP8266 on a pin
|
||||
* as specified by IR_LED below.
|
||||
* as specified by kIrLed below.
|
||||
*
|
||||
* TL;DR: The IR LED needs to be driven by a transistor for a good result.
|
||||
*
|
||||
@@ -34,14 +34,13 @@
|
||||
#include <IRremoteESP8266.h>
|
||||
#include <IRsend.h>
|
||||
|
||||
#define PanasonicAddress 0x4004 // Panasonic address (Pre data)
|
||||
#define PanasonicPower 0x100BCBD // Panasonic Power button
|
||||
const uint16_t kPanasonicAddress = 0x4004; // Panasonic address (Pre data)
|
||||
const uint32_t kPanasonicPower = 0x100BCBD; // Panasonic Power button
|
||||
const uint16_t kJVCPower = 0xC5E8;
|
||||
|
||||
#define JVCPower 0xC5E8
|
||||
const uint16_t kIrLed = 4; // ESP8266 GPIO pin to use. Recommended: 4 (D2).
|
||||
|
||||
#define IR_LED 4 // ESP8266 GPIO pin to use. Recommended: 4 (D2).
|
||||
|
||||
IRsend irsend(IR_LED); // Set the GPIO to be used to sending the message.
|
||||
IRsend irsend(kIrLed); // Set the GPIO to be used to sending the message.
|
||||
|
||||
void setup() {
|
||||
irsend.begin();
|
||||
@@ -50,18 +49,15 @@ void setup() {
|
||||
void loop() {
|
||||
// This should turn your TV on and off
|
||||
#if SEND_PANASONIC
|
||||
irsend.sendPanasonic(PanasonicAddress, PanasonicPower);
|
||||
irsend.sendPanasonic(kPanasonicAddress, kPanasonicPower);
|
||||
#else // SEND_PANASONIC
|
||||
Serial.println("Can't send because SEND_PANASONIC has been disabled.");
|
||||
#endif // SEND_PANASONIC
|
||||
|
||||
#if SEND_JVC
|
||||
irsend.sendJVC(JVCPower, 16, 0); // hex value, 16 bits, no repeat
|
||||
// see http://www.sbprojects.com/knowledge/ir/jvc.php for information
|
||||
delayMicroseconds(50);
|
||||
irsend.sendJVC(JVCPower, 16, 1); // hex value, 16 bits, repeat
|
||||
delayMicroseconds(50);
|
||||
irsend.sendJVC(kJVCPower, 16, 1); // hex value, 16 bits, single repeat
|
||||
#else // SEND_JVC
|
||||
Serial.println("Can't send because SEND_JVC has been disabled.");
|
||||
#endif // SEND_JVC
|
||||
delay(10000); // Wait 10 seconds before we repeat everything.
|
||||
}
|
||||
Reference in new issue
Block a user