Created
January 22, 2017 15:16
-
-
Save bengtmartensson/7f85396339718980d3c6cc4721989eca to your computer and use it in GitHub Desktop.
Arduino IR codes for Commodore CDTV
This file contains hidden or 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: KEY_LEFT | |
// Protocol: rca-38(old), Parameters: D=0 F=8 | |
const microseconds_t intro_KEY_LEFT[] PROGMEM = { 18400U, 3680U, 460U, 920U, 460U, 920U, 460U, 920U, 460U, 920U, 460U, 920U, 460U, 920U, 460U, 920U, 460U, 920U, 460U, 1840U, 460U, 920U, 460U, 920U, 460U, 920U, 460U, 1840U, 460U, 1840U, 460U, 1840U, 460U, 1840U, 460U, 1840U, 460U, 1840U, 460U, 1840U, 460U, 1840U, 460U, 920U, 460U, 1840U, 460U, 1840U, 460U, 1840U, 920U, 7360 }; | |
const microseconds_t repeat_KEY_LEFT[] PROGMEM = { 3680U, 3680U, 460U, 920U, 460U, 920U, 460U, 920U, 460U, 920U, 460U, 920U, 460U, 920U, 460U, 920U, 460U, 920U, 460U, 1840U, 460U, 920U, 460U, 920U, 460U, 920U, 460U, 1840U, 460U, 1840U, 460U, 1840U, 460U, 1840U, 460U, 1840U, 460U, 1840U, 460U, 1840U, 460U, 1840U, 460U, 920U, 460U, 1840U, 460U, 1840U, 460U, 1840U, 920U, 7360 }; | |
// Command #2: KEY_RIGHT | |
// Protocol: rca-38(old), Parameters: D=0 F=4 | |
const microseconds_t intro_KEY_RIGHT[] PROGMEM = { 18400U, 3680U, 460U, 920U, 460U, 920U, 460U, 920U, 460U, 920U, 460U, 920U, 460U, 920U, 460U, 920U, 460U, 920U, 460U, 920U, 460U, 1840U, 460U, 920U, 460U, 920U, 460U, 1840U, 460U, 1840U, 460U, 1840U, 460U, 1840U, 460U, 1840U, 460U, 1840U, 460U, 1840U, 460U, 1840U, 460U, 1840U, 460U, 920U, 460U, 1840U, 460U, 1840U, 920U, 7360 }; | |
const microseconds_t repeat_KEY_RIGHT[] PROGMEM = { 3680U, 3680U, 460U, 920U, 460U, 920U, 460U, 920U, 460U, 920U, 460U, 920U, 460U, 920U, 460U, 920U, 460U, 920U, 460U, 920U, 460U, 1840U, 460U, 920U, 460U, 920U, 460U, 1840U, 460U, 1840U, 460U, 1840U, 460U, 1840U, 460U, 1840U, 460U, 1840U, 460U, 1840U, 460U, 1840U, 460U, 1840U, 460U, 920U, 460U, 1840U, 460U, 1840U, 920U, 7360 }; | |
// Command #3: KEY_UP | |
// Protocol: rca-38(old), Parameters: D=0 F=32 | |
const microseconds_t intro_KEY_UP[] PROGMEM = { 18400U, 3680U, 460U, 920U, 460U, 920U, 460U, 920U, 460U, 920U, 460U, 920U, 460U, 920U, 460U, 1840U, 460U, 920U, 460U, 920U, 460U, 920U, 460U, 920U, 460U, 920U, 460U, 1840U, 460U, 1840U, 460U, 1840U, 460U, 1840U, 460U, 1840U, 460U, 1840U, 460U, 920U, 460U, 1840U, 460U, 1840U, 460U, 1840U, 460U, 1840U, 460U, 1840U, 920U, 7360 }; | |
const microseconds_t repeat_KEY_UP[] PROGMEM = { 3680U, 3680U, 460U, 920U, 460U, 920U, 460U, 920U, 460U, 920U, 460U, 920U, 460U, 920U, 460U, 1840U, 460U, 920U, 460U, 920U, 460U, 920U, 460U, 920U, 460U, 920U, 460U, 1840U, 460U, 1840U, 460U, 1840U, 460U, 1840U, 460U, 1840U, 460U, 1840U, 460U, 920U, 460U, 1840U, 460U, 1840U, 460U, 1840U, 460U, 1840U, 460U, 1840U, 920U, 7360 }; | |
// Command #4: KEY_DOWN | |
// Protocol: rca-38(old), Parameters: D=0 F=16 | |
const microseconds_t intro_KEY_DOWN[] PROGMEM = { 18400U, 3680U, 460U, 920U, 460U, 920U, 460U, 920U, 460U, 920U, 460U, 920U, 460U, 920U, 460U, 920U, 460U, 1840U, 460U, 920U, 460U, 920U, 460U, 920U, 460U, 920U, 460U, 1840U, 460U, 1840U, 460U, 1840U, 460U, 1840U, 460U, 1840U, 460U, 1840U, 460U, 1840U, 460U, 920U, 460U, 1840U, 460U, 1840U, 460U, 1840U, 460U, 1840U, 920U, 7360 }; | |
const microseconds_t repeat_KEY_DOWN[] PROGMEM = { 3680U, 3680U, 460U, 920U, 460U, 920U, 460U, 920U, 460U, 920U, 460U, 920U, 460U, 920U, 460U, 920U, 460U, 1840U, 460U, 920U, 460U, 920U, 460U, 920U, 460U, 920U, 460U, 1840U, 460U, 1840U, 460U, 1840U, 460U, 1840U, 460U, 1840U, 460U, 1840U, 460U, 1840U, 460U, 920U, 460U, 1840U, 460U, 1840U, 460U, 1840U, 460U, 1840U, 920U, 7360 }; | |
// Command #5: KEY_1 | |
// Protocol: rca-38(old), Parameters: D=0 F=1 | |
const microseconds_t intro_KEY_1[] PROGMEM = { 18400U, 3680U, 460U, 920U, 460U, 920U, 460U, 920U, 460U, 920U, 460U, 920U, 460U, 920U, 460U, 920U, 460U, 920U, 460U, 920U, 460U, 920U, 460U, 920U, 460U, 1840U, 460U, 1840U, 460U, 1840U, 460U, 1840U, 460U, 1840U, 460U, 1840U, 460U, 1840U, 460U, 1840U, 460U, 1840U, 460U, 1840U, 460U, 1840U, 460U, 1840U, 460U, 920U, 920U, 7360 }; | |
const microseconds_t repeat_KEY_1[] PROGMEM = { 3680U, 3680U, 460U, 920U, 460U, 920U, 460U, 920U, 460U, 920U, 460U, 920U, 460U, 920U, 460U, 920U, 460U, 920U, 460U, 920U, 460U, 920U, 460U, 920U, 460U, 1840U, 460U, 1840U, 460U, 1840U, 460U, 1840U, 460U, 1840U, 460U, 1840U, 460U, 1840U, 460U, 1840U, 460U, 1840U, 460U, 1840U, 460U, 1840U, 460U, 1840U, 460U, 920U, 920U, 7360 }; | |
// Command #6: KEY_2 | |
// Protocol: rca-38(old), Parameters: D=0 F=33 | |
const microseconds_t intro_KEY_2[] PROGMEM = { 18400U, 3680U, 460U, 920U, 460U, 920U, 460U, 920U, 460U, 920U, 460U, 920U, 460U, 920U, 460U, 1840U, 460U, 920U, 460U, 920U, 460U, 920U, 460U, 920U, 460U, 1840U, 460U, 1840U, 460U, 1840U, 460U, 1840U, 460U, 1840U, 460U, 1840U, 460U, 1840U, 460U, 920U, 460U, 1840U, 460U, 1840U, 460U, 1840U, 460U, 1840U, 460U, 920U, 920U, 7360 }; | |
const microseconds_t repeat_KEY_2[] PROGMEM = { 3680U, 3680U, 460U, 920U, 460U, 920U, 460U, 920U, 460U, 920U, 460U, 920U, 460U, 920U, 460U, 1840U, 460U, 920U, 460U, 920U, 460U, 920U, 460U, 920U, 460U, 1840U, 460U, 1840U, 460U, 1840U, 460U, 1840U, 460U, 1840U, 460U, 1840U, 460U, 1840U, 460U, 920U, 460U, 1840U, 460U, 1840U, 460U, 1840U, 460U, 1840U, 460U, 920U, 920U, 7360 }; | |
// Command #7: KEY_3 | |
// Protocol: rca-38(old), Parameters: D=0 F=17 | |
const microseconds_t intro_KEY_3[] PROGMEM = { 18400U, 3680U, 460U, 920U, 460U, 920U, 460U, 920U, 460U, 920U, 460U, 920U, 460U, 920U, 460U, 920U, 460U, 1840U, 460U, 920U, 460U, 920U, 460U, 920U, 460U, 1840U, 460U, 1840U, 460U, 1840U, 460U, 1840U, 460U, 1840U, 460U, 1840U, 460U, 1840U, 460U, 1840U, 460U, 920U, 460U, 1840U, 460U, 1840U, 460U, 1840U, 460U, 920U, 920U, 7360 }; | |
const microseconds_t repeat_KEY_3[] PROGMEM = { 3680U, 3680U, 460U, 920U, 460U, 920U, 460U, 920U, 460U, 920U, 460U, 920U, 460U, 920U, 460U, 920U, 460U, 1840U, 460U, 920U, 460U, 920U, 460U, 920U, 460U, 1840U, 460U, 1840U, 460U, 1840U, 460U, 1840U, 460U, 1840U, 460U, 1840U, 460U, 1840U, 460U, 1840U, 460U, 920U, 460U, 1840U, 460U, 1840U, 460U, 1840U, 460U, 920U, 920U, 7360 }; | |
// Command #8: KEY_4 | |
// Protocol: rca-38(old), Parameters: D=0 F=9 | |
const microseconds_t intro_KEY_4[] PROGMEM = { 18400U, 3680U, 460U, 920U, 460U, 920U, 460U, 920U, 460U, 920U, 460U, 920U, 460U, 920U, 460U, 920U, 460U, 920U, 460U, 1840U, 460U, 920U, 460U, 920U, 460U, 1840U, 460U, 1840U, 460U, 1840U, 460U, 1840U, 460U, 1840U, 460U, 1840U, 460U, 1840U, 460U, 1840U, 460U, 1840U, 460U, 920U, 460U, 1840U, 460U, 1840U, 460U, 920U, 920U, 7360 }; | |
const microseconds_t repeat_KEY_4[] PROGMEM = { 3680U, 3680U, 460U, 920U, 460U, 920U, 460U, 920U, 460U, 920U, 460U, 920U, 460U, 920U, 460U, 920U, 460U, 920U, 460U, 1840U, 460U, 920U, 460U, 920U, 460U, 1840U, 460U, 1840U, 460U, 1840U, 460U, 1840U, 460U, 1840U, 460U, 1840U, 460U, 1840U, 460U, 1840U, 460U, 1840U, 460U, 920U, 460U, 1840U, 460U, 1840U, 460U, 920U, 920U, 7360 }; | |
// Command #9: KEY_5 | |
// Protocol: rca-38(old), Parameters: D=0 F=41 | |
const microseconds_t intro_KEY_5[] PROGMEM = { 18400U, 3680U, 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, 1840U, 460U, 1840U, 460U, 1840U, 460U, 1840U, 460U, 920U, 460U, 1840U, 460U, 920U, 460U, 1840U, 460U, 1840U, 460U, 920U, 920U, 7360 }; | |
const microseconds_t repeat_KEY_5[] PROGMEM = { 3680U, 3680U, 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, 1840U, 460U, 1840U, 460U, 1840U, 460U, 1840U, 460U, 920U, 460U, 1840U, 460U, 920U, 460U, 1840U, 460U, 1840U, 460U, 920U, 920U, 7360 }; | |
// Command #10: KEY_6 | |
// Protocol: rca-38(old), Parameters: D=0 F=25 | |
const microseconds_t intro_KEY_6[] PROGMEM = { 18400U, 3680U, 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, 1840U, 460U, 1840U, 460U, 1840U, 460U, 1840U, 460U, 920U, 460U, 920U, 460U, 1840U, 460U, 1840U, 460U, 920U, 920U, 7360 }; | |
const microseconds_t repeat_KEY_6[] PROGMEM = { 3680U, 3680U, 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, 1840U, 460U, 1840U, 460U, 1840U, 460U, 1840U, 460U, 920U, 460U, 920U, 460U, 1840U, 460U, 1840U, 460U, 920U, 920U, 7360 }; | |
// Command #11: KEY_7 | |
// Protocol: rca-38(old), Parameters: D=0 F=5 | |
const microseconds_t intro_KEY_7[] PROGMEM = { 18400U, 3680U, 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, 1840U, 460U, 1840U, 460U, 1840U, 460U, 1840U, 460U, 1840U, 460U, 1840U, 460U, 1840U, 460U, 1840U, 460U, 920U, 460U, 1840U, 460U, 920U, 920U, 7360 }; | |
const microseconds_t repeat_KEY_7[] PROGMEM = { 3680U, 3680U, 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, 1840U, 460U, 1840U, 460U, 1840U, 460U, 1840U, 460U, 1840U, 460U, 1840U, 460U, 1840U, 460U, 1840U, 460U, 920U, 460U, 1840U, 460U, 920U, 920U, 7360 }; | |
// Command #12: KEY_8 | |
// Protocol: rca-38(old), Parameters: D=0 F=37 | |
const microseconds_t intro_KEY_8[] PROGMEM = { 18400U, 3680U, 460U, 920U, 460U, 920U, 460U, 920U, 460U, 920U, 460U, 920U, 460U, 920U, 460U, 1840U, 460U, 920U, 460U, 920U, 460U, 1840U, 460U, 920U, 460U, 1840U, 460U, 1840U, 460U, 1840U, 460U, 1840U, 460U, 1840U, 460U, 1840U, 460U, 1840U, 460U, 920U, 460U, 1840U, 460U, 1840U, 460U, 920U, 460U, 1840U, 460U, 920U, 920U, 7360 }; | |
const microseconds_t repeat_KEY_8[] PROGMEM = { 3680U, 3680U, 460U, 920U, 460U, 920U, 460U, 920U, 460U, 920U, 460U, 920U, 460U, 920U, 460U, 1840U, 460U, 920U, 460U, 920U, 460U, 1840U, 460U, 920U, 460U, 1840U, 460U, 1840U, 460U, 1840U, 460U, 1840U, 460U, 1840U, 460U, 1840U, 460U, 1840U, 460U, 920U, 460U, 1840U, 460U, 1840U, 460U, 920U, 460U, 1840U, 460U, 920U, 920U, 7360 }; | |
// Command #13: KEY_9 | |
// Protocol: rca-38(old), Parameters: D=0 F=21 | |
const microseconds_t intro_KEY_9[] PROGMEM = { 18400U, 3680U, 460U, 920U, 460U, 920U, 460U, 920U, 460U, 920U, 460U, 920U, 460U, 920U, 460U, 920U, 460U, 1840U, 460U, 920U, 460U, 1840U, 460U, 920U, 460U, 1840U, 460U, 1840U, 460U, 1840U, 460U, 1840U, 460U, 1840U, 460U, 1840U, 460U, 1840U, 460U, 1840U, 460U, 920U, 460U, 1840U, 460U, 920U, 460U, 1840U, 460U, 920U, 920U, 7360 }; | |
const microseconds_t repeat_KEY_9[] PROGMEM = { 3680U, 3680U, 460U, 920U, 460U, 920U, 460U, 920U, 460U, 920U, 460U, 920U, 460U, 920U, 460U, 920U, 460U, 1840U, 460U, 920U, 460U, 1840U, 460U, 920U, 460U, 1840U, 460U, 1840U, 460U, 1840U, 460U, 1840U, 460U, 1840U, 460U, 1840U, 460U, 1840U, 460U, 1840U, 460U, 920U, 460U, 1840U, 460U, 920U, 460U, 1840U, 460U, 920U, 920U, 7360 }; | |
// Command #14: KEY_0 | |
// Protocol: rca-38(old), Parameters: D=0 F=57 | |
const microseconds_t intro_KEY_0[] PROGMEM = { 18400U, 3680U, 460U, 920U, 460U, 920U, 460U, 920U, 460U, 920U, 460U, 920U, 460U, 920U, 460U, 1840U, 460U, 1840U, 460U, 1840U, 460U, 920U, 460U, 920U, 460U, 1840U, 460U, 1840U, 460U, 1840U, 460U, 1840U, 460U, 1840U, 460U, 1840U, 460U, 1840U, 460U, 920U, 460U, 920U, 460U, 920U, 460U, 1840U, 460U, 1840U, 460U, 920U, 920U, 7360 }; | |
const microseconds_t repeat_KEY_0[] PROGMEM = { 3680U, 3680U, 460U, 920U, 460U, 920U, 460U, 920U, 460U, 920U, 460U, 920U, 460U, 920U, 460U, 1840U, 460U, 1840U, 460U, 1840U, 460U, 920U, 460U, 920U, 460U, 1840U, 460U, 1840U, 460U, 1840U, 460U, 1840U, 460U, 1840U, 460U, 1840U, 460U, 1840U, 460U, 920U, 460U, 920U, 460U, 920U, 460U, 1840U, 460U, 1840U, 460U, 920U, 920U, 7360 }; | |
// Command #15: KEY_ESC | |
// Protocol: rca-38(old), Parameters: D=0 F=49 | |
const microseconds_t intro_KEY_ESC[] PROGMEM = { 18400U, 3680U, 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, 1840U, 460U, 1840U, 460U, 1840U, 460U, 1840U, 460U, 920U, 460U, 920U, 460U, 1840U, 460U, 1840U, 460U, 1840U, 460U, 920U, 920U, 7360 }; | |
const microseconds_t repeat_KEY_ESC[] PROGMEM = { 3680U, 3680U, 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, 1840U, 460U, 1840U, 460U, 1840U, 460U, 1840U, 460U, 920U, 460U, 920U, 460U, 1840U, 460U, 1840U, 460U, 1840U, 460U, 920U, 920U, 7360 }; | |
// Command #16: KEY_ENTER | |
// Protocol: rca-38(old), Parameters: D=0 F=53 | |
const microseconds_t intro_KEY_ENTER[] PROGMEM = { 18400U, 3680U, 460U, 920U, 460U, 920U, 460U, 920U, 460U, 920U, 460U, 920U, 460U, 920U, 460U, 1840U, 460U, 1840U, 460U, 920U, 460U, 1840U, 460U, 920U, 460U, 1840U, 460U, 1840U, 460U, 1840U, 460U, 1840U, 460U, 1840U, 460U, 1840U, 460U, 1840U, 460U, 920U, 460U, 920U, 460U, 1840U, 460U, 920U, 460U, 1840U, 460U, 920U, 920U, 7360 }; | |
const microseconds_t repeat_KEY_ENTER[] PROGMEM = { 3680U, 3680U, 460U, 920U, 460U, 920U, 460U, 920U, 460U, 920U, 460U, 920U, 460U, 920U, 460U, 1840U, 460U, 1840U, 460U, 920U, 460U, 1840U, 460U, 920U, 460U, 1840U, 460U, 1840U, 460U, 1840U, 460U, 1840U, 460U, 1840U, 460U, 1840U, 460U, 1840U, 460U, 920U, 460U, 920U, 460U, 1840U, 460U, 920U, 460U, 1840U, 460U, 920U, 920U, 7360 }; | |
// Command #17: genlock | |
// Protocol: rca-38(old), Parameters: D=0 F=34 | |
const microseconds_t intro_genlock[] PROGMEM = { 18400U, 3680U, 460U, 920U, 460U, 920U, 460U, 920U, 460U, 920U, 460U, 920U, 460U, 920U, 460U, 1840U, 460U, 920U, 460U, 920U, 460U, 920U, 460U, 1840U, 460U, 920U, 460U, 1840U, 460U, 1840U, 460U, 1840U, 460U, 1840U, 460U, 1840U, 460U, 1840U, 460U, 920U, 460U, 1840U, 460U, 1840U, 460U, 1840U, 460U, 920U, 460U, 1840U, 920U, 7360 }; | |
const microseconds_t repeat_genlock[] PROGMEM = { 3680U, 3680U, 460U, 920U, 460U, 920U, 460U, 920U, 460U, 920U, 460U, 920U, 460U, 920U, 460U, 1840U, 460U, 920U, 460U, 920U, 460U, 920U, 460U, 1840U, 460U, 920U, 460U, 1840U, 460U, 1840U, 460U, 1840U, 460U, 1840U, 460U, 1840U, 460U, 1840U, 460U, 920U, 460U, 1840U, 460U, 1840U, 460U, 1840U, 460U, 920U, 460U, 1840U, 920U, 7360 }; | |
// Command #18: cdtv | |
// Protocol: rca-38(old), Parameters: D=0 F=2 | |
const microseconds_t intro_cdtv[] PROGMEM = { 18400U, 3680U, 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, 1840U, 460U, 1840U, 460U, 1840U, 460U, 1840U, 460U, 1840U, 460U, 1840U, 460U, 1840U, 460U, 1840U, 460U, 920U, 460U, 1840U, 920U, 7360 }; | |
const microseconds_t repeat_cdtv[] PROGMEM = { 3680U, 3680U, 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, 1840U, 460U, 1840U, 460U, 1840U, 460U, 1840U, 460U, 1840U, 460U, 1840U, 460U, 1840U, 460U, 1840U, 460U, 920U, 460U, 1840U, 920U, 7360 }; | |
// Command #19: KEY_POWER | |
// Protocol: rca-38(old), Parameters: D=0 F=18 | |
const microseconds_t intro_KEY_POWER[] PROGMEM = { 18400U, 3680U, 460U, 920U, 460U, 920U, 460U, 920U, 460U, 920U, 460U, 920U, 460U, 920U, 460U, 920U, 460U, 1840U, 460U, 920U, 460U, 920U, 460U, 1840U, 460U, 920U, 460U, 1840U, 460U, 1840U, 460U, 1840U, 460U, 1840U, 460U, 1840U, 460U, 1840U, 460U, 1840U, 460U, 920U, 460U, 1840U, 460U, 1840U, 460U, 920U, 460U, 1840U, 920U, 7360 }; | |
const microseconds_t repeat_KEY_POWER[] PROGMEM = { 3680U, 3680U, 460U, 920U, 460U, 920U, 460U, 920U, 460U, 920U, 460U, 920U, 460U, 920U, 460U, 920U, 460U, 1840U, 460U, 920U, 460U, 920U, 460U, 1840U, 460U, 920U, 460U, 1840U, 460U, 1840U, 460U, 1840U, 460U, 1840U, 460U, 1840U, 460U, 1840U, 460U, 1840U, 460U, 920U, 460U, 1840U, 460U, 1840U, 460U, 920U, 460U, 1840U, 920U, 7360 }; | |
// Command #20: KEY_REWIND | |
// Protocol: rca-38(old), Parameters: D=0 F=50 | |
const microseconds_t intro_KEY_REWIND[] PROGMEM = { 18400U, 3680U, 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, 1840U, 460U, 1840U, 460U, 1840U, 460U, 1840U, 460U, 920U, 460U, 920U, 460U, 1840U, 460U, 1840U, 460U, 920U, 460U, 1840U, 920U, 7360 }; | |
const microseconds_t repeat_KEY_REWIND[] PROGMEM = { 3680U, 3680U, 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, 1840U, 460U, 1840U, 460U, 1840U, 460U, 1840U, 460U, 920U, 460U, 920U, 460U, 1840U, 460U, 1840U, 460U, 920U, 460U, 1840U, 920U, 7360 }; | |
// Command #21: KEY_PLAYPAUSE | |
// Protocol: rca-38(old), Parameters: D=0 F=10 | |
const microseconds_t intro_KEY_PLAYPAUSE[] PROGMEM = { 18400U, 3680U, 460U, 920U, 460U, 920U, 460U, 920U, 460U, 920U, 460U, 920U, 460U, 920U, 460U, 920U, 460U, 920U, 460U, 1840U, 460U, 920U, 460U, 1840U, 460U, 920U, 460U, 1840U, 460U, 1840U, 460U, 1840U, 460U, 1840U, 460U, 1840U, 460U, 1840U, 460U, 1840U, 460U, 1840U, 460U, 920U, 460U, 1840U, 460U, 920U, 460U, 1840U, 920U, 7360 }; | |
const microseconds_t repeat_KEY_PLAYPAUSE[] PROGMEM = { 3680U, 3680U, 460U, 920U, 460U, 920U, 460U, 920U, 460U, 920U, 460U, 920U, 460U, 920U, 460U, 920U, 460U, 920U, 460U, 1840U, 460U, 920U, 460U, 1840U, 460U, 920U, 460U, 1840U, 460U, 1840U, 460U, 1840U, 460U, 1840U, 460U, 1840U, 460U, 1840U, 460U, 1840U, 460U, 1840U, 460U, 920U, 460U, 1840U, 460U, 920U, 460U, 1840U, 920U, 7360 }; | |
// Command #22: KEY_FASTFORWARD | |
// Protocol: rca-38(old), Parameters: D=0 F=26 | |
const microseconds_t intro_KEY_FASTFORWARD[] PROGMEM = { 18400U, 3680U, 460U, 920U, 460U, 920U, 460U, 920U, 460U, 920U, 460U, 920U, 460U, 920U, 460U, 920U, 460U, 1840U, 460U, 1840U, 460U, 920U, 460U, 1840U, 460U, 920U, 460U, 1840U, 460U, 1840U, 460U, 1840U, 460U, 1840U, 460U, 1840U, 460U, 1840U, 460U, 1840U, 460U, 920U, 460U, 920U, 460U, 1840U, 460U, 920U, 460U, 1840U, 920U, 7360 }; | |
const microseconds_t repeat_KEY_FASTFORWARD[] PROGMEM = { 3680U, 3680U, 460U, 920U, 460U, 920U, 460U, 920U, 460U, 920U, 460U, 920U, 460U, 920U, 460U, 920U, 460U, 1840U, 460U, 1840U, 460U, 920U, 460U, 1840U, 460U, 920U, 460U, 1840U, 460U, 1840U, 460U, 1840U, 460U, 1840U, 460U, 1840U, 460U, 1840U, 460U, 1840U, 460U, 920U, 460U, 920U, 460U, 1840U, 460U, 920U, 460U, 1840U, 920U, 7360 }; | |
// Command #23: KEY_STOP | |
// Protocol: rca-38(old), Parameters: D=0 F=42 | |
const microseconds_t intro_KEY_STOP[] PROGMEM = { 18400U, 3680U, 460U, 920U, 460U, 920U, 460U, 920U, 460U, 920U, 460U, 920U, 460U, 920U, 460U, 1840U, 460U, 920U, 460U, 1840U, 460U, 920U, 460U, 1840U, 460U, 920U, 460U, 1840U, 460U, 1840U, 460U, 1840U, 460U, 1840U, 460U, 1840U, 460U, 1840U, 460U, 920U, 460U, 1840U, 460U, 920U, 460U, 1840U, 460U, 920U, 460U, 1840U, 920U, 7360 }; | |
const microseconds_t repeat_KEY_STOP[] PROGMEM = { 3680U, 3680U, 460U, 920U, 460U, 920U, 460U, 920U, 460U, 920U, 460U, 920U, 460U, 920U, 460U, 1840U, 460U, 920U, 460U, 1840U, 460U, 920U, 460U, 1840U, 460U, 920U, 460U, 1840U, 460U, 1840U, 460U, 1840U, 460U, 1840U, 460U, 1840U, 460U, 1840U, 460U, 920U, 460U, 1840U, 460U, 920U, 460U, 1840U, 460U, 920U, 460U, 1840U, 920U, 7360 }; | |
// Command #24: KEY_VOLUMEUP | |
// Protocol: rca-38(old), Parameters: D=0 F=6 | |
const microseconds_t intro_KEY_VOLUMEUP[] PROGMEM = { 18400U, 3680U, 460U, 920U, 460U, 920U, 460U, 920U, 460U, 920U, 460U, 920U, 460U, 920U, 460U, 920U, 460U, 920U, 460U, 920U, 460U, 1840U, 460U, 1840U, 460U, 920U, 460U, 1840U, 460U, 1840U, 460U, 1840U, 460U, 1840U, 460U, 1840U, 460U, 1840U, 460U, 1840U, 460U, 1840U, 460U, 1840U, 460U, 920U, 460U, 920U, 460U, 1840U, 920U, 7360 }; | |
const microseconds_t repeat_KEY_VOLUMEUP[] PROGMEM = { 3680U, 3680U, 460U, 920U, 460U, 920U, 460U, 920U, 460U, 920U, 460U, 920U, 460U, 920U, 460U, 920U, 460U, 920U, 460U, 920U, 460U, 1840U, 460U, 1840U, 460U, 920U, 460U, 1840U, 460U, 1840U, 460U, 1840U, 460U, 1840U, 460U, 1840U, 460U, 1840U, 460U, 1840U, 460U, 1840U, 460U, 1840U, 460U, 920U, 460U, 920U, 460U, 1840U, 920U, 7360 }; | |
// Command #25: KEY_VOLUMEDOWN | |
// Protocol: rca-38(old), Parameters: D=0 F=58 | |
const microseconds_t intro_KEY_VOLUMEDOWN[] PROGMEM = { 18400U, 3680U, 460U, 920U, 460U, 920U, 460U, 920U, 460U, 920U, 460U, 920U, 460U, 920U, 460U, 1840U, 460U, 1840U, 460U, 1840U, 460U, 920U, 460U, 1840U, 460U, 920U, 460U, 1840U, 460U, 1840U, 460U, 1840U, 460U, 1840U, 460U, 1840U, 460U, 1840U, 460U, 920U, 460U, 920U, 460U, 920U, 460U, 1840U, 460U, 920U, 460U, 1840U, 920U, 7360 }; | |
const microseconds_t repeat_KEY_VOLUMEDOWN[] PROGMEM = { 3680U, 3680U, 460U, 920U, 460U, 920U, 460U, 920U, 460U, 920U, 460U, 920U, 460U, 920U, 460U, 1840U, 460U, 1840U, 460U, 1840U, 460U, 920U, 460U, 1840U, 460U, 920U, 460U, 1840U, 460U, 1840U, 460U, 1840U, 460U, 1840U, 460U, 1840U, 460U, 1840U, 460U, 920U, 460U, 920U, 460U, 920U, 460U, 1840U, 460U, 920U, 460U, 1840U, 920U, 7360 }; | |
// Command #26: a_button | |
// Protocol: rca-38(old), Parameters: D=0 F=128 | |
const microseconds_t intro_a_button[] PROGMEM = { 18400U, 3680U, 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, 1840U, 460U, 1840U, 460U, 1840U, 460U, 1840U, 920U, 7360 }; | |
const microseconds_t repeat_a_button[] PROGMEM = { 3680U, 3680U, 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, 1840U, 460U, 1840U, 460U, 1840U, 460U, 1840U, 920U, 7360 }; | |
// Command #27: b_button | |
// Protocol: rca-38(old), Parameters: D=0 F=64 | |
const microseconds_t intro_b_button[] PROGMEM = { 18400U, 3680U, 460U, 920U, 460U, 920U, 460U, 920U, 460U, 920U, 460U, 920U, 460U, 1840U, 460U, 920U, 460U, 920U, 460U, 920U, 460U, 920U, 460U, 920U, 460U, 920U, 460U, 1840U, 460U, 1840U, 460U, 1840U, 460U, 1840U, 460U, 1840U, 460U, 920U, 460U, 1840U, 460U, 1840U, 460U, 1840U, 460U, 1840U, 460U, 1840U, 460U, 1840U, 920U, 7360 }; | |
const microseconds_t repeat_b_button[] PROGMEM = { 3680U, 3680U, 460U, 920U, 460U, 920U, 460U, 920U, 460U, 920U, 460U, 920U, 460U, 1840U, 460U, 920U, 460U, 920U, 460U, 920U, 460U, 920U, 460U, 920U, 460U, 920U, 460U, 1840U, 460U, 1840U, 460U, 1840U, 460U, 1840U, 460U, 1840U, 460U, 920U, 460U, 1840U, 460U, 1840U, 460U, 1840U, 460U, 1840U, 460U, 1840U, 460U, 1840U, 920U, 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 .. 27)")); | |
long commandno = Serial.parseInt(); | |
Serial.println(F("Enter number of times to send it")); | |
long times = Serial.parseInt(); | |
switch (commandno) { | |
case 1U: | |
sendRaw(intro_KEY_LEFT, 52U, repeat_KEY_LEFT, 52U, 38700U, times); | |
break; | |
case 2U: | |
sendRaw(intro_KEY_RIGHT, 52U, repeat_KEY_RIGHT, 52U, 38700U, times); | |
break; | |
case 3U: | |
sendRaw(intro_KEY_UP, 52U, repeat_KEY_UP, 52U, 38700U, times); | |
break; | |
case 4U: | |
sendRaw(intro_KEY_DOWN, 52U, repeat_KEY_DOWN, 52U, 38700U, times); | |
break; | |
case 5U: | |
sendRaw(intro_KEY_1, 52U, repeat_KEY_1, 52U, 38700U, times); | |
break; | |
case 6U: | |
sendRaw(intro_KEY_2, 52U, repeat_KEY_2, 52U, 38700U, times); | |
break; | |
case 7U: | |
sendRaw(intro_KEY_3, 52U, repeat_KEY_3, 52U, 38700U, times); | |
break; | |
case 8U: | |
sendRaw(intro_KEY_4, 52U, repeat_KEY_4, 52U, 38700U, times); | |
break; | |
case 9U: | |
sendRaw(intro_KEY_5, 52U, repeat_KEY_5, 52U, 38700U, times); | |
break; | |
case 10U: | |
sendRaw(intro_KEY_6, 52U, repeat_KEY_6, 52U, 38700U, times); | |
break; | |
case 11U: | |
sendRaw(intro_KEY_7, 52U, repeat_KEY_7, 52U, 38700U, times); | |
break; | |
case 12U: | |
sendRaw(intro_KEY_8, 52U, repeat_KEY_8, 52U, 38700U, times); | |
break; | |
case 13U: | |
sendRaw(intro_KEY_9, 52U, repeat_KEY_9, 52U, 38700U, times); | |
break; | |
case 14U: | |
sendRaw(intro_KEY_0, 52U, repeat_KEY_0, 52U, 38700U, times); | |
break; | |
case 15U: | |
sendRaw(intro_KEY_ESC, 52U, repeat_KEY_ESC, 52U, 38700U, times); | |
break; | |
case 16U: | |
sendRaw(intro_KEY_ENTER, 52U, repeat_KEY_ENTER, 52U, 38700U, times); | |
break; | |
case 17U: | |
sendRaw(intro_genlock, 52U, repeat_genlock, 52U, 38700U, times); | |
break; | |
case 18U: | |
sendRaw(intro_cdtv, 52U, repeat_cdtv, 52U, 38700U, times); | |
break; | |
case 19U: | |
sendRaw(intro_KEY_POWER, 52U, repeat_KEY_POWER, 52U, 38700U, times); | |
break; | |
case 20U: | |
sendRaw(intro_KEY_REWIND, 52U, repeat_KEY_REWIND, 52U, 38700U, times); | |
break; | |
case 21U: | |
sendRaw(intro_KEY_PLAYPAUSE, 52U, repeat_KEY_PLAYPAUSE, 52U, 38700U, times); | |
break; | |
case 22U: | |
sendRaw(intro_KEY_FASTFORWARD, 52U, repeat_KEY_FASTFORWARD, 52U, 38700U, times); | |
break; | |
case 23U: | |
sendRaw(intro_KEY_STOP, 52U, repeat_KEY_STOP, 52U, 38700U, times); | |
break; | |
case 24U: | |
sendRaw(intro_KEY_VOLUMEUP, 52U, repeat_KEY_VOLUMEUP, 52U, 38700U, times); | |
break; | |
case 25U: | |
sendRaw(intro_KEY_VOLUMEDOWN, 52U, repeat_KEY_VOLUMEDOWN, 52U, 38700U, times); | |
break; | |
case 26U: | |
sendRaw(intro_a_button, 52U, repeat_a_button, 52U, 38700U, times); | |
break; | |
case 27U: | |
sendRaw(intro_b_button, 52U, repeat_b_button, 52U, 38700U, 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