diff --git a/README.md b/README.md index 7acdafa..cd553a8 100644 --- a/README.md +++ b/README.md @@ -8,7 +8,7 @@ This is a Library for receiving and decoding IR signals from remote controls. Pe * [Main features](#main-features) * [Supported Protocols](#supported-protocols) * [Supported Boards](#supported-boards) -* [Connecting the IR sensor](#connecting-the-ir-sensor) +* [Connecting the IR receiver](#connecting-the-ir-receiver) * [Installing the library](#installing-the-library) * [Using the library](#using-the-library) * [Possible improvements](#possible-improvements) @@ -16,7 +16,7 @@ This is a Library for receiving and decoding IR signals from remote controls. Pe * [Contact information](#contact-information) * [License](#license) * [Appendix A - Details about this library](#appendix-a---details-about-this-library) -* [Appendix B - IR sensor connection details](#appendix-b---ir-sensor-connection-details) +* [Appendix B - IR receiver connection details](#appendix-b---ir-receiver-connection-details) ## Main features @@ -49,8 +49,8 @@ ATtiny 25/45/85/24/44/84 microcontrollers are supported. If you have problems with this library on some board, please submit an issue here: https://github.com/LuisMiCa/IRSmallDecoder/issues or [contact me](#contact-information). -## Connecting the IR sensor -The sensor's output must be connected to one of the Arduino's digital pin that is usable for interrupts and, also, it must work with the CHANGE mode if the intended protocol uses this mode. (One example of a board that does not have CHANGE mode on some of the interrupt pins is the Arduino 101; and one protocol that uses that mode is the [RC5](#speed)). +## Connecting the IR receiver +The receiver's output must be connected to one of the Arduino's digital pin that is usable for interrupts and, also, it must work with the CHANGE mode if the intended protocol uses this mode. (One example of a board that does not have CHANGE mode on some of the interrupt pins is the Arduino 101; and one protocol that uses that mode is the [RC5](#speed)). | Board or microcontroller | Usable digital pins numbers | |-------------------------------------|--------------------------------| @@ -70,7 +70,7 @@ The sensor's output must be connected to one of the Arduino's digital pin that i (Sources: ; and ) -If you're not sure about how to connect the IR Sensor to the Arduino, go to: [IR sensor connection details](#appendix-b---ir-sensor-connection-details) at the end of this document. +If you're not sure about how to connect the IR receiver to the Arduino, go to: [IR receiver connection details](#appendix-b---ir-receiver-connection-details) at the end of this document. ## Installing the library @@ -107,7 +107,7 @@ before the Then you need to create **one** decoder object with the correct interrupt pin: ```ino -IRsmallDecoder irDecoder(2); //IR sensor connected to pin 2 in this example +IRsmallDecoder irDecoder(2); //IR receiver connected to pin 2 in this example ``` And also a decoder data structure: @@ -432,16 +432,16 @@ In order to make this library compatible with most of the Arduino boards, I didn ---
-## Appendix B - IR sensor connection details +## Appendix B - IR receiver connection details -If you are using a simple IR Receiver module the pinout order will be, most likely, `Vout Gnd Vcc` like in the the following examples: +If you are using a simple IR receiver module the pinout order will be, most likely, `Vout Gnd Vcc` like in the the following examples: -| ![](extras/IRsensors/PIC12043S.jpg) | ![](extras/IRsensors/TSOP48xx.jpg) | +| ![](extras/IR%20receivers/PIC12043S.jpg) | ![](extras/IR%20receivers/TSOP48xx.jpg) | |-------------------------------------|------------------------------------| -But beware, there are other IR Receivers with different pinouts, like these examples: +But beware, there are other IR receivers with different pinouts, like these examples: -| ![](extras/IRsensors/TSOP17xx.jpg) | ![](extras/IRsensors/SFH505A.jpg) | +| ![](extras/IR%20receivers/TSOP17xx.jpg) | ![](extras/IR%20receivers/SFH505A.jpg) | |------------------------------------|-----------------------------------| @@ -451,7 +451,7 @@ But beware, there are other IR Receivers with different pinouts, like these exam written on it (sometimes it's
DAT or S instead of Vout). - +
@@ -461,13 +461,13 @@ The connection to the Arduino is very straightforward, just connect: - VCC to the Arduino's +5V or (+3.3V if you are using a board with lower operating voltage[2]); - GND to one of the Arduino's Ground connector. - [1] Go to [Connecting the IR sensor](#connecting-the-ir-sensor) for more information. - [2] Note that not all IR Sensors can operate at low voltages. + [1] Go to [Connecting the IR receiver](#connecting-the-ir-receiver) for more information. + [2] Note that not all IR receivers can operate at low voltages. -Nearly all IR Sensor's datashets recommend the usage of an RC filter (R1, C1) at the power input, but it's not really necessary, (it's meant to suppress power supply disturbances): +Nearly all IR receiver's datashets recommend the usage of an RC filter (R1, C1) at the power input, but it's not really necessary, (it's meant to suppress power supply disturbances): -![](extras/IRsensors/IR%20Receiver%20Connections.jpg) +![](extras/IR%20receivers/IR%20receiver%20connections.jpg) -Note that most IR Receiver Test Modules already have that RC filter. +Note that most IR receiver Test Modules already have that RC filter. diff --git a/examples/HelloNEC/HelloNEC.ino b/examples/HelloNEC/HelloNEC.ino index 3692462..eb598a1 100644 --- a/examples/HelloNEC/HelloNEC.ino +++ b/examples/HelloNEC/HelloNEC.ino @@ -3,7 +3,7 @@ * * Note: for the NEC extended protocol, just define IR_SMALLD_NECx instead of IR_SMALLD_NEC * - * In this example it's assumed that the IR sensor is connected to digital pin 2 and + * In this example it's assumed that the IR receiver is connected to digital pin 2 and * the pin is usable for external interrupts. * * For more information on the boards' usable pins, see the library documentation at: diff --git a/examples/HelloRC5/HelloRC5.ino b/examples/HelloRC5/HelloRC5.ino index 05b8255..6485d52 100644 --- a/examples/HelloRC5/HelloRC5.ino +++ b/examples/HelloRC5/HelloRC5.ino @@ -3,7 +3,7 @@ * * Note: this works for both RC5 and RC5 extended. * - * In this example it's assumed that the IR sensor is connected to digital pin 2 and + * In this example it's assumed that the IR receiver is connected to digital pin 2 and * the pin is usable for external interrupts (that work with the CHANGE mode). * * For more information on the boards' usable pins, see the library documentation at: diff --git a/examples/HelloSAMSUNG/HelloSAMSUNG.ino b/examples/HelloSAMSUNG/HelloSAMSUNG.ino index 8458ee9..1d78ab0 100644 --- a/examples/HelloSAMSUNG/HelloSAMSUNG.ino +++ b/examples/HelloSAMSUNG/HelloSAMSUNG.ino @@ -8,7 +8,7 @@ * - The SAMSUNG32 protocol corresponds to the standard described in this application note: * http://elektrolab.wz.cz/katalog/samsung_protocol.pdf * - * In this example it's assumed that the IR sensor is connected to digital pin 2 and + * In this example it's assumed that the IR receiver is connected to digital pin 2 and * the pin is usable for external interrupts. * * For more information on the boards' usable pins, see the library documentation at: diff --git a/examples/HelloSIRC/HelloSIRC.ino b/examples/HelloSIRC/HelloSIRC.ino index 74142d3..27d1370 100644 --- a/examples/HelloSIRC/HelloSIRC.ino +++ b/examples/HelloSIRC/HelloSIRC.ino @@ -13,7 +13,7 @@ * If the decoder detects 12 or 15 bits, the ext data member is set to 0. * If it detects a 20-bit code, it will save the extended data in the ext member. * - * In this example it's assumed that the IR sensor is connected to digital pin 2 and + * In this example it's assumed that the IR receiver is connected to digital pin 2 and * the pin is usable for external interrupts. * * For more information on the boards' usable pins, see the library documentation at: diff --git a/examples/HelloSIRCbasic/HelloSIRCbasic.ino b/examples/HelloSIRCbasic/HelloSIRCbasic.ino index 9e79e9b..b91ddfa 100644 --- a/examples/HelloSIRCbasic/HelloSIRCbasic.ino +++ b/examples/HelloSIRCbasic/HelloSIRCbasic.ino @@ -9,7 +9,7 @@ * - IR_SMALLD_SIRC12 will receive signals from SIRC15 and SIRC20, but the codes will not be correct; * - In a similar way, IR_SMALLD_SIRC15 will receive signals from SIRC20, but not from SIRC12. * - * In this example it's assumed that the IR sensor is connected to digital pin 2 and + * In this example it's assumed that the IR receiver is connected to digital pin 2 and * the pin is usable for external interrupts. * * For more information on the boards' usable pins, see the library documentation at: diff --git a/examples/KeyHeldNEC/KeyHeldNEC.ino b/examples/KeyHeldNEC/KeyHeldNEC.ino index 6ca7cbf..cf27494 100644 --- a/examples/KeyHeldNEC/KeyHeldNEC.ino +++ b/examples/KeyHeldNEC/KeyHeldNEC.ino @@ -4,17 +4,17 @@ * a possible usage for the keyHeld data member. * * How to use this sketch: - * - Connect the sensor (see library documentation); + * - Connect the IR receiver (see library documentation); * - Upload the sketch and open the Serial Monitor; * - "Teach the Arduino" which keys you want to use to increase or decrease a value: - * point the NEC remote to the IR sensor and press any key of your choosing then press a different key; + * point the NEC remote to the receiver and press any key of your choosing then press a different key; * - Use the selected keys to increase/decrease the value, one unit at a time for each keypress, * or, if you hold the key: * 1 unit for each of the first 9 repeat codes; * 5 units for each of the next 18 repeat codes; * 25 units for each of the subsequent repeat codes. * - * In this example it's assumed that the IR sensor is connected to digital pin 2 and + * In this example it's assumed that the IR receiver is connected to digital pin 2 and * the pin is usable for external interrupts. * * For more information on the boards' usable pins, see the library documentation at: @@ -24,7 +24,7 @@ #define IR_SMALLD_NEC #include -IRsmallDecoder irDecoder(2); //assuming that the IR sensor is connected to digital pin 2 +IRsmallDecoder irDecoder(2); //assuming that the IR receiver is connected to digital pin 2 irSmallD_t irData; int value = 0; diff --git a/examples/SingleHold/SingleHold.ino b/examples/SingleHold/SingleHold.ino index 3922f1f..4df2100 100644 --- a/examples/SingleHold/SingleHold.ino +++ b/examples/SingleHold/SingleHold.ino @@ -4,7 +4,7 @@ * a possible usage for the keyHeld data member. * * How to use this sketch: - * - Connect the sensor (see library documentation); + * - Connect the IR receiver (see library documentation); * - Uncomment the #define for the desired protocol, * (leave the others as comments, only one is allowed); * - Upload the sketch and open the Serial Monitor; @@ -12,7 +12,7 @@ * - Hold the selected keys to turn on/off the built-in LED. * If you keep holding, it won't do anything else. * - * In this example it's assumed that the board has a builtin LED and the IR sensor is + * In this example it's assumed that the board has a builtin LED and the IR receiver is * connected to digital pin 2, which must be usable for external interrupts. * * For more information on the boards' usable pins, see the library documentation at: @@ -29,7 +29,7 @@ #include -IRsmallDecoder irDecoder(2); //assuming that the IR sensor is connected to digital pin 2 +IRsmallDecoder irDecoder(2); //assuming that the IR receiver is connected to digital pin 2 irSmallD_t irData; int keyOn, keyOff; bool keyReleased = true; diff --git a/examples/TemporaryDisable/TemporaryDisable.ino b/examples/TemporaryDisable/TemporaryDisable.ino index 21b2892..e9e91a7 100644 --- a/examples/TemporaryDisable/TemporaryDisable.ino +++ b/examples/TemporaryDisable/TemporaryDisable.ino @@ -4,7 +4,7 @@ * a possible usage for the enable and disable methods of the decoder. * * How to use this sketch: - * - Connect the sensor (see library documentation); + * - Connect the IR receiver (see library documentation); * - Uncomment the #define for the desired protocol, * (leave the others as comments, only one is allowed); * - Upload the sketch and open the Serial Monitor; @@ -12,7 +12,7 @@ * - The selected key will temporarily disable the decoder; * - Any other key on the remote will toggle the builtin LED; * - * In this example it's assumed that the board has a builtin LED and the IR sensor is + * In this example it's assumed that the board has a builtin LED and the IR receiver is * connected to digital pin 2, which must be usable for external interrupts. * * For more information on the boards' usable pins, see the library documentation at: @@ -33,7 +33,7 @@ #include #define TIMEOUT 8 -IRsmallDecoder irDecoder(2); //assuming that the IR sensor is connected to digital pin 2 +IRsmallDecoder irDecoder(2); //assuming that the IR receiver is connected to digital pin 2 irSmallD_t irData; int ledState = LOW; int keyDisable; diff --git a/examples/ToggleLED/ToggleLED.ino b/examples/ToggleLED/ToggleLED.ino index 616d586..27f5824 100644 --- a/examples/ToggleLED/ToggleLED.ino +++ b/examples/ToggleLED/ToggleLED.ino @@ -3,10 +3,10 @@ * How to use this sketch: * - Uncomment the #define for the desired protocol, * leave the others as comments (only one is allowed). - * - Upload to the Arduino board, connect the IR sensor and + * - Upload to the Arduino board, connect the IR receiver and * - press any key on the remote to toggle the builtin LED * - * In this example it's assumed that the board has a builtin LED and the IR sensor is + * In this example it's assumed that the board has a builtin LED and the IR receiver is * connected to digital pin 2, which must be usable for external interrupts. * * For more information on the boards' usable pins, see the library documentation at: @@ -26,7 +26,7 @@ #include -IRsmallDecoder irDecoder(2); //assuming that the IR sensor is connected to digital pin 2 +IRsmallDecoder irDecoder(2); //assuming that the IR receiver is connected to digital pin 2 int ledState = LOW; void setup() { diff --git a/extras/IRsensors/IR Receiver Connections.jpg b/extras/IR receivers/IR receiver connections.jpg similarity index 100% rename from extras/IRsensors/IR Receiver Connections.jpg rename to extras/IR receivers/IR receiver connections.jpg diff --git a/extras/IRsensors/IRModule.jpg b/extras/IR receivers/IRModule.jpg similarity index 100% rename from extras/IRsensors/IRModule.jpg rename to extras/IR receivers/IRModule.jpg diff --git a/extras/IRsensors/IRModuleS.jpg b/extras/IR receivers/IRModuleS.jpg similarity index 100% rename from extras/IRsensors/IRModuleS.jpg rename to extras/IR receivers/IRModuleS.jpg diff --git a/extras/IRsensors/PIC12043S.jpg b/extras/IR receivers/PIC12043S.jpg similarity index 100% rename from extras/IRsensors/PIC12043S.jpg rename to extras/IR receivers/PIC12043S.jpg diff --git a/extras/IRsensors/SFH505A.jpg b/extras/IR receivers/SFH505A.jpg similarity index 100% rename from extras/IRsensors/SFH505A.jpg rename to extras/IR receivers/SFH505A.jpg diff --git a/extras/IRsensors/TSOP17xx.jpg b/extras/IR receivers/TSOP17xx.jpg similarity index 100% rename from extras/IRsensors/TSOP17xx.jpg rename to extras/IR receivers/TSOP17xx.jpg diff --git a/extras/IRsensors/TSOP48xx.jpg b/extras/IR receivers/TSOP48xx.jpg similarity index 100% rename from extras/IRsensors/TSOP48xx.jpg rename to extras/IR receivers/TSOP48xx.jpg diff --git a/src/IRsmallD_NEC.h b/src/IRsmallD_NEC.h index 34e213f..264ecc6 100644 --- a/src/IRsmallD_NEC.h +++ b/src/IRsmallD_NEC.h @@ -36,7 +36,7 @@ */ -void IRsmallDecoder::irISR() { //executed every time the IR signal goes up (but it's actually FALLING @ SensorOutput) +void IRsmallDecoder::irISR() { //executed every time the IR signal goes up (but it's actually FALLING @ ReceiverOutput) // NEC timings in micro seconds: // Minimum Gap length = repeatPeriod - SignalFrame = 108000 - 67500 = 40500 const uint16_t c_GapMin = 32400; // = 40500 * 0.8 (20% less) diff --git a/src/IRsmallD_SAMSUNG.h b/src/IRsmallD_SAMSUNG.h index 218ee64..8c9f59b 100644 --- a/src/IRsmallD_SAMSUNG.h +++ b/src/IRsmallD_SAMSUNG.h @@ -39,7 +39,7 @@ #define STOP_SPACE_MAX 27938 //27937.5 to be more precise -void IRsmallDecoder::irISR() { //executed every time the IR signal goes UP (but it's actually FALLING @ SensorOutput) +void IRsmallDecoder::irISR() { //executed every time the IR signal goes UP (but it's actually FALLING @ ReceiverOutput) // SAMSUNG timing thresholds: const uint16_t c_LMmax = LEADING_MARK * 1.1; // 10% more = 9900 const uint16_t c_LMmin = LEADING_MARK * 0.9; // 10% less = 8100 diff --git a/src/IRsmallD_SAMSUNG32.h b/src/IRsmallD_SAMSUNG32.h index c830e7c..159a69b 100644 --- a/src/IRsmallD_SAMSUNG32.h +++ b/src/IRsmallD_SAMSUNG32.h @@ -35,7 +35,7 @@ #define STOP_SPACE_MAX 72563 //72562.5 to be more precise -void IRsmallDecoder::irISR() { //executed every time the IR signal goes UP (but it's actually FALLING @ SensorOutput) +void IRsmallDecoder::irISR() { //executed every time the IR signal goes UP (but it's actually FALLING @ ReceiverOutput) // SAMSUNG32 timing thresholds: const uint16_t c_LMmax = LEADING_MARK * 1.1; // 10% more = 9900 const uint16_t c_LMmin = LEADING_MARK * 0.9; // 10% less = 8100 diff --git a/src/IRsmallD_SIRC_basic.h b/src/IRsmallD_SIRC_basic.h index 537120b..6020102 100644 --- a/src/IRsmallD_SIRC_basic.h +++ b/src/IRsmallD_SIRC_basic.h @@ -45,7 +45,7 @@ */ -void IRsmallDecoder::irISR() { //executed every time the IR signal goes down (but it's actually RISING @ SensorOutput) +void IRsmallDecoder::irISR() { //executed every time the IR signal goes down (but it's actually RISING @ ReceiverOutput) #if defined(IR_SMALLD_SIRC12) //Conditional code inclusion (at compile time) const uint8_t c_NumberOfBits = 12; #elif defined(IR_SMALLD_SIRC15) diff --git a/src/IRsmallD_SIRC_multi.h b/src/IRsmallD_SIRC_multi.h index 6f02e07..58423cb 100644 --- a/src/IRsmallD_SIRC_multi.h +++ b/src/IRsmallD_SIRC_multi.h @@ -42,7 +42,7 @@ */ -void IRsmallDecoder::irISR() { //executed every time the IR signal goes down (but it's actually RISING @ SensorOutput) +void IRsmallDecoder::irISR() { //executed every time the IR signal goes down (but it's actually RISING @ ReceiverOutput) // SIRC timings' thresholds in micro secs: //Minimum standard Gap length = (75-(4+3*20))*600 --> assuming 20 bit 1s, which has the smallest gapMin //Maximum standard Gap length = (75-(4+2*12))*600 --> assuming 12 bit 0s, which has the biggest gapMax diff --git a/src/IRsmallDecoder.h b/src/IRsmallDecoder.h index 26576ed..b88efeb 100644 --- a/src/IRsmallDecoder.h +++ b/src/IRsmallDecoder.h @@ -90,7 +90,7 @@ bool IRsmallDecoder::_irCopyingData = false; //to avoid volatile _irData corrup /** * IRsmallDecoder object costructor * - * @param interruptPin is the digital pin where the IR sensor is connected. That pin must be is usable for external interrupts + * @param interruptPin is the digital pin where the IR receiver is connected. That pin must be is usable for external interrupts */ IRsmallDecoder::IRsmallDecoder(uint8_t interruptPin) { pinMode(interruptPin,INPUT_PULLUP); //active low