Taguchi Yuuki / IRremote

Dependents:   Lilnija_29012017 NucleoF042K6_IRReceiver

Embed: (wiki syntax)

« Back to documentation index

Show/hide line numbers ir_Dish.cpp Source File

ir_Dish.cpp

00001 #include "IRremote.h"
00002 #include "IRremoteInt.h"
00003 
00004 //==============================================================================
00005 //                       DDDD   IIIII   SSSS  H   H
00006 //                        D  D    I    S      H   H
00007 //                        D  D    I     SSS   HHHHH
00008 //                        D  D    I        S  H   H
00009 //                       DDDD   IIIII  SSSS   H   H
00010 //==============================================================================
00011 
00012 // Sharp and DISH support by Todd Treece ( http://unionbridge.org/design/ircommand )
00013 //
00014 // The sned function needs to be repeated 4 times
00015 //
00016 // Only send the last for characters of the hex.
00017 // I.E.  Use 0x1C10 instead of 0x0000000000001C10 as listed in the LIRC file.
00018 //
00019 // Here is the LIRC file I found that seems to match the remote codes from the
00020 // oscilloscope:
00021 //   DISH NETWORK (echostar 301):
00022 //   http://lirc.sourceforge.net/remotes/echostar/301_501_3100_5100_58xx_59xx
00023 
00024 #define DISH_BITS          16
00025 #define DISH_HDR_MARK     400
00026 #define DISH_HDR_SPACE   6100
00027 #define DISH_BIT_MARK     400
00028 #define DISH_ONE_SPACE   1700
00029 #define DISH_ZERO_SPACE  2800
00030 #define DISH_RPT_SPACE   6200
00031 
00032 //+=============================================================================
00033 #if SEND_DISH
00034 void  IRsend::sendDISH (unsigned long data,  int nbits)
00035 {
00036     // Set IR carrier frequency
00037     enableIROut(56);
00038 
00039     mark(DISH_HDR_MARK);
00040     space(DISH_HDR_SPACE);
00041 
00042     for (unsigned long  mask = 1UL << (nbits - 1);  mask;  mask >>= 1) {
00043         if (data & mask) {
00044             mark(DISH_BIT_MARK);
00045             space(DISH_ONE_SPACE);
00046         } else {
00047             mark(DISH_BIT_MARK);
00048             space(DISH_ZERO_SPACE);
00049         }
00050     }
00051 }
00052 #endif
00053