Created
April 19, 2017 06:56
-
-
Save bengtmartensson/71a675942d645f87d6c10c455a862cc2 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// This Arduino sketch was automatically generated by IrScrutinizer. | |
// It supports: | |
// | |
// * IRremote https://github.com/z3t0/Arduino-IRremote | |
// http://z3t0.github.io/Arduino-IRremote/ | |
// * IRLib https://github.com/cyborg5/IRLib | |
// * Infrared4Arduino https://github.com/bengtmartensson/Infrared4Arduino, | |
// http://www.harctoolbox.org/Infrared4Arduino.html (planned) | |
// For problems, bugs, and suggestions, please open an issue at | |
// https://github.com/bengtmartensson/harctoolboxbundle/issues | |
// This file contains C identifiers which have been translated from command names. | |
// Define exactly one of these | |
#define IRREMOTE | |
// #define IRLIB | |
// #define INFRARED4ARDUINO | |
///////////////////////////////////////////////////// | |
// Sanity check | |
#if defined(IRREMOTE) & ( defined(IRLIB) | defined(INFRARED4ARDUINO) ) | |
#error Must define only one of IRREMOTE, IRLIB, or INFRARED4ARDUINO | |
#endif | |
#if defined(IRLIB) & ( defined(IRREMOTE) | defined(INFRARED4ARDUINO) ) | |
#error Must define only one of IRREMOTE, IRLIB, or INFRARED4ARDUINO | |
#endif | |
#if defined(INFRARED4ARDUINO) & ( defined(IRLIB) | defined(IRREMOTE) ) | |
#error Must define only one of IRREMOTE, IRLIB, or INFRARED4ARDUINO | |
#endif | |
#ifdef IRREMOTE | |
#include <IRremote.h> | |
#elif defined(IRLIB) | |
#include <IRLib.h> | |
#define sendRaw send | |
#elif defined(INFRARED4ARDUINO) | |
#include <IrSenderPwm.h> | |
#else | |
#error Must defined one of IRREMOTE, IRLIB, or INFRARED4ARDUINO | |
#endif | |
#if defined(IRREMOTE) | defined(IRLIB) | |
typedef uint16_t microseconds_t; // Change if desired | |
typedef uint16_t frequency_t; // Change if desired | |
static inline unsigned hz2khz(frequency_t f) { return f/1000U; } | |
#endif | |
// Constants | |
static const long BAUD = 115200UL; // Change if desired | |
// Global variables | |
#ifdef IRREMOTE | |
IRsend irsend; | |
#elif defined(IRLIB) | |
IRsendRaw irsend; | |
#else | |
IrSender *irsend = IrSenderPwm::getInstance(true); | |
#endif | |
// Command #1: ANTENNA | |
// Protocol: rca, Parameters: D=15 F=5 | |
const microseconds_t repeat_ANTENNA[] PROGMEM = { 3680U, 3680U, 460U, 1840U, 460U, 1840U, 460U, 1840U, 460U, 1840U, 460U, 920U, 460U, 920U, 460U, 920U, 460U, 920U, 460U, 920U, 460U, 1840U, 460U, 920U, 460U, 1840U, 460U, 920U, 460U, 920U, 460U, 920U, 460U, 920U, 460U, 1840U, 460U, 1840U, 460U, 1840U, 460U, 1840U, 460U, 1840U, 460U, 920U, 460U, 1840U, 460U, 920U, 460U, 7360 }; | |
// Command #2: CLEAR | |
// Protocol: rca, Parameters: D=15 F=6 | |
const microseconds_t repeat_CLEAR[] PROGMEM = { 3680U, 3680U, 460U, 1840U, 460U, 1840U, 460U, 1840U, 460U, 1840U, 460U, 920U, 460U, 920U, 460U, 920U, 460U, 920U, 460U, 920U, 460U, 1840U, 460U, 1840U, 460U, 920U, 460U, 920U, 460U, 920U, 460U, 920U, 460U, 920U, 460U, 1840U, 460U, 1840U, 460U, 1840U, 460U, 1840U, 460U, 1840U, 460U, 920U, 460U, 920U, 460U, 1840U, 460U, 7360 }; | |
// Command #3: MENU | |
// Protocol: rca, Parameters: D=15 F=8 | |
const microseconds_t repeat_MENU[] PROGMEM = { 3680U, 3680U, 460U, 1840U, 460U, 1840U, 460U, 1840U, 460U, 1840U, 460U, 920U, 460U, 920U, 460U, 920U, 460U, 920U, 460U, 1840U, 460U, 920U, 460U, 920U, 460U, 920U, 460U, 920U, 460U, 920U, 460U, 920U, 460U, 920U, 460U, 1840U, 460U, 1840U, 460U, 1840U, 460U, 1840U, 460U, 920U, 460U, 1840U, 460U, 1840U, 460U, 1840U, 460U, 7360 }; | |
// Command #4: REC*VCR+ | |
// Protocol: rca, Parameters: D=15 F=23 | |
const microseconds_t repeat_REC_VCR_[] PROGMEM = { 3680U, 3680U, 460U, 1840U, 460U, 1840U, 460U, 1840U, 460U, 1840U, 460U, 920U, 460U, 920U, 460U, 920U, 460U, 1840U, 460U, 920U, 460U, 1840U, 460U, 1840U, 460U, 1840U, 460U, 920U, 460U, 920U, 460U, 920U, 460U, 920U, 460U, 1840U, 460U, 1840U, 460U, 1840U, 460U, 920U, 460U, 1840U, 460U, 920U, 460U, 920U, 460U, 920U, 460U, 7360 }; | |
// Command #5: GUIDE | |
// Protocol: rca, Parameters: D=15 F=26 | |
const microseconds_t repeat_GUIDE[] PROGMEM = { 3680U, 3680U, 460U, 1840U, 460U, 1840U, 460U, 1840U, 460U, 1840U, 460U, 920U, 460U, 920U, 460U, 920U, 460U, 1840U, 460U, 1840U, 460U, 920U, 460U, 1840U, 460U, 920U, 460U, 920U, 460U, 920U, 460U, 920U, 460U, 920U, 460U, 1840U, 460U, 1840U, 460U, 1840U, 460U, 920U, 460U, 920U, 460U, 1840U, 460U, 920U, 460U, 1840U, 460U, 7360 }; | |
// Command #6: CHANNEL - PREVIOUS | |
// Protocol: rca, Parameters: D=15 F=39 | |
const microseconds_t repeat_CHANNEL___PREVIOUS[] PROGMEM = { 3680U, 3680U, 460U, 1840U, 460U, 1840U, 460U, 1840U, 460U, 1840U, 460U, 920U, 460U, 920U, 460U, 1840U, 460U, 920U, 460U, 920U, 460U, 1840U, 460U, 1840U, 460U, 1840U, 460U, 920U, 460U, 920U, 460U, 920U, 460U, 920U, 460U, 1840U, 460U, 1840U, 460U, 920U, 460U, 1840U, 460U, 1840U, 460U, 920U, 460U, 920U, 460U, 920U, 460U, 7360 }; | |
// Command #7: POWER | |
// Protocol: rca, Parameters: D=15 F=42 | |
const microseconds_t repeat_POWER[] PROGMEM = { 3680U, 3680U, 460U, 1840U, 460U, 1840U, 460U, 1840U, 460U, 1840U, 460U, 920U, 460U, 920U, 460U, 1840U, 460U, 920U, 460U, 1840U, 460U, 920U, 460U, 1840U, 460U, 920U, 460U, 920U, 460U, 920U, 460U, 920U, 460U, 920U, 460U, 1840U, 460U, 1840U, 460U, 920U, 460U, 1840U, 460U, 920U, 460U, 1840U, 460U, 920U, 460U, 1840U, 460U, 7360 }; | |
// Command #8: CHANNEL - DOWN | |
// Protocol: rca, Parameters: D=15 F=44 | |
const microseconds_t repeat_CHANNEL___DOWN[] PROGMEM = { 3680U, 3680U, 460U, 1840U, 460U, 1840U, 460U, 1840U, 460U, 1840U, 460U, 920U, 460U, 920U, 460U, 1840U, 460U, 920U, 460U, 1840U, 460U, 1840U, 460U, 920U, 460U, 920U, 460U, 920U, 460U, 920U, 460U, 920U, 460U, 920U, 460U, 1840U, 460U, 1840U, 460U, 920U, 460U, 1840U, 460U, 920U, 460U, 920U, 460U, 1840U, 460U, 1840U, 460U, 7360 }; | |
// Command #9: CHANNEL - UP | |
// Protocol: rca, Parameters: D=15 F=45 | |
const microseconds_t repeat_CHANNEL___UP[] PROGMEM = { 3680U, 3680U, 460U, 1840U, 460U, 1840U, 460U, 1840U, 460U, 1840U, 460U, 920U, 460U, 920U, 460U, 1840U, 460U, 920U, 460U, 1840U, 460U, 1840U, 460U, 920U, 460U, 1840U, 460U, 920U, 460U, 920U, 460U, 920U, 460U, 920U, 460U, 1840U, 460U, 1840U, 460U, 920U, 460U, 1840U, 460U, 920U, 460U, 920U, 460U, 1840U, 460U, 920U, 460U, 7360 }; | |
// Command #10: VOLUME - DOWN | |
// Protocol: rca, Parameters: D=15 F=46 | |
const microseconds_t repeat_VOLUME___DOWN[] PROGMEM = { 3680U, 3680U, 460U, 1840U, 460U, 1840U, 460U, 1840U, 460U, 1840U, 460U, 920U, 460U, 920U, 460U, 1840U, 460U, 920U, 460U, 1840U, 460U, 1840U, 460U, 1840U, 460U, 920U, 460U, 920U, 460U, 920U, 460U, 920U, 460U, 920U, 460U, 1840U, 460U, 1840U, 460U, 920U, 460U, 1840U, 460U, 920U, 460U, 920U, 460U, 920U, 460U, 1840U, 460U, 7360 }; | |
// Command #11: VOLUME - UP | |
// Protocol: rca, Parameters: D=15 F=47 | |
const microseconds_t repeat_VOLUME___UP[] PROGMEM = { 3680U, 3680U, 460U, 1840U, 460U, 1840U, 460U, 1840U, 460U, 1840U, 460U, 920U, 460U, 920U, 460U, 1840U, 460U, 920U, 460U, 1840U, 460U, 1840U, 460U, 1840U, 460U, 1840U, 460U, 920U, 460U, 920U, 460U, 920U, 460U, 920U, 460U, 1840U, 460U, 1840U, 460U, 920U, 460U, 1840U, 460U, 920U, 460U, 920U, 460U, 920U, 460U, 920U, 460U, 7360 }; | |
// Command #12: 0 | |
// Protocol: rca, Parameters: D=15 F=48 | |
const microseconds_t repeat__0[] PROGMEM = { 3680U, 3680U, 460U, 1840U, 460U, 1840U, 460U, 1840U, 460U, 1840U, 460U, 920U, 460U, 920U, 460U, 1840U, 460U, 1840U, 460U, 920U, 460U, 920U, 460U, 920U, 460U, 920U, 460U, 920U, 460U, 920U, 460U, 920U, 460U, 920U, 460U, 1840U, 460U, 1840U, 460U, 920U, 460U, 920U, 460U, 1840U, 460U, 1840U, 460U, 1840U, 460U, 1840U, 460U, 7360 }; | |
// Command #13: 1 | |
// Protocol: rca, Parameters: D=15 F=49 | |
const microseconds_t repeat__1[] PROGMEM = { 3680U, 3680U, 460U, 1840U, 460U, 1840U, 460U, 1840U, 460U, 1840U, 460U, 920U, 460U, 920U, 460U, 1840U, 460U, 1840U, 460U, 920U, 460U, 920U, 460U, 920U, 460U, 1840U, 460U, 920U, 460U, 920U, 460U, 920U, 460U, 920U, 460U, 1840U, 460U, 1840U, 460U, 920U, 460U, 920U, 460U, 1840U, 460U, 1840U, 460U, 1840U, 460U, 920U, 460U, 7360 }; | |
// Command #14: 2 | |
// Protocol: rca, Parameters: D=15 F=50 | |
const microseconds_t repeat__2[] PROGMEM = { 3680U, 3680U, 460U, 1840U, 460U, 1840U, 460U, 1840U, 460U, 1840U, 460U, 920U, 460U, 920U, 460U, 1840U, 460U, 1840U, 460U, 920U, 460U, 920U, 460U, 1840U, 460U, 920U, 460U, 920U, 460U, 920U, 460U, 920U, 460U, 920U, 460U, 1840U, 460U, 1840U, 460U, 920U, 460U, 920U, 460U, 1840U, 460U, 1840U, 460U, 920U, 460U, 1840U, 460U, 7360 }; | |
// Command #15: 3 | |
// Protocol: rca, Parameters: D=15 F=51 | |
const microseconds_t repeat__3[] PROGMEM = { 3680U, 3680U, 460U, 1840U, 460U, 1840U, 460U, 1840U, 460U, 1840U, 460U, 920U, 460U, 920U, 460U, 1840U, 460U, 1840U, 460U, 920U, 460U, 920U, 460U, 1840U, 460U, 1840U, 460U, 920U, 460U, 920U, 460U, 920U, 460U, 920U, 460U, 1840U, 460U, 1840U, 460U, 920U, 460U, 920U, 460U, 1840U, 460U, 1840U, 460U, 920U, 460U, 920U, 460U, 7360 }; | |
// Command #16: 4 | |
// Protocol: rca, Parameters: D=15 F=52 | |
const microseconds_t repeat__4[] PROGMEM = { 3680U, 3680U, 460U, 1840U, 460U, 1840U, 460U, 1840U, 460U, 1840U, 460U, 920U, 460U, 920U, 460U, 1840U, 460U, 1840U, 460U, 920U, 460U, 1840U, 460U, 920U, 460U, 920U, 460U, 920U, 460U, 920U, 460U, 920U, 460U, 920U, 460U, 1840U, 460U, 1840U, 460U, 920U, 460U, 920U, 460U, 1840U, 460U, 920U, 460U, 1840U, 460U, 1840U, 460U, 7360 }; | |
// Command #17: 5 | |
// Protocol: rca, Parameters: D=15 F=53 | |
const microseconds_t repeat__5[] PROGMEM = { 3680U, 3680U, 460U, 1840U, 460U, 1840U, 460U, 1840U, 460U, 1840U, 460U, 920U, 460U, 920U, 460U, 1840U, 460U, 1840U, 460U, 920U, 460U, 1840U, 460U, 920U, 460U, 1840U, 460U, 920U, 460U, 920U, 460U, 920U, 460U, 920U, 460U, 1840U, 460U, 1840U, 460U, 920U, 460U, 920U, 460U, 1840U, 460U, 920U, 460U, 1840U, 460U, 920U, 460U, 7360 }; | |
// Command #18: 6 | |
// Protocol: rca, Parameters: D=15 F=54 | |
const microseconds_t repeat__6[] PROGMEM = { 3680U, 3680U, 460U, 1840U, 460U, 1840U, 460U, 1840U, 460U, 1840U, 460U, 920U, 460U, 920U, 460U, 1840U, 460U, 1840U, 460U, 920U, 460U, 1840U, 460U, 1840U, 460U, 920U, 460U, 920U, 460U, 920U, 460U, 920U, 460U, 920U, 460U, 1840U, 460U, 1840U, 460U, 920U, 460U, 920U, 460U, 1840U, 460U, 920U, 460U, 920U, 460U, 1840U, 460U, 7360 }; | |
// Command #19: 7 | |
// Protocol: rca, Parameters: D=15 F=55 | |
const microseconds_t repeat__7[] PROGMEM = { 3680U, 3680U, 460U, 1840U, 460U, 1840U, 460U, 1840U, 460U, 1840U, 460U, 920U, 460U, 920U, 460U, 1840U, 460U, 1840U, 460U, 920U, 460U, 1840U, 460U, 1840U, 460U, 1840U, 460U, 920U, 460U, 920U, 460U, 920U, 460U, 920U, 460U, 1840U, 460U, 1840U, 460U, 920U, 460U, 920U, 460U, 1840U, 460U, 920U, 460U, 920U, 460U, 920U, 460U, 7360 }; | |
// Command #20: 8 | |
// Protocol: rca, Parameters: D=15 F=56 | |
const microseconds_t repeat__8[] PROGMEM = { 3680U, 3680U, 460U, 1840U, 460U, 1840U, 460U, 1840U, 460U, 1840U, 460U, 920U, 460U, 920U, 460U, 1840U, 460U, 1840U, 460U, 1840U, 460U, 920U, 460U, 920U, 460U, 920U, 460U, 920U, 460U, 920U, 460U, 920U, 460U, 920U, 460U, 1840U, 460U, 1840U, 460U, 920U, 460U, 920U, 460U, 920U, 460U, 1840U, 460U, 1840U, 460U, 1840U, 460U, 7360 }; | |
// Command #21: 9 | |
// Protocol: rca, Parameters: D=15 F=57 | |
const microseconds_t repeat__9[] PROGMEM = { 3680U, 3680U, 460U, 1840U, 460U, 1840U, 460U, 1840U, 460U, 1840U, 460U, 920U, 460U, 920U, 460U, 1840U, 460U, 1840U, 460U, 1840U, 460U, 920U, 460U, 920U, 460U, 1840U, 460U, 920U, 460U, 920U, 460U, 920U, 460U, 920U, 460U, 1840U, 460U, 1840U, 460U, 920U, 460U, 920U, 460U, 920U, 460U, 1840U, 460U, 1840U, 460U, 920U, 460U, 7360 }; | |
// Command #22: POWER ON | |
// Protocol: rca, Parameters: D=15 F=58 | |
const microseconds_t repeat_POWER_ON[] PROGMEM = { 3680U, 3680U, 460U, 1840U, 460U, 1840U, 460U, 1840U, 460U, 1840U, 460U, 920U, 460U, 920U, 460U, 1840U, 460U, 1840U, 460U, 1840U, 460U, 920U, 460U, 1840U, 460U, 920U, 460U, 920U, 460U, 920U, 460U, 920U, 460U, 920U, 460U, 1840U, 460U, 1840U, 460U, 920U, 460U, 920U, 460U, 920U, 460U, 1840U, 460U, 920U, 460U, 1840U, 460U, 7360 }; | |
// Command #23: POWER OFF | |
// Protocol: rca, Parameters: D=15 F=59 | |
const microseconds_t repeat_POWER_OFF[] PROGMEM = { 3680U, 3680U, 460U, 1840U, 460U, 1840U, 460U, 1840U, 460U, 1840U, 460U, 920U, 460U, 920U, 460U, 1840U, 460U, 1840U, 460U, 1840U, 460U, 920U, 460U, 1840U, 460U, 1840U, 460U, 920U, 460U, 920U, 460U, 920U, 460U, 920U, 460U, 1840U, 460U, 1840U, 460U, 920U, 460U, 920U, 460U, 920U, 460U, 1840U, 460U, 920U, 460U, 920U, 460U, 7360 }; | |
// Command #24: INFO | |
// Protocol: rca, Parameters: D=15 F=60 | |
const microseconds_t repeat_INFO[] PROGMEM = { 3680U, 3680U, 460U, 1840U, 460U, 1840U, 460U, 1840U, 460U, 1840U, 460U, 920U, 460U, 920U, 460U, 1840U, 460U, 1840U, 460U, 1840U, 460U, 1840U, 460U, 920U, 460U, 920U, 460U, 920U, 460U, 920U, 460U, 920U, 460U, 920U, 460U, 1840U, 460U, 1840U, 460U, 920U, 460U, 920U, 460U, 920U, 460U, 920U, 460U, 1840U, 460U, 1840U, 460U, 7360 }; | |
// Command #25: VOLUME - MUTE | |
// Protocol: rca, Parameters: D=15 F=63 | |
const microseconds_t repeat_VOLUME___MUTE[] PROGMEM = { 3680U, 3680U, 460U, 1840U, 460U, 1840U, 460U, 1840U, 460U, 1840U, 460U, 920U, 460U, 920U, 460U, 1840U, 460U, 1840U, 460U, 1840U, 460U, 1840U, 460U, 1840U, 460U, 1840U, 460U, 920U, 460U, 920U, 460U, 920U, 460U, 920U, 460U, 1840U, 460U, 1840U, 460U, 920U, 460U, 920U, 460U, 920U, 460U, 920U, 460U, 920U, 460U, 920U, 460U, 7360 }; | |
// Command #26: SKIP | |
// Protocol: rca, Parameters: D=15 F=83 | |
const microseconds_t repeat_SKIP[] PROGMEM = { 3680U, 3680U, 460U, 1840U, 460U, 1840U, 460U, 1840U, 460U, 1840U, 460U, 920U, 460U, 1840U, 460U, 920U, 460U, 1840U, 460U, 920U, 460U, 920U, 460U, 1840U, 460U, 1840U, 460U, 920U, 460U, 920U, 460U, 920U, 460U, 920U, 460U, 1840U, 460U, 920U, 460U, 1840U, 460U, 920U, 460U, 1840U, 460U, 1840U, 460U, 920U, 460U, 920U, 460U, 7360 }; | |
// Command #27: CURSOR - LEFT | |
// Protocol: rca, Parameters: D=15 F=86 | |
const microseconds_t repeat_CURSOR___LEFT[] PROGMEM = { 3680U, 3680U, 460U, 1840U, 460U, 1840U, 460U, 1840U, 460U, 1840U, 460U, 920U, 460U, 1840U, 460U, 920U, 460U, 1840U, 460U, 920U, 460U, 1840U, 460U, 1840U, 460U, 920U, 460U, 920U, 460U, 920U, 460U, 920U, 460U, 920U, 460U, 1840U, 460U, 920U, 460U, 1840U, 460U, 920U, 460U, 1840U, 460U, 920U, 460U, 920U, 460U, 1840U, 460U, 7360 }; | |
// Command #28: CURSOR - RIGHT | |
// Protocol: rca, Parameters: D=15 F=87 | |
const microseconds_t repeat_CURSOR___RIGHT[] PROGMEM = { 3680U, 3680U, 460U, 1840U, 460U, 1840U, 460U, 1840U, 460U, 1840U, 460U, 920U, 460U, 1840U, 460U, 920U, 460U, 1840U, 460U, 920U, 460U, 1840U, 460U, 1840U, 460U, 1840U, 460U, 920U, 460U, 920U, 460U, 920U, 460U, 920U, 460U, 1840U, 460U, 920U, 460U, 1840U, 460U, 920U, 460U, 1840U, 460U, 920U, 460U, 920U, 460U, 920U, 460U, 7360 }; | |
// Command #29: CURSOR - DOWN | |
// Protocol: rca, Parameters: D=15 F=88 | |
const microseconds_t repeat_CURSOR___DOWN[] PROGMEM = { 3680U, 3680U, 460U, 1840U, 460U, 1840U, 460U, 1840U, 460U, 1840U, 460U, 920U, 460U, 1840U, 460U, 920U, 460U, 1840U, 460U, 1840U, 460U, 920U, 460U, 920U, 460U, 920U, 460U, 920U, 460U, 920U, 460U, 920U, 460U, 920U, 460U, 1840U, 460U, 920U, 460U, 1840U, 460U, 920U, 460U, 920U, 460U, 1840U, 460U, 1840U, 460U, 1840U, 460U, 7360 }; | |
// Command #30: CURSOR - UP | |
// Protocol: rca, Parameters: D=15 F=89 | |
const microseconds_t repeat_CURSOR___UP[] PROGMEM = { 3680U, 3680U, 460U, 1840U, 460U, 1840U, 460U, 1840U, 460U, 1840U, 460U, 920U, 460U, 1840U, 460U, 920U, 460U, 1840U, 460U, 1840U, 460U, 920U, 460U, 920U, 460U, 1840U, 460U, 920U, 460U, 920U, 460U, 920U, 460U, 920U, 460U, 1840U, 460U, 920U, 460U, 1840U, 460U, 920U, 460U, 920U, 460U, 1840U, 460U, 1840U, 460U, 920U, 460U, 7360 }; | |
// Command #31: SOUND | |
// Protocol: rca, Parameters: D=15 F=90 | |
const microseconds_t repeat_SOUND[] PROGMEM = { 3680U, 3680U, 460U, 1840U, 460U, 1840U, 460U, 1840U, 460U, 1840U, 460U, 920U, 460U, 1840U, 460U, 920U, 460U, 1840U, 460U, 1840U, 460U, 920U, 460U, 1840U, 460U, 920U, 460U, 920U, 460U, 920U, 460U, 920U, 460U, 920U, 460U, 1840U, 460U, 920U, 460U, 1840U, 460U, 920U, 460U, 920U, 460U, 1840U, 460U, 920U, 460U, 1840U, 460U, 7360 }; | |
// Command #32: INPUT SOURCE | |
// Protocol: rca, Parameters: D=15 F=163 | |
const microseconds_t repeat_INPUT_SOURCE[] PROGMEM = { 3680U, 3680U, 460U, 1840U, 460U, 1840U, 460U, 1840U, 460U, 1840U, 460U, 1840U, 460U, 920U, 460U, 1840U, 460U, 920U, 460U, 920U, 460U, 920U, 460U, 1840U, 460U, 1840U, 460U, 920U, 460U, 920U, 460U, 920U, 460U, 920U, 460U, 920U, 460U, 1840U, 460U, 920U, 460U, 1840U, 460U, 1840U, 460U, 1840U, 460U, 920U, 460U, 920U, 460U, 7360 }; | |
// Command #33: CURSOR - ENTER | |
// Protocol: rca, Parameters: D=15 F=244 | |
const microseconds_t repeat_CURSOR___ENTER[] PROGMEM = { 3680U, 3680U, 460U, 1840U, 460U, 1840U, 460U, 1840U, 460U, 1840U, 460U, 1840U, 460U, 1840U, 460U, 1840U, 460U, 1840U, 460U, 920U, 460U, 1840U, 460U, 920U, 460U, 920U, 460U, 920U, 460U, 920U, 460U, 920U, 460U, 920U, 460U, 920U, 460U, 920U, 460U, 920U, 460U, 920U, 460U, 1840U, 460U, 920U, 460U, 1840U, 460U, 1840U, 460U, 7360 }; | |
static void sendRaw(const microseconds_t intro_P[], size_t lengthIntro, const microseconds_t repeat_P[], | |
size_t lengthRepeat, frequency_t frequency, unsigned times) { | |
microseconds_t intro[lengthIntro]; | |
microseconds_t repeat[lengthRepeat]; | |
memcpy_PF(intro, (uint_farptr_t) intro_P, sizeof(microseconds_t) * lengthIntro); | |
memcpy_PF(repeat, (uint_farptr_t) repeat_P, sizeof(microseconds_t) * lengthRepeat); | |
#if defined(IRREMOTE) | defined(IRLIB) | |
if (lengthIntro > 0U) | |
irsend.sendRaw(intro, lengthIntro, hz2khz(frequency)); | |
if (lengthRepeat > 0U) | |
for (unsigned i = 0U; i < times - (lengthIntro > 0U); i++) | |
irsend.sendRaw(repeat, lengthRepeat, hz2khz(frequency)); | |
#else // INFRARED4ARDUINO | |
IrSignal irSignal(intro, lengthIntro, repeat, lengthRepeat, NULL, 0U, frequency); | |
irsend->sendIrSignal(irSignal, times); | |
#endif | |
} | |
void setup() { | |
Serial.begin(BAUD); | |
Serial.setTimeout(60000UL); | |
} | |
// A pretty silly main loop; just intended as an example. | |
void loop() { | |
Serial.println(F("Enter number of signal to send (1 .. 33)")); | |
long commandno = Serial.parseInt(); | |
Serial.println(F("Enter number of times to send it")); | |
long times = Serial.parseInt(); | |
switch (commandno) { | |
case 1U: | |
sendRaw(NULL, 0U, repeat_ANTENNA, 52U, 58000U, times); | |
break; | |
case 2U: | |
sendRaw(NULL, 0U, repeat_CLEAR, 52U, 58000U, times); | |
break; | |
case 3U: | |
sendRaw(NULL, 0U, repeat_MENU, 52U, 58000U, times); | |
break; | |
case 4U: | |
sendRaw(NULL, 0U, repeat_REC_VCR_, 52U, 58000U, times); | |
break; | |
case 5U: | |
sendRaw(NULL, 0U, repeat_GUIDE, 52U, 58000U, times); | |
break; | |
case 6U: | |
sendRaw(NULL, 0U, repeat_CHANNEL___PREVIOUS, 52U, 58000U, times); | |
break; | |
case 7U: | |
sendRaw(NULL, 0U, repeat_POWER, 52U, 58000U, times); | |
break; | |
case 8U: | |
sendRaw(NULL, 0U, repeat_CHANNEL___DOWN, 52U, 58000U, times); | |
break; | |
case 9U: | |
sendRaw(NULL, 0U, repeat_CHANNEL___UP, 52U, 58000U, times); | |
break; | |
case 10U: | |
sendRaw(NULL, 0U, repeat_VOLUME___DOWN, 52U, 58000U, times); | |
break; | |
case 11U: | |
sendRaw(NULL, 0U, repeat_VOLUME___UP, 52U, 58000U, times); | |
break; | |
case 12U: | |
sendRaw(NULL, 0U, repeat__0, 52U, 58000U, times); | |
break; | |
case 13U: | |
sendRaw(NULL, 0U, repeat__1, 52U, 58000U, times); | |
break; | |
case 14U: | |
sendRaw(NULL, 0U, repeat__2, 52U, 58000U, times); | |
break; | |
case 15U: | |
sendRaw(NULL, 0U, repeat__3, 52U, 58000U, times); | |
break; | |
case 16U: | |
sendRaw(NULL, 0U, repeat__4, 52U, 58000U, times); | |
break; | |
case 17U: | |
sendRaw(NULL, 0U, repeat__5, 52U, 58000U, times); | |
break; | |
case 18U: | |
sendRaw(NULL, 0U, repeat__6, 52U, 58000U, times); | |
break; | |
case 19U: | |
sendRaw(NULL, 0U, repeat__7, 52U, 58000U, times); | |
break; | |
case 20U: | |
sendRaw(NULL, 0U, repeat__8, 52U, 58000U, times); | |
break; | |
case 21U: | |
sendRaw(NULL, 0U, repeat__9, 52U, 58000U, times); | |
break; | |
case 22U: | |
sendRaw(NULL, 0U, repeat_POWER_ON, 52U, 58000U, times); | |
break; | |
case 23U: | |
sendRaw(NULL, 0U, repeat_POWER_OFF, 52U, 58000U, times); | |
break; | |
case 24U: | |
sendRaw(NULL, 0U, repeat_INFO, 52U, 58000U, times); | |
break; | |
case 25U: | |
sendRaw(NULL, 0U, repeat_VOLUME___MUTE, 52U, 58000U, times); | |
break; | |
case 26U: | |
sendRaw(NULL, 0U, repeat_SKIP, 52U, 58000U, times); | |
break; | |
case 27U: | |
sendRaw(NULL, 0U, repeat_CURSOR___LEFT, 52U, 58000U, times); | |
break; | |
case 28U: | |
sendRaw(NULL, 0U, repeat_CURSOR___RIGHT, 52U, 58000U, times); | |
break; | |
case 29U: | |
sendRaw(NULL, 0U, repeat_CURSOR___DOWN, 52U, 58000U, times); | |
break; | |
case 30U: | |
sendRaw(NULL, 0U, repeat_CURSOR___UP, 52U, 58000U, times); | |
break; | |
case 31U: | |
sendRaw(NULL, 0U, repeat_SOUND, 52U, 58000U, times); | |
break; | |
case 32U: | |
sendRaw(NULL, 0U, repeat_INPUT_SOURCE, 52U, 58000U, times); | |
break; | |
case 33U: | |
sendRaw(NULL, 0U, repeat_CURSOR___ENTER, 52U, 58000U, times); | |
break; | |
default: | |
Serial.println(F("Invalid number entered, try again")); | |
break; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment