Created
June 26, 2020 20:07
-
-
Save bengtmartensson/a8a10bc6adb969ce5d59c5f2697b095d 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 | |
// For problems, bugs, and suggestions, please open an issue at | |
// https://github.com/bengtmartensson/IrScrutinizer/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: 3D SOUND PLUS | |
// Protocol: samsung36, Parameters: S=15 D=48 E=1 F=129 | |
const microseconds_t repeat__3D_SOUND_PLUS[] PROGMEM = { 4500U, 4500U, 560U, 560U, 560U, 560U, 560U, 560U, 560U, 560U, 560U, 1680U, 560U, 1680U, 560U, 560U, 560U, 560U, 560U, 1680U, 560U, 1680U, 560U, 1680U, 560U, 1680U, 560U, 560U, 560U, 560U, 560U, 560U, 560U, 560U, 560U, 5040U, 560U, 1680U, 560U, 560U, 560U, 560U, 560U, 560U, 560U, 1680U, 560U, 560U, 560U, 560U, 560U, 560U, 560U, 560U, 560U, 560U, 560U, 560U, 560U, 1680U, 560U, 560U, 560U, 1680U, 560U, 1680U, 560U, 1680U, 560U, 1680U, 560U, 1680U, 560U, 1680U, 560U, 560U, 560U, 35720 }; | |
// Command #2: ANYNET PLUS | |
// Protocol: samsung36, Parameters: S=15 D=48 E=1 F=135 | |
const microseconds_t repeat_ANYNET_PLUS[] PROGMEM = { 4500U, 4500U, 560U, 560U, 560U, 560U, 560U, 560U, 560U, 560U, 560U, 1680U, 560U, 1680U, 560U, 560U, 560U, 560U, 560U, 1680U, 560U, 1680U, 560U, 1680U, 560U, 1680U, 560U, 560U, 560U, 560U, 560U, 560U, 560U, 560U, 560U, 5040U, 560U, 1680U, 560U, 560U, 560U, 560U, 560U, 560U, 560U, 1680U, 560U, 1680U, 560U, 1680U, 560U, 560U, 560U, 560U, 560U, 560U, 560U, 560U, 560U, 1680U, 560U, 560U, 560U, 560U, 560U, 560U, 560U, 1680U, 560U, 1680U, 560U, 1680U, 560U, 1680U, 560U, 560U, 560U, 35720 }; | |
// Command #3: ASC | |
// Protocol: samsung36, Parameters: S=15 D=48 E=0 F=146 | |
const microseconds_t repeat_ASC[] PROGMEM = { 4500U, 4500U, 560U, 560U, 560U, 560U, 560U, 560U, 560U, 560U, 560U, 1680U, 560U, 1680U, 560U, 560U, 560U, 560U, 560U, 1680U, 560U, 1680U, 560U, 1680U, 560U, 1680U, 560U, 560U, 560U, 560U, 560U, 560U, 560U, 560U, 560U, 5040U, 560U, 560U, 560U, 560U, 560U, 560U, 560U, 560U, 560U, 560U, 560U, 1680U, 560U, 560U, 560U, 560U, 560U, 1680U, 560U, 560U, 560U, 560U, 560U, 1680U, 560U, 1680U, 560U, 560U, 560U, 1680U, 560U, 1680U, 560U, 560U, 560U, 1680U, 560U, 1680U, 560U, 560U, 560U, 36840 }; | |
// Command #4: AUDIO SYNC DOWN | |
// Protocol: samsung36, Parameters: S=15 D=48 E=1 F=133 | |
const microseconds_t repeat_AUDIO_SYNC_DOWN[] PROGMEM = { 4500U, 4500U, 560U, 560U, 560U, 560U, 560U, 560U, 560U, 560U, 560U, 1680U, 560U, 1680U, 560U, 560U, 560U, 560U, 560U, 1680U, 560U, 1680U, 560U, 1680U, 560U, 1680U, 560U, 560U, 560U, 560U, 560U, 560U, 560U, 560U, 560U, 5040U, 560U, 1680U, 560U, 560U, 560U, 560U, 560U, 560U, 560U, 1680U, 560U, 560U, 560U, 1680U, 560U, 560U, 560U, 560U, 560U, 560U, 560U, 560U, 560U, 1680U, 560U, 560U, 560U, 1680U, 560U, 560U, 560U, 1680U, 560U, 1680U, 560U, 1680U, 560U, 1680U, 560U, 560U, 560U, 35720 }; | |
// Command #5: AUDIO SYNC UP | |
// Protocol: samsung36, Parameters: S=15 D=48 E=1 F=132 | |
const microseconds_t repeat_AUDIO_SYNC_UP[] PROGMEM = { 4500U, 4500U, 560U, 560U, 560U, 560U, 560U, 560U, 560U, 560U, 560U, 1680U, 560U, 1680U, 560U, 560U, 560U, 560U, 560U, 1680U, 560U, 1680U, 560U, 1680U, 560U, 1680U, 560U, 560U, 560U, 560U, 560U, 560U, 560U, 560U, 560U, 5040U, 560U, 1680U, 560U, 560U, 560U, 560U, 560U, 560U, 560U, 560U, 560U, 560U, 560U, 1680U, 560U, 560U, 560U, 560U, 560U, 560U, 560U, 560U, 560U, 1680U, 560U, 1680U, 560U, 1680U, 560U, 560U, 560U, 1680U, 560U, 1680U, 560U, 1680U, 560U, 1680U, 560U, 560U, 560U, 35720 }; | |
// Command #6: AUTO POWER | |
// Protocol: samsung36, Parameters: S=15 D=48 E=1 F=121 | |
const microseconds_t repeat_AUTO_POWER[] PROGMEM = { 4500U, 4500U, 560U, 560U, 560U, 560U, 560U, 560U, 560U, 560U, 560U, 1680U, 560U, 1680U, 560U, 560U, 560U, 560U, 560U, 1680U, 560U, 1680U, 560U, 1680U, 560U, 1680U, 560U, 560U, 560U, 560U, 560U, 560U, 560U, 560U, 560U, 5040U, 560U, 1680U, 560U, 560U, 560U, 560U, 560U, 560U, 560U, 1680U, 560U, 560U, 560U, 560U, 560U, 1680U, 560U, 1680U, 560U, 1680U, 560U, 1680U, 560U, 560U, 560U, 560U, 560U, 1680U, 560U, 1680U, 560U, 560U, 560U, 560U, 560U, 560U, 560U, 560U, 560U, 1680U, 560U, 35720 }; | |
// Command #7: FORWARD/NEXT | |
// Protocol: samsung36, Parameters: S=15 D=48 E=1 F=140 | |
const microseconds_t repeat_FORWARD_NEXT[] PROGMEM = { 4500U, 4500U, 560U, 560U, 560U, 560U, 560U, 560U, 560U, 560U, 560U, 1680U, 560U, 1680U, 560U, 560U, 560U, 560U, 560U, 1680U, 560U, 1680U, 560U, 1680U, 560U, 1680U, 560U, 560U, 560U, 560U, 560U, 560U, 560U, 560U, 560U, 5040U, 560U, 1680U, 560U, 560U, 560U, 560U, 560U, 560U, 560U, 560U, 560U, 560U, 560U, 1680U, 560U, 1680U, 560U, 560U, 560U, 560U, 560U, 560U, 560U, 1680U, 560U, 1680U, 560U, 1680U, 560U, 560U, 560U, 560U, 560U, 1680U, 560U, 1680U, 560U, 1680U, 560U, 560U, 560U, 35720 }; | |
// Command #8: INPUT AUX | |
// Protocol: samsung36, Parameters: S=15 D=48 E=0 F=148 | |
const microseconds_t repeat_INPUT_AUX[] PROGMEM = { 4500U, 4500U, 560U, 560U, 560U, 560U, 560U, 560U, 560U, 560U, 560U, 1680U, 560U, 1680U, 560U, 560U, 560U, 560U, 560U, 1680U, 560U, 1680U, 560U, 1680U, 560U, 1680U, 560U, 560U, 560U, 560U, 560U, 560U, 560U, 560U, 560U, 5040U, 560U, 560U, 560U, 560U, 560U, 560U, 560U, 560U, 560U, 560U, 560U, 560U, 560U, 1680U, 560U, 560U, 560U, 1680U, 560U, 560U, 560U, 560U, 560U, 1680U, 560U, 1680U, 560U, 1680U, 560U, 560U, 560U, 1680U, 560U, 560U, 560U, 1680U, 560U, 1680U, 560U, 560U, 560U, 36840 }; | |
// Command #9: INPUT BLUETOOTH | |
// Protocol: samsung36, Parameters: S=15 D=48 E=0 F=150 | |
const microseconds_t repeat_INPUT_BLUETOOTH[] PROGMEM = { 4500U, 4500U, 560U, 560U, 560U, 560U, 560U, 560U, 560U, 560U, 560U, 1680U, 560U, 1680U, 560U, 560U, 560U, 560U, 560U, 1680U, 560U, 1680U, 560U, 1680U, 560U, 1680U, 560U, 560U, 560U, 560U, 560U, 560U, 560U, 560U, 560U, 5040U, 560U, 560U, 560U, 560U, 560U, 560U, 560U, 560U, 560U, 560U, 560U, 1680U, 560U, 1680U, 560U, 560U, 560U, 1680U, 560U, 560U, 560U, 560U, 560U, 1680U, 560U, 1680U, 560U, 560U, 560U, 560U, 560U, 1680U, 560U, 560U, 560U, 1680U, 560U, 1680U, 560U, 560U, 560U, 36840 }; | |
// Command #10: INPUT DIG IN | |
// Protocol: samsung36, Parameters: S=15 D=48 E=0 F=147 | |
const microseconds_t repeat_INPUT_DIG_IN[] PROGMEM = { 4500U, 4500U, 560U, 560U, 560U, 560U, 560U, 560U, 560U, 560U, 560U, 1680U, 560U, 1680U, 560U, 560U, 560U, 560U, 560U, 1680U, 560U, 1680U, 560U, 1680U, 560U, 1680U, 560U, 560U, 560U, 560U, 560U, 560U, 560U, 560U, 560U, 5040U, 560U, 560U, 560U, 560U, 560U, 560U, 560U, 560U, 560U, 1680U, 560U, 1680U, 560U, 560U, 560U, 560U, 560U, 1680U, 560U, 560U, 560U, 560U, 560U, 1680U, 560U, 560U, 560U, 560U, 560U, 1680U, 560U, 1680U, 560U, 560U, 560U, 1680U, 560U, 1680U, 560U, 560U, 560U, 36840 }; | |
// Command #11: INPUT HDMI | |
// Protocol: samsung36, Parameters: S=15 D=48 E=0 F=151 | |
const microseconds_t repeat_INPUT_HDMI[] PROGMEM = { 4500U, 4500U, 560U, 560U, 560U, 560U, 560U, 560U, 560U, 560U, 560U, 1680U, 560U, 1680U, 560U, 560U, 560U, 560U, 560U, 1680U, 560U, 1680U, 560U, 1680U, 560U, 1680U, 560U, 560U, 560U, 560U, 560U, 560U, 560U, 560U, 560U, 5040U, 560U, 560U, 560U, 560U, 560U, 560U, 560U, 560U, 560U, 1680U, 560U, 1680U, 560U, 1680U, 560U, 560U, 560U, 1680U, 560U, 560U, 560U, 560U, 560U, 1680U, 560U, 560U, 560U, 560U, 560U, 560U, 560U, 1680U, 560U, 560U, 560U, 1680U, 560U, 1680U, 560U, 560U, 560U, 36840 }; | |
// Command #12: INPUT SCROLL | |
// Protocol: samsung36, Parameters: S=15 D=48 E=1 F=117 | |
const microseconds_t repeat_INPUT_SCROLL[] PROGMEM = { 4500U, 4500U, 560U, 560U, 560U, 560U, 560U, 560U, 560U, 560U, 560U, 1680U, 560U, 1680U, 560U, 560U, 560U, 560U, 560U, 1680U, 560U, 1680U, 560U, 1680U, 560U, 1680U, 560U, 560U, 560U, 560U, 560U, 560U, 560U, 560U, 560U, 5040U, 560U, 1680U, 560U, 560U, 560U, 560U, 560U, 560U, 560U, 1680U, 560U, 560U, 560U, 1680U, 560U, 560U, 560U, 1680U, 560U, 1680U, 560U, 1680U, 560U, 560U, 560U, 560U, 560U, 1680U, 560U, 560U, 560U, 1680U, 560U, 560U, 560U, 560U, 560U, 560U, 560U, 1680U, 560U, 35720 }; | |
// Command #13: INPUT USB | |
// Protocol: samsung36, Parameters: S=15 D=48 E=0 F=149 | |
const microseconds_t repeat_INPUT_USB[] PROGMEM = { 4500U, 4500U, 560U, 560U, 560U, 560U, 560U, 560U, 560U, 560U, 560U, 1680U, 560U, 1680U, 560U, 560U, 560U, 560U, 560U, 1680U, 560U, 1680U, 560U, 1680U, 560U, 1680U, 560U, 560U, 560U, 560U, 560U, 560U, 560U, 560U, 560U, 5040U, 560U, 560U, 560U, 560U, 560U, 560U, 560U, 560U, 560U, 1680U, 560U, 560U, 560U, 1680U, 560U, 560U, 560U, 1680U, 560U, 560U, 560U, 560U, 560U, 1680U, 560U, 560U, 560U, 1680U, 560U, 560U, 560U, 1680U, 560U, 560U, 560U, 1680U, 560U, 1680U, 560U, 560U, 560U, 36840 }; | |
// Command #14: MODE CINEMA | |
// Protocol: samsung36, Parameters: S=15 D=48 E=0 F=115 | |
const microseconds_t repeat_MODE_CINEMA[] PROGMEM = { 4500U, 4500U, 560U, 560U, 560U, 560U, 560U, 560U, 560U, 560U, 560U, 1680U, 560U, 1680U, 560U, 560U, 560U, 560U, 560U, 1680U, 560U, 1680U, 560U, 1680U, 560U, 1680U, 560U, 560U, 560U, 560U, 560U, 560U, 560U, 560U, 560U, 5040U, 560U, 560U, 560U, 560U, 560U, 560U, 560U, 560U, 560U, 1680U, 560U, 1680U, 560U, 560U, 560U, 560U, 560U, 1680U, 560U, 1680U, 560U, 1680U, 560U, 560U, 560U, 560U, 560U, 560U, 560U, 1680U, 560U, 1680U, 560U, 560U, 560U, 560U, 560U, 560U, 560U, 1680U, 560U, 36840 }; | |
// Command #15: MODE DRAMA | |
// Protocol: samsung36, Parameters: S=15 D=48 E=0 F=153 | |
const microseconds_t repeat_MODE_DRAMA[] PROGMEM = { 4500U, 4500U, 560U, 560U, 560U, 560U, 560U, 560U, 560U, 560U, 560U, 1680U, 560U, 1680U, 560U, 560U, 560U, 560U, 560U, 1680U, 560U, 1680U, 560U, 1680U, 560U, 1680U, 560U, 560U, 560U, 560U, 560U, 560U, 560U, 560U, 560U, 5040U, 560U, 560U, 560U, 560U, 560U, 560U, 560U, 560U, 560U, 1680U, 560U, 560U, 560U, 560U, 560U, 1680U, 560U, 1680U, 560U, 560U, 560U, 560U, 560U, 1680U, 560U, 560U, 560U, 1680U, 560U, 1680U, 560U, 560U, 560U, 560U, 560U, 1680U, 560U, 1680U, 560U, 560U, 560U, 36840 }; | |
// Command #16: MODE DRC | |
// Protocol: samsung36, Parameters: S=15 D=48 E=1 F=125 | |
const microseconds_t repeat_MODE_DRC[] PROGMEM = { 4500U, 4500U, 560U, 560U, 560U, 560U, 560U, 560U, 560U, 560U, 560U, 1680U, 560U, 1680U, 560U, 560U, 560U, 560U, 560U, 1680U, 560U, 1680U, 560U, 1680U, 560U, 1680U, 560U, 560U, 560U, 560U, 560U, 560U, 560U, 560U, 560U, 5040U, 560U, 1680U, 560U, 560U, 560U, 560U, 560U, 560U, 560U, 1680U, 560U, 560U, 560U, 1680U, 560U, 1680U, 560U, 1680U, 560U, 1680U, 560U, 1680U, 560U, 560U, 560U, 560U, 560U, 1680U, 560U, 560U, 560U, 560U, 560U, 560U, 560U, 560U, 560U, 560U, 560U, 1680U, 560U, 35720 }; | |
// Command #17: MODE GAME | |
// Protocol: samsung36, Parameters: S=15 D=48 E=0 F=155 | |
const microseconds_t repeat_MODE_GAME[] PROGMEM = { 4500U, 4500U, 560U, 560U, 560U, 560U, 560U, 560U, 560U, 560U, 560U, 1680U, 560U, 1680U, 560U, 560U, 560U, 560U, 560U, 1680U, 560U, 1680U, 560U, 1680U, 560U, 1680U, 560U, 560U, 560U, 560U, 560U, 560U, 560U, 560U, 560U, 5040U, 560U, 560U, 560U, 560U, 560U, 560U, 560U, 560U, 560U, 1680U, 560U, 1680U, 560U, 560U, 560U, 1680U, 560U, 1680U, 560U, 560U, 560U, 560U, 560U, 1680U, 560U, 560U, 560U, 560U, 560U, 1680U, 560U, 560U, 560U, 560U, 560U, 1680U, 560U, 1680U, 560U, 560U, 560U, 36840 }; | |
// Command #18: MODE MUSIC | |
// Protocol: samsung36, Parameters: S=15 D=48 E=0 F=116 | |
const microseconds_t repeat_MODE_MUSIC[] PROGMEM = { 4500U, 4500U, 560U, 560U, 560U, 560U, 560U, 560U, 560U, 560U, 560U, 1680U, 560U, 1680U, 560U, 560U, 560U, 560U, 560U, 1680U, 560U, 1680U, 560U, 1680U, 560U, 1680U, 560U, 560U, 560U, 560U, 560U, 560U, 560U, 560U, 560U, 5040U, 560U, 560U, 560U, 560U, 560U, 560U, 560U, 560U, 560U, 560U, 560U, 560U, 560U, 1680U, 560U, 560U, 560U, 1680U, 560U, 1680U, 560U, 1680U, 560U, 560U, 560U, 1680U, 560U, 1680U, 560U, 560U, 560U, 1680U, 560U, 560U, 560U, 560U, 560U, 560U, 560U, 1680U, 560U, 36840 }; | |
// Command #19: MODE NEWS | |
// Protocol: samsung36, Parameters: S=15 D=48 E=0 F=114 | |
const microseconds_t repeat_MODE_NEWS[] PROGMEM = { 4500U, 4500U, 560U, 560U, 560U, 560U, 560U, 560U, 560U, 560U, 560U, 1680U, 560U, 1680U, 560U, 560U, 560U, 560U, 560U, 1680U, 560U, 1680U, 560U, 1680U, 560U, 1680U, 560U, 560U, 560U, 560U, 560U, 560U, 560U, 560U, 560U, 5040U, 560U, 560U, 560U, 560U, 560U, 560U, 560U, 560U, 560U, 560U, 560U, 1680U, 560U, 560U, 560U, 560U, 560U, 1680U, 560U, 1680U, 560U, 1680U, 560U, 560U, 560U, 1680U, 560U, 560U, 560U, 1680U, 560U, 1680U, 560U, 560U, 560U, 560U, 560U, 560U, 560U, 1680U, 560U, 36840 }; | |
// Command #20: MODE NIGHT | |
// Protocol: samsung36, Parameters: S=15 D=48 E=0 F=125 | |
const microseconds_t repeat_MODE_NIGHT[] PROGMEM = { 4500U, 4500U, 560U, 560U, 560U, 560U, 560U, 560U, 560U, 560U, 560U, 1680U, 560U, 1680U, 560U, 560U, 560U, 560U, 560U, 1680U, 560U, 1680U, 560U, 1680U, 560U, 1680U, 560U, 560U, 560U, 560U, 560U, 560U, 560U, 560U, 560U, 5040U, 560U, 560U, 560U, 560U, 560U, 560U, 560U, 560U, 560U, 1680U, 560U, 560U, 560U, 1680U, 560U, 1680U, 560U, 1680U, 560U, 1680U, 560U, 1680U, 560U, 560U, 560U, 560U, 560U, 1680U, 560U, 560U, 560U, 560U, 560U, 560U, 560U, 560U, 560U, 560U, 560U, 1680U, 560U, 36840 }; | |
// Command #21: MODE SCROLL | |
// Protocol: samsung36, Parameters: S=15 D=48 E=1 F=123 | |
const microseconds_t repeat_MODE_SCROLL[] PROGMEM = { 4500U, 4500U, 560U, 560U, 560U, 560U, 560U, 560U, 560U, 560U, 560U, 1680U, 560U, 1680U, 560U, 560U, 560U, 560U, 560U, 1680U, 560U, 1680U, 560U, 1680U, 560U, 1680U, 560U, 560U, 560U, 560U, 560U, 560U, 560U, 560U, 560U, 5040U, 560U, 1680U, 560U, 560U, 560U, 560U, 560U, 560U, 560U, 1680U, 560U, 1680U, 560U, 560U, 560U, 1680U, 560U, 1680U, 560U, 1680U, 560U, 1680U, 560U, 560U, 560U, 560U, 560U, 560U, 560U, 1680U, 560U, 560U, 560U, 560U, 560U, 560U, 560U, 560U, 560U, 1680U, 560U, 35720 }; | |
// Command #22: MODE SPORTS | |
// Protocol: samsung36, Parameters: S=15 D=48 E=0 F=154 | |
const microseconds_t repeat_MODE_SPORTS[] PROGMEM = { 4500U, 4500U, 560U, 560U, 560U, 560U, 560U, 560U, 560U, 560U, 560U, 1680U, 560U, 1680U, 560U, 560U, 560U, 560U, 560U, 1680U, 560U, 1680U, 560U, 1680U, 560U, 1680U, 560U, 560U, 560U, 560U, 560U, 560U, 560U, 560U, 560U, 5040U, 560U, 560U, 560U, 560U, 560U, 560U, 560U, 560U, 560U, 560U, 560U, 1680U, 560U, 560U, 560U, 1680U, 560U, 1680U, 560U, 560U, 560U, 560U, 560U, 1680U, 560U, 1680U, 560U, 560U, 560U, 1680U, 560U, 560U, 560U, 560U, 560U, 1680U, 560U, 1680U, 560U, 560U, 560U, 36840 }; | |
// Command #23: MUTE TOGGLE | |
// Protocol: samsung36, Parameters: S=15 D=48 E=1 F=113 | |
const microseconds_t repeat_MUTE_TOGGLE[] PROGMEM = { 4500U, 4500U, 560U, 560U, 560U, 560U, 560U, 560U, 560U, 560U, 560U, 1680U, 560U, 1680U, 560U, 560U, 560U, 560U, 560U, 1680U, 560U, 1680U, 560U, 1680U, 560U, 1680U, 560U, 560U, 560U, 560U, 560U, 560U, 560U, 560U, 560U, 5040U, 560U, 1680U, 560U, 560U, 560U, 560U, 560U, 560U, 560U, 1680U, 560U, 560U, 560U, 560U, 560U, 560U, 560U, 1680U, 560U, 1680U, 560U, 1680U, 560U, 560U, 560U, 560U, 560U, 1680U, 560U, 1680U, 560U, 1680U, 560U, 560U, 560U, 560U, 560U, 560U, 560U, 1680U, 560U, 35720 }; | |
// Command #24: PLAY PAUSE TOGGLE | |
// Protocol: samsung36, Parameters: S=15 D=48 E=1 F=138 | |
const microseconds_t repeat_PLAY_PAUSE_TOGGLE[] PROGMEM = { 4500U, 4500U, 560U, 560U, 560U, 560U, 560U, 560U, 560U, 560U, 560U, 1680U, 560U, 1680U, 560U, 560U, 560U, 560U, 560U, 1680U, 560U, 1680U, 560U, 1680U, 560U, 1680U, 560U, 560U, 560U, 560U, 560U, 560U, 560U, 560U, 560U, 5040U, 560U, 1680U, 560U, 560U, 560U, 560U, 560U, 560U, 560U, 560U, 560U, 1680U, 560U, 560U, 560U, 1680U, 560U, 560U, 560U, 560U, 560U, 560U, 560U, 1680U, 560U, 1680U, 560U, 560U, 560U, 1680U, 560U, 560U, 560U, 1680U, 560U, 1680U, 560U, 1680U, 560U, 560U, 560U, 35720 }; | |
// Command #25: POWER TOGGLE | |
// Protocol: samsung36, Parameters: S=15 D=48 E=1 F=112 | |
const microseconds_t repeat_POWER_TOGGLE[] PROGMEM = { 4500U, 4500U, 560U, 560U, 560U, 560U, 560U, 560U, 560U, 560U, 560U, 1680U, 560U, 1680U, 560U, 560U, 560U, 560U, 560U, 1680U, 560U, 1680U, 560U, 1680U, 560U, 1680U, 560U, 560U, 560U, 560U, 560U, 560U, 560U, 560U, 560U, 5040U, 560U, 1680U, 560U, 560U, 560U, 560U, 560U, 560U, 560U, 560U, 560U, 560U, 560U, 560U, 560U, 560U, 560U, 1680U, 560U, 1680U, 560U, 1680U, 560U, 560U, 560U, 1680U, 560U, 1680U, 560U, 1680U, 560U, 1680U, 560U, 560U, 560U, 560U, 560U, 560U, 560U, 1680U, 560U, 35720 }; | |
// Command #26: REPEAT | |
// Protocol: samsung36, Parameters: S=15 D=48 E=1 F=137 | |
const microseconds_t repeat_REPEAT[] PROGMEM = { 4500U, 4500U, 560U, 560U, 560U, 560U, 560U, 560U, 560U, 560U, 560U, 1680U, 560U, 1680U, 560U, 560U, 560U, 560U, 560U, 1680U, 560U, 1680U, 560U, 1680U, 560U, 1680U, 560U, 560U, 560U, 560U, 560U, 560U, 560U, 560U, 560U, 5040U, 560U, 1680U, 560U, 560U, 560U, 560U, 560U, 560U, 560U, 1680U, 560U, 560U, 560U, 560U, 560U, 1680U, 560U, 560U, 560U, 560U, 560U, 560U, 560U, 1680U, 560U, 560U, 560U, 1680U, 560U, 1680U, 560U, 560U, 560U, 1680U, 560U, 1680U, 560U, 1680U, 560U, 560U, 560U, 35720 }; | |
// Command #27: REVERSE/PREVIOUS | |
// Protocol: samsung36, Parameters: S=15 D=48 E=1 F=139 | |
const microseconds_t repeat_REVERSE_PREVIOUS[] PROGMEM = { 4500U, 4500U, 560U, 560U, 560U, 560U, 560U, 560U, 560U, 560U, 560U, 1680U, 560U, 1680U, 560U, 560U, 560U, 560U, 560U, 1680U, 560U, 1680U, 560U, 1680U, 560U, 1680U, 560U, 560U, 560U, 560U, 560U, 560U, 560U, 560U, 560U, 5040U, 560U, 1680U, 560U, 560U, 560U, 560U, 560U, 560U, 560U, 1680U, 560U, 1680U, 560U, 560U, 560U, 1680U, 560U, 560U, 560U, 560U, 560U, 560U, 560U, 1680U, 560U, 560U, 560U, 560U, 560U, 1680U, 560U, 560U, 560U, 1680U, 560U, 1680U, 560U, 1680U, 560U, 560U, 560U, 35720 }; | |
// Command #28: SMART VOLUME | |
// Protocol: samsung36, Parameters: S=15 D=48 E=0 F=124 | |
const microseconds_t repeat_SMART_VOLUME[] PROGMEM = { 4500U, 4500U, 560U, 560U, 560U, 560U, 560U, 560U, 560U, 560U, 560U, 1680U, 560U, 1680U, 560U, 560U, 560U, 560U, 560U, 1680U, 560U, 1680U, 560U, 1680U, 560U, 1680U, 560U, 560U, 560U, 560U, 560U, 560U, 560U, 560U, 560U, 5040U, 560U, 560U, 560U, 560U, 560U, 560U, 560U, 560U, 560U, 560U, 560U, 560U, 560U, 1680U, 560U, 1680U, 560U, 1680U, 560U, 1680U, 560U, 1680U, 560U, 560U, 560U, 1680U, 560U, 1680U, 560U, 560U, 560U, 560U, 560U, 560U, 560U, 560U, 560U, 560U, 560U, 1680U, 560U, 36840 }; | |
// Command #29: SOUND SHARE | |
// Protocol: samsung36, Parameters: S=15 D=48 E=0 F=145 | |
const microseconds_t repeat_SOUND_SHARE[] PROGMEM = { 4500U, 4500U, 560U, 560U, 560U, 560U, 560U, 560U, 560U, 560U, 560U, 1680U, 560U, 1680U, 560U, 560U, 560U, 560U, 560U, 1680U, 560U, 1680U, 560U, 1680U, 560U, 1680U, 560U, 560U, 560U, 560U, 560U, 560U, 560U, 560U, 560U, 5040U, 560U, 560U, 560U, 560U, 560U, 560U, 560U, 560U, 560U, 1680U, 560U, 560U, 560U, 560U, 560U, 560U, 560U, 1680U, 560U, 560U, 560U, 560U, 560U, 1680U, 560U, 560U, 560U, 1680U, 560U, 1680U, 560U, 1680U, 560U, 560U, 560U, 1680U, 560U, 1680U, 560U, 560U, 560U, 36840 }; | |
// Command #30: SPEAKER | |
// Protocol: samsung36, Parameters: S=15 D=48 E=1 F=136 | |
const microseconds_t repeat_SPEAKER[] PROGMEM = { 4500U, 4500U, 560U, 560U, 560U, 560U, 560U, 560U, 560U, 560U, 560U, 1680U, 560U, 1680U, 560U, 560U, 560U, 560U, 560U, 1680U, 560U, 1680U, 560U, 1680U, 560U, 1680U, 560U, 560U, 560U, 560U, 560U, 560U, 560U, 560U, 560U, 5040U, 560U, 1680U, 560U, 560U, 560U, 560U, 560U, 560U, 560U, 560U, 560U, 560U, 560U, 560U, 560U, 1680U, 560U, 560U, 560U, 560U, 560U, 560U, 560U, 1680U, 560U, 1680U, 560U, 1680U, 560U, 1680U, 560U, 560U, 560U, 1680U, 560U, 1680U, 560U, 1680U, 560U, 560U, 560U, 35720 }; | |
// Command #31: STOP | |
// Protocol: samsung36, Parameters: S=15 D=48 E=1 F=141 | |
const microseconds_t repeat_STOP[] PROGMEM = { 4500U, 4500U, 560U, 560U, 560U, 560U, 560U, 560U, 560U, 560U, 560U, 1680U, 560U, 1680U, 560U, 560U, 560U, 560U, 560U, 1680U, 560U, 1680U, 560U, 1680U, 560U, 1680U, 560U, 560U, 560U, 560U, 560U, 560U, 560U, 560U, 560U, 5040U, 560U, 1680U, 560U, 560U, 560U, 560U, 560U, 560U, 560U, 1680U, 560U, 560U, 560U, 1680U, 560U, 1680U, 560U, 560U, 560U, 560U, 560U, 560U, 560U, 1680U, 560U, 560U, 560U, 1680U, 560U, 560U, 560U, 560U, 560U, 1680U, 560U, 1680U, 560U, 1680U, 560U, 560U, 560U, 35720 }; | |
// Command #32: SUBWOOFER LEVEL DOWN | |
// Protocol: samsung36, Parameters: S=15 D=48 E=1 F=131 | |
const microseconds_t repeat_SUBWOOFER_LEVEL_DOWN[] PROGMEM = { 4500U, 4500U, 560U, 560U, 560U, 560U, 560U, 560U, 560U, 560U, 560U, 1680U, 560U, 1680U, 560U, 560U, 560U, 560U, 560U, 1680U, 560U, 1680U, 560U, 1680U, 560U, 1680U, 560U, 560U, 560U, 560U, 560U, 560U, 560U, 560U, 560U, 5040U, 560U, 1680U, 560U, 560U, 560U, 560U, 560U, 560U, 560U, 1680U, 560U, 1680U, 560U, 560U, 560U, 560U, 560U, 560U, 560U, 560U, 560U, 560U, 560U, 1680U, 560U, 560U, 560U, 560U, 560U, 1680U, 560U, 1680U, 560U, 1680U, 560U, 1680U, 560U, 1680U, 560U, 560U, 560U, 35720 }; | |
// Command #33: SUBWOOFER LEVEL UP | |
// Protocol: samsung36, Parameters: S=15 D=48 E=1 F=130 | |
const microseconds_t repeat_SUBWOOFER_LEVEL_UP[] PROGMEM = { 4500U, 4500U, 560U, 560U, 560U, 560U, 560U, 560U, 560U, 560U, 560U, 1680U, 560U, 1680U, 560U, 560U, 560U, 560U, 560U, 1680U, 560U, 1680U, 560U, 1680U, 560U, 1680U, 560U, 560U, 560U, 560U, 560U, 560U, 560U, 560U, 560U, 5040U, 560U, 1680U, 560U, 560U, 560U, 560U, 560U, 560U, 560U, 560U, 560U, 1680U, 560U, 560U, 560U, 560U, 560U, 560U, 560U, 560U, 560U, 560U, 560U, 1680U, 560U, 1680U, 560U, 560U, 560U, 1680U, 560U, 1680U, 560U, 1680U, 560U, 1680U, 560U, 1680U, 560U, 560U, 560U, 35720 }; | |
// Command #34: VOLUME DOWN | |
// Protocol: samsung36, Parameters: S=15 D=48 E=1 F=120 | |
const microseconds_t repeat_VOLUME_DOWN[] PROGMEM = { 4500U, 4500U, 560U, 560U, 560U, 560U, 560U, 560U, 560U, 560U, 560U, 1680U, 560U, 1680U, 560U, 560U, 560U, 560U, 560U, 1680U, 560U, 1680U, 560U, 1680U, 560U, 1680U, 560U, 560U, 560U, 560U, 560U, 560U, 560U, 560U, 560U, 5040U, 560U, 1680U, 560U, 560U, 560U, 560U, 560U, 560U, 560U, 560U, 560U, 560U, 560U, 560U, 560U, 1680U, 560U, 1680U, 560U, 1680U, 560U, 1680U, 560U, 560U, 560U, 1680U, 560U, 1680U, 560U, 1680U, 560U, 560U, 560U, 560U, 560U, 560U, 560U, 560U, 560U, 1680U, 560U, 35720 }; | |
// Command #35: VOLUME UP | |
// Protocol: samsung36, Parameters: S=15 D=48 E=1 F=119 | |
const microseconds_t repeat_VOLUME_UP[] PROGMEM = { 4500U, 4500U, 560U, 560U, 560U, 560U, 560U, 560U, 560U, 560U, 560U, 1680U, 560U, 1680U, 560U, 560U, 560U, 560U, 560U, 1680U, 560U, 1680U, 560U, 1680U, 560U, 1680U, 560U, 560U, 560U, 560U, 560U, 560U, 560U, 560U, 560U, 5040U, 560U, 1680U, 560U, 560U, 560U, 560U, 560U, 560U, 560U, 1680U, 560U, 1680U, 560U, 1680U, 560U, 560U, 560U, 1680U, 560U, 1680U, 560U, 1680U, 560U, 560U, 560U, 560U, 560U, 560U, 560U, 560U, 560U, 1680U, 560U, 560U, 560U, 560U, 560U, 560U, 560U, 1680U, 560U, 35720 }; | |
// Command #36: VT DIMMER | |
// Protocol: samsung36, Parameters: S=15 D=48 E=0 F=144 | |
const microseconds_t repeat_VT_DIMMER[] PROGMEM = { 4500U, 4500U, 560U, 560U, 560U, 560U, 560U, 560U, 560U, 560U, 560U, 1680U, 560U, 1680U, 560U, 560U, 560U, 560U, 560U, 1680U, 560U, 1680U, 560U, 1680U, 560U, 1680U, 560U, 560U, 560U, 560U, 560U, 560U, 560U, 560U, 560U, 5040U, 560U, 560U, 560U, 560U, 560U, 560U, 560U, 560U, 560U, 560U, 560U, 560U, 560U, 560U, 560U, 560U, 560U, 1680U, 560U, 560U, 560U, 560U, 560U, 1680U, 560U, 1680U, 560U, 1680U, 560U, 1680U, 560U, 1680U, 560U, 560U, 560U, 1680U, 560U, 1680U, 560U, 560U, 560U, 36840 }; | |
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 .. 36)")); | |
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__3D_SOUND_PLUS, 78U, 37900U, times); | |
break; | |
case 2U: | |
sendRaw(NULL, 0U, repeat_ANYNET_PLUS, 78U, 37900U, times); | |
break; | |
case 3U: | |
sendRaw(NULL, 0U, repeat_ASC, 78U, 37900U, times); | |
break; | |
case 4U: | |
sendRaw(NULL, 0U, repeat_AUDIO_SYNC_DOWN, 78U, 37900U, times); | |
break; | |
case 5U: | |
sendRaw(NULL, 0U, repeat_AUDIO_SYNC_UP, 78U, 37900U, times); | |
break; | |
case 6U: | |
sendRaw(NULL, 0U, repeat_AUTO_POWER, 78U, 37900U, times); | |
break; | |
case 7U: | |
sendRaw(NULL, 0U, repeat_FORWARD_NEXT, 78U, 37900U, times); | |
break; | |
case 8U: | |
sendRaw(NULL, 0U, repeat_INPUT_AUX, 78U, 37900U, times); | |
break; | |
case 9U: | |
sendRaw(NULL, 0U, repeat_INPUT_BLUETOOTH, 78U, 37900U, times); | |
break; | |
case 10U: | |
sendRaw(NULL, 0U, repeat_INPUT_DIG_IN, 78U, 37900U, times); | |
break; | |
case 11U: | |
sendRaw(NULL, 0U, repeat_INPUT_HDMI, 78U, 37900U, times); | |
break; | |
case 12U: | |
sendRaw(NULL, 0U, repeat_INPUT_SCROLL, 78U, 37900U, times); | |
break; | |
case 13U: | |
sendRaw(NULL, 0U, repeat_INPUT_USB, 78U, 37900U, times); | |
break; | |
case 14U: | |
sendRaw(NULL, 0U, repeat_MODE_CINEMA, 78U, 37900U, times); | |
break; | |
case 15U: | |
sendRaw(NULL, 0U, repeat_MODE_DRAMA, 78U, 37900U, times); | |
break; | |
case 16U: | |
sendRaw(NULL, 0U, repeat_MODE_DRC, 78U, 37900U, times); | |
break; | |
case 17U: | |
sendRaw(NULL, 0U, repeat_MODE_GAME, 78U, 37900U, times); | |
break; | |
case 18U: | |
sendRaw(NULL, 0U, repeat_MODE_MUSIC, 78U, 37900U, times); | |
break; | |
case 19U: | |
sendRaw(NULL, 0U, repeat_MODE_NEWS, 78U, 37900U, times); | |
break; | |
case 20U: | |
sendRaw(NULL, 0U, repeat_MODE_NIGHT, 78U, 37900U, times); | |
break; | |
case 21U: | |
sendRaw(NULL, 0U, repeat_MODE_SCROLL, 78U, 37900U, times); | |
break; | |
case 22U: | |
sendRaw(NULL, 0U, repeat_MODE_SPORTS, 78U, 37900U, times); | |
break; | |
case 23U: | |
sendRaw(NULL, 0U, repeat_MUTE_TOGGLE, 78U, 37900U, times); | |
break; | |
case 24U: | |
sendRaw(NULL, 0U, repeat_PLAY_PAUSE_TOGGLE, 78U, 37900U, times); | |
break; | |
case 25U: | |
sendRaw(NULL, 0U, repeat_POWER_TOGGLE, 78U, 37900U, times); | |
break; | |
case 26U: | |
sendRaw(NULL, 0U, repeat_REPEAT, 78U, 37900U, times); | |
break; | |
case 27U: | |
sendRaw(NULL, 0U, repeat_REVERSE_PREVIOUS, 78U, 37900U, times); | |
break; | |
case 28U: | |
sendRaw(NULL, 0U, repeat_SMART_VOLUME, 78U, 37900U, times); | |
break; | |
case 29U: | |
sendRaw(NULL, 0U, repeat_SOUND_SHARE, 78U, 37900U, times); | |
break; | |
case 30U: | |
sendRaw(NULL, 0U, repeat_SPEAKER, 78U, 37900U, times); | |
break; | |
case 31U: | |
sendRaw(NULL, 0U, repeat_STOP, 78U, 37900U, times); | |
break; | |
case 32U: | |
sendRaw(NULL, 0U, repeat_SUBWOOFER_LEVEL_DOWN, 78U, 37900U, times); | |
break; | |
case 33U: | |
sendRaw(NULL, 0U, repeat_SUBWOOFER_LEVEL_UP, 78U, 37900U, times); | |
break; | |
case 34U: | |
sendRaw(NULL, 0U, repeat_VOLUME_DOWN, 78U, 37900U, times); | |
break; | |
case 35U: | |
sendRaw(NULL, 0U, repeat_VOLUME_UP, 78U, 37900U, times); | |
break; | |
case 36U: | |
sendRaw(NULL, 0U, repeat_VT_DIMMER, 78U, 37900U, 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