v2.x is a significant change in the IRremoteESP8266 library from versions v1.x & earlier. Almost all the code in the library has been re-written. Due to that there are now some substantial differences to prior versions.
To update your code to use the new version of the library, you will need to make a few changes. First, you will need to add or change the main library #include file. e.g.
#include <IRremoteESP8266.h>
#include <IRsend.h> // Needed if you want to send IR commands.
#include <IRrecv.h> // Needed if you want to receive IR commands.
Almost all arguments of the procedures and functions in the library have been changed to c99 types and to unsigned variables. e.g.
#include <IRremoteESP8266.h>
long data = 0x12345678;
int bits = 32;
irsend.sendNEC(data, bits);
#include <IRremoteESP8266.h>
#include <IRsend.h>
// Simple upgrade
unsigned long data = 0x12345678;
unsigned int bits = 32;
irsend.sendNEC(data, bits);
or
#include <IRremoteESP8266.h>
#include <IRsend.h>
// Better upgrade
uint64_t data = 0x12345678ULL; // unsigned long long
uint16_t bits = 32U; // unsigned int
irsend.sendNEC(data, bits);
The main code of the library has moved to the src/ subdirectory. Under which, all the protocols and major functions have been split into individual files. e.g. NEC-related routines are located in src/ir_NEC.cpp, etc.
The test/ directory stores the unit tests for this library. It is used for testing the library. It is not for use on the ESP chips. The tests are designed to run on Travis or unix machines.
The lib/ directory stores external libraries used by this library. Namely, the Google Unit Test framework.
Highlights of the changes in v2.0sendNEC(0x12345678, 32);
-> New: sendNEC(0x12345678);
sendSony(0x1234, 20, 2);
-> New: sendSony(0x1234, 20);
RetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4