PlatformIO package of the Teensy core framework compatible with GCC 10 & C++20
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

ir_Dish.cpp 1.7KB

3 vuotta sitten
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354
  1. #include "IRremote.h"
  2. #include "IRremoteInt.h"
  3. //==============================================================================
  4. // DDDD IIIII SSSS H H
  5. // D D I S H H
  6. // D D I SSS HHHHH
  7. // D D I S H H
  8. // DDDD IIIII SSSS H H
  9. //==============================================================================
  10. // Sharp and DISH support by Todd Treece ( http://unionbridge.org/design/ircommand )
  11. //
  12. // The sned function needs to be repeated 4 times
  13. //
  14. // Only send the last for characters of the hex.
  15. // I.E. Use 0x1C10 instead of 0x0000000000001C10 as listed in the LIRC file.
  16. //
  17. // Here is the LIRC file I found that seems to match the remote codes from the
  18. // oscilloscope:
  19. // DISH NETWORK (echostar 301):
  20. // http://lirc.sourceforge.net/remotes/echostar/301_501_3100_5100_58xx_59xx
  21. #define DISH_BITS 16
  22. #define DISH_HDR_MARK 400
  23. #define DISH_HDR_SPACE 6100
  24. #define DISH_BIT_MARK 400
  25. #define DISH_ONE_SPACE 1700
  26. #define DISH_ZERO_SPACE 2800
  27. #define DISH_RPT_SPACE 6200
  28. //+=============================================================================
  29. #if SEND_DISH
  30. void IRsend::sendDISH (unsigned long data, int nbits)
  31. {
  32. // Set IR carrier frequency
  33. enableIROut(56);
  34. mark(DISH_HDR_MARK);
  35. space(DISH_HDR_SPACE);
  36. for (unsigned long mask = 1UL << (nbits - 1); mask; mask >>= 1) {
  37. if (data & mask) {
  38. mark(DISH_BIT_MARK);
  39. space(DISH_ONE_SPACE);
  40. } else {
  41. mark(DISH_BIT_MARK);
  42. space(DISH_ZERO_SPACE);
  43. }
  44. }
  45. mark(DISH_HDR_MARK); //added 26th March 2016, by AnalysIR ( https://www.AnalysIR.com )
  46. }
  47. #endif