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:
Florian committed 2019-02-08 16:50:37 +01:00
1 parent 0180a0dbd5
commit f0305236db
149 files changed
+20957 -7850

No files matched your search

@@ -1,7 +1,7 @@
/* Copyright 2017 David Conran
/* Copyright 2017, 2018 David Conran
*
* 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.
*
@@ -30,25 +30,23 @@
#include <IRsend.h>
#include <ir_Toshiba.h>
#define IR_LED 4 // ESP8266 GPIO pin to use. Recommended: 4 (D2).
IRToshibaAC toshibair(IR_LED); // Set the GPIO to be used for sending messages.
const uint16_t kIrLed = 4; // ESP8266 GPIO pin to use. Recommended: 4 (D2).
IRToshibaAC ac(kIrLed); // Set the GPIO to be used for sending messages.
void printState() {
// Display the settings.
Serial.println("Toshiba A/C remote is in the following state:");
Serial.printf(" Power: %d, Mode: %d, Temp: %dC, Fan Speed: %d\n",
toshibair.getPower(), toshibair.getMode(), toshibair.getTemp(),
toshibair.getFan());
Serial.printf(" %s\n", ac.toString().c_str());
// Display the encoded IR sequence.
unsigned char* ir_code = toshibair.getRaw();
unsigned char* ir_code = ac.getRaw();
Serial.print("IR Code: 0x");
for (uint8_t i = 0; i < TOSHIBA_AC_STATE_LENGTH; i++)
for (uint8_t i = 0; i < kToshibaACStateLength; i++)
Serial.printf("%02X", ir_code[i]);
Serial.println();
}
void setup() {
toshibair.begin();
ac.begin();
Serial.begin(115200);
delay(200);
@@ -56,17 +54,17 @@ void setup() {
Serial.println("Default state of the remote.");
printState();
Serial.println("Setting desired state for A/C.");
toshibair.on();
toshibair.setFan(1);
toshibair.setMode(TOSHIBA_AC_COOL);
toshibair.setTemp(26);
ac.on();
ac.setFan(1);
ac.setMode(kToshibaAcCool);
ac.setTemp(26);
}
void loop() {
// Now send the IR signal.
#if SEND_TOSHIBA_AC
Serial.println("Sending IR command to A/C ...");
toshibair.send();
ac.send();
#endif // SEND_TOSHIBA_AC
printState();
delay(5000);