A new version of IRLib is now available on GitHub at
Down three IRLib is a library of code for Arduino-based microcontrollers that facilitates sending, receiving, decoding and analyzing infrared remote signals. Here is an overview of the changes.
- Added new file IRLibRData.h and moved irparams structure and related items to that file. Allows users to create custom IRrecv classes
- Rewrote Samsung36 example to include both send and receive
- Added new examples for new protocols DirecTV and GIcable
- Added new example IRanalyze gives more detailed analysis of timing. Useful in analyzing the protocols
- Added new example IRfreq reports modulation frequency of a signal. Requires TSMP58000 IR learner chip
- Cleanup of other example routines.
- Created IRrecvBase class to allow custom receiver classes. IRrecv is now a derived class from it.
- Created IRrecvLoop class which receives IR signals without using any hardware interrupts or timers. Also created IRrecvPCI class which uses Pin Change Interrupts to receive IR signals. These new receivers are more accurate than the 50µs timing of the original IRrecv. However they also have other limitations described in comments.
- In IRrecvBase added “unsigned char Mark_Excess” with default value 100. Was a define macro but now is user settable.
- In IRrecvBase added method “unsigned char getPinNum(void);” which retrieves the pin number used from irparams.recvpin. This value not normally accessible to end user.
- Globally available function “void do_Blink(void);” blinks pin 13 LED. For use by user created extensions of IRrecvBase.
- Data collected by IRrecvBase classes in irparams.rawbuf is now converted to actual microseconds rather than clock ticks of 50 µs each. IRrecvBase::GetResults has a new parameter “Time_per_Ticks” that is used to convert ticks into actual microseconds if needed.
- Adjustments to mark and space to deal with overreporting and underreporting of intervals is now done once in IRrecvBase::GetResults eliminating the need for MATCH_MARK(d,v) and MATCH_SPACE(d,v). Just use MATCH(d,v) everywhere.
- Modified IRLibsendBase::mark() and IRLibsendBase::space() to overcome limitations of “delayMicroseconds()”.
- Changed many int to char or unsigned char to save memory
- Eliminated DEBUG macro in IRLib.h and its use elsewhere. Macro TRACE is more useful.
- Changed IRTYPES to unsigned char and a list of #defines rather than an enum (even though I still really like enums, changing it saves memory)
- Code changes result in memory savings of approximately 54 bytes in code space and 39 bytes of RAM.
For more information see my IRLib page.