Infrared remote library for Arduino: send and receive infrared signals with multiple protocols Port from Arduino-IRremote https://github.com/z3t0/Arduino-IRremote
ir_Dish.cpp@0:70c8e56bac45, 2016-01-23 (annotated)
- Committer:
- yuhki50
- Date:
- Sat Jan 23 06:16:48 2016 +0000
- Revision:
- 0:70c8e56bac45
import https://github.com/z3t0/Arduino-IRremote e3ec11d
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
yuhki50 | 0:70c8e56bac45 | 1 | #include "IRremote.h" |
yuhki50 | 0:70c8e56bac45 | 2 | #include "IRremoteInt.h" |
yuhki50 | 0:70c8e56bac45 | 3 | |
yuhki50 | 0:70c8e56bac45 | 4 | //============================================================================== |
yuhki50 | 0:70c8e56bac45 | 5 | // DDDD IIIII SSSS H H |
yuhki50 | 0:70c8e56bac45 | 6 | // D D I S H H |
yuhki50 | 0:70c8e56bac45 | 7 | // D D I SSS HHHHH |
yuhki50 | 0:70c8e56bac45 | 8 | // D D I S H H |
yuhki50 | 0:70c8e56bac45 | 9 | // DDDD IIIII SSSS H H |
yuhki50 | 0:70c8e56bac45 | 10 | //============================================================================== |
yuhki50 | 0:70c8e56bac45 | 11 | |
yuhki50 | 0:70c8e56bac45 | 12 | // Sharp and DISH support by Todd Treece ( http://unionbridge.org/design/ircommand ) |
yuhki50 | 0:70c8e56bac45 | 13 | // |
yuhki50 | 0:70c8e56bac45 | 14 | // The sned function needs to be repeated 4 times |
yuhki50 | 0:70c8e56bac45 | 15 | // |
yuhki50 | 0:70c8e56bac45 | 16 | // Only send the last for characters of the hex. |
yuhki50 | 0:70c8e56bac45 | 17 | // I.E. Use 0x1C10 instead of 0x0000000000001C10 as listed in the LIRC file. |
yuhki50 | 0:70c8e56bac45 | 18 | // |
yuhki50 | 0:70c8e56bac45 | 19 | // Here is the LIRC file I found that seems to match the remote codes from the |
yuhki50 | 0:70c8e56bac45 | 20 | // oscilloscope: |
yuhki50 | 0:70c8e56bac45 | 21 | // DISH NETWORK (echostar 301): |
yuhki50 | 0:70c8e56bac45 | 22 | // http://lirc.sourceforge.net/remotes/echostar/301_501_3100_5100_58xx_59xx |
yuhki50 | 0:70c8e56bac45 | 23 | |
yuhki50 | 0:70c8e56bac45 | 24 | #define DISH_BITS 16 |
yuhki50 | 0:70c8e56bac45 | 25 | #define DISH_HDR_MARK 400 |
yuhki50 | 0:70c8e56bac45 | 26 | #define DISH_HDR_SPACE 6100 |
yuhki50 | 0:70c8e56bac45 | 27 | #define DISH_BIT_MARK 400 |
yuhki50 | 0:70c8e56bac45 | 28 | #define DISH_ONE_SPACE 1700 |
yuhki50 | 0:70c8e56bac45 | 29 | #define DISH_ZERO_SPACE 2800 |
yuhki50 | 0:70c8e56bac45 | 30 | #define DISH_RPT_SPACE 6200 |
yuhki50 | 0:70c8e56bac45 | 31 | |
yuhki50 | 0:70c8e56bac45 | 32 | //+============================================================================= |
yuhki50 | 0:70c8e56bac45 | 33 | #if SEND_DISH |
yuhki50 | 0:70c8e56bac45 | 34 | void IRsend::sendDISH (unsigned long data, int nbits) |
yuhki50 | 0:70c8e56bac45 | 35 | { |
yuhki50 | 0:70c8e56bac45 | 36 | // Set IR carrier frequency |
yuhki50 | 0:70c8e56bac45 | 37 | enableIROut(56); |
yuhki50 | 0:70c8e56bac45 | 38 | |
yuhki50 | 0:70c8e56bac45 | 39 | mark(DISH_HDR_MARK); |
yuhki50 | 0:70c8e56bac45 | 40 | space(DISH_HDR_SPACE); |
yuhki50 | 0:70c8e56bac45 | 41 | |
yuhki50 | 0:70c8e56bac45 | 42 | for (unsigned long mask = 1UL << (nbits - 1); mask; mask >>= 1) { |
yuhki50 | 0:70c8e56bac45 | 43 | if (data & mask) { |
yuhki50 | 0:70c8e56bac45 | 44 | mark(DISH_BIT_MARK); |
yuhki50 | 0:70c8e56bac45 | 45 | space(DISH_ONE_SPACE); |
yuhki50 | 0:70c8e56bac45 | 46 | } else { |
yuhki50 | 0:70c8e56bac45 | 47 | mark(DISH_BIT_MARK); |
yuhki50 | 0:70c8e56bac45 | 48 | space(DISH_ZERO_SPACE); |
yuhki50 | 0:70c8e56bac45 | 49 | } |
yuhki50 | 0:70c8e56bac45 | 50 | } |
yuhki50 | 0:70c8e56bac45 | 51 | } |
yuhki50 | 0:70c8e56bac45 | 52 | #endif |
yuhki50 | 0:70c8e56bac45 | 53 |