Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save cyber-junkie9/f8f08fa7b8c53e7c0a6ede8f9359300b to your computer and use it in GitHub Desktop.
Save cyber-junkie9/f8f08fa7b8c53e7c0a6ede8f9359300b to your computer and use it in GitHub Desktop.
IRremote code for Airtel STB
// 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: CHANNEL DOWN
// Protocol: nokia32, Parameters: X=38 S=0 D=38 T=0 F=33
const microseconds_t repeat_CHANNEL_DOWN[] PROGMEM = { 417U, 278U, 167U, 278U, 167U, 611U, 167U, 444U, 167U, 611U, 167U, 278U, 167U, 278U, 167U, 278U, 167U, 278U, 167U, 278U, 167U, 611U, 167U, 444U, 167U, 611U, 167U, 278U, 167U, 611U, 167U, 278U, 167U, 444U, 167U, 65535U };
// Command #2: CHANNEL UP
// Protocol: nokia32, Parameters: X=38 S=0 D=38 T=0 F=32
const microseconds_t repeat_CHANNEL_UP[] PROGMEM = { 417U, 278U, 167U, 278U, 167U, 611U, 167U, 444U, 167U, 611U, 167U, 278U, 167U, 278U, 167U, 278U, 167U, 278U, 167U, 278U, 167U, 611U, 167U, 444U, 167U, 611U, 167U, 278U, 167U, 611U, 167U, 278U, 167U, 278U, 167U, 65535U };
// Command #3: CURSOR DOWN
// Protocol: nokia32, Parameters: X=38 S=0 D=38 T=0 F=89
const microseconds_t repeat_CURSOR_DOWN[] PROGMEM = { 417U, 278U, 167U, 278U, 167U, 611U, 167U, 444U, 167U, 611U, 167U, 278U, 167U, 278U, 167U, 278U, 167U, 278U, 167U, 278U, 167U, 611U, 167U, 444U, 167U, 611U, 167U, 444U, 167U, 444U, 167U, 611U, 167U, 444U, 167U, 65535U };
// Command #4: CURSOR ENTER
// Protocol: nokia32, Parameters: X=38 S=0 D=38 T=0 F=92
const microseconds_t repeat_CURSOR_ENTER[] PROGMEM = { 417U, 278U, 167U, 278U, 167U, 611U, 167U, 444U, 167U, 611U, 167U, 278U, 167U, 278U, 167U, 278U, 167U, 278U, 167U, 278U, 167U, 611U, 167U, 444U, 167U, 611U, 167U, 444U, 167U, 444U, 167U, 778U, 167U, 278U, 167U, 65535U };
// Command #5: CURSOR LEFT
// Protocol: nokia32, Parameters: X=38 S=0 D=38 T=0 F=90
const microseconds_t repeat_CURSOR_LEFT[] PROGMEM = { 417U, 278U, 167U, 278U, 167U, 611U, 167U, 444U, 167U, 611U, 167U, 278U, 167U, 278U, 167U, 278U, 167U, 278U, 167U, 278U, 167U, 611U, 167U, 444U, 167U, 611U, 167U, 444U, 167U, 444U, 167U, 611U, 167U, 611U, 167U, 65535U };
// Command #6: CURSOR RIGHT
// Protocol: nokia32, Parameters: X=38 S=0 D=38 T=0 F=91
const microseconds_t repeat_CURSOR_RIGHT[] PROGMEM = { 417U, 278U, 167U, 278U, 167U, 611U, 167U, 444U, 167U, 611U, 167U, 278U, 167U, 278U, 167U, 278U, 167U, 278U, 167U, 278U, 167U, 611U, 167U, 444U, 167U, 611U, 167U, 444U, 167U, 444U, 167U, 611U, 167U, 778U, 167U, 65535U };
// Command #7: CURSOR UP
// Protocol: nokia32, Parameters: X=38 S=0 D=38 T=0 F=88
const microseconds_t repeat_CURSOR_UP[] PROGMEM = { 417U, 278U, 167U, 278U, 167U, 611U, 167U, 444U, 167U, 611U, 167U, 278U, 167U, 278U, 167U, 278U, 167U, 278U, 167U, 278U, 167U, 611U, 167U, 444U, 167U, 611U, 167U, 444U, 167U, 444U, 167U, 611U, 167U, 278U, 167U, 65535U };
// Command #8: DIGIT 0
// Protocol: nokia32, Parameters: X=38 S=0 D=38 T=0 F=0
const microseconds_t repeat_DIGIT_0[] PROGMEM = { 417U, 278U, 167U, 278U, 167U, 611U, 167U, 444U, 167U, 611U, 167U, 278U, 167U, 278U, 167U, 278U, 167U, 278U, 167U, 278U, 167U, 611U, 167U, 444U, 167U, 611U, 167U, 278U, 167U, 278U, 167U, 278U, 167U, 278U, 167U, 65535U };
// Command #9: DIGIT 1
// Protocol: nokia32, Parameters: X=38 S=0 D=38 T=0 F=1
const microseconds_t repeat_DIGIT_1[] PROGMEM = { 417U, 278U, 167U, 278U, 167U, 611U, 167U, 444U, 167U, 611U, 167U, 278U, 167U, 278U, 167U, 278U, 167U, 278U, 167U, 278U, 167U, 611U, 167U, 444U, 167U, 611U, 167U, 278U, 167U, 278U, 167U, 278U, 167U, 444U, 167U, 65535U };
// Command #10: DIGIT 2
// Protocol: nokia32, Parameters: X=38 S=0 D=38 T=0 F=2
const microseconds_t repeat_DIGIT_2[] PROGMEM = { 417U, 278U, 167U, 278U, 167U, 611U, 167U, 444U, 167U, 611U, 167U, 278U, 167U, 278U, 167U, 278U, 167U, 278U, 167U, 278U, 167U, 611U, 167U, 444U, 167U, 611U, 167U, 278U, 167U, 278U, 167U, 278U, 167U, 611U, 167U, 65535U };
// Command #11: DIGIT 3
// Protocol: nokia32, Parameters: X=38 S=0 D=38 T=0 F=3
const microseconds_t repeat_DIGIT_3[] PROGMEM = { 417U, 278U, 167U, 278U, 167U, 611U, 167U, 444U, 167U, 611U, 167U, 278U, 167U, 278U, 167U, 278U, 167U, 278U, 167U, 278U, 167U, 611U, 167U, 444U, 167U, 611U, 167U, 278U, 167U, 278U, 167U, 278U, 167U, 778U, 167U, 65535U };
// Command #12: DIGIT 4
// Protocol: nokia32, Parameters: X=38 S=0 D=38 T=0 F=4
const microseconds_t repeat_DIGIT_4[] PROGMEM = { 417U, 278U, 167U, 278U, 167U, 611U, 167U, 444U, 167U, 611U, 167U, 278U, 167U, 278U, 167U, 278U, 167U, 278U, 167U, 278U, 167U, 611U, 167U, 444U, 167U, 611U, 167U, 278U, 167U, 278U, 167U, 444U, 167U, 278U, 167U, 65535U };
// Command #13: DIGIT 5
// Protocol: nokia32, Parameters: X=38 S=0 D=38 T=0 F=5
const microseconds_t repeat_DIGIT_5[] PROGMEM = { 417U, 278U, 167U, 278U, 167U, 611U, 167U, 444U, 167U, 611U, 167U, 278U, 167U, 278U, 167U, 278U, 167U, 278U, 167U, 278U, 167U, 611U, 167U, 444U, 167U, 611U, 167U, 278U, 167U, 278U, 167U, 444U, 167U, 444U, 167U, 65535U };
// Command #14: DIGIT 6
// Protocol: nokia32, Parameters: X=38 S=0 D=38 T=0 F=6
const microseconds_t repeat_DIGIT_6[] PROGMEM = { 417U, 278U, 167U, 278U, 167U, 611U, 167U, 444U, 167U, 611U, 167U, 278U, 167U, 278U, 167U, 278U, 167U, 278U, 167U, 278U, 167U, 611U, 167U, 444U, 167U, 611U, 167U, 278U, 167U, 278U, 167U, 444U, 167U, 611U, 167U, 65535U };
// Command #15: DIGIT 7
// Protocol: nokia32, Parameters: X=38 S=0 D=38 T=0 F=7
const microseconds_t repeat_DIGIT_7[] PROGMEM = { 417U, 278U, 167U, 278U, 167U, 611U, 167U, 444U, 167U, 611U, 167U, 278U, 167U, 278U, 167U, 278U, 167U, 278U, 167U, 278U, 167U, 611U, 167U, 444U, 167U, 611U, 167U, 278U, 167U, 278U, 167U, 444U, 167U, 778U, 167U, 65535U };
// Command #16: DIGIT 8
// Protocol: nokia32, Parameters: X=38 S=0 D=38 T=0 F=8
const microseconds_t repeat_DIGIT_8[] PROGMEM = { 417U, 278U, 167U, 278U, 167U, 611U, 167U, 444U, 167U, 611U, 167U, 278U, 167U, 278U, 167U, 278U, 167U, 278U, 167U, 278U, 167U, 611U, 167U, 444U, 167U, 611U, 167U, 278U, 167U, 278U, 167U, 611U, 167U, 278U, 167U, 65535U };
// Command #17: DIGIT 9
// Protocol: nokia32, Parameters: X=38 S=0 D=38 T=0 F=9
const microseconds_t repeat_DIGIT_9[] PROGMEM = { 417U, 278U, 167U, 278U, 167U, 611U, 167U, 444U, 167U, 611U, 167U, 278U, 167U, 278U, 167U, 278U, 167U, 278U, 167U, 278U, 167U, 611U, 167U, 444U, 167U, 611U, 167U, 278U, 167U, 278U, 167U, 611U, 167U, 444U, 167U, 65535U };
// Command #18: EXIT
// Protocol: nokia32, Parameters: X=38 S=0 D=38 T=0 F=21
const microseconds_t repeat_EXIT[] PROGMEM = { 417U, 278U, 167U, 278U, 167U, 611U, 167U, 444U, 167U, 611U, 167U, 278U, 167U, 278U, 167U, 278U, 167U, 278U, 167U, 278U, 167U, 611U, 167U, 444U, 167U, 611U, 167U, 278U, 167U, 444U, 167U, 444U, 167U, 444U, 167U, 65535U };
// Command #19: FAVORITE
// Protocol: nokia32, Parameters: X=38 S=0 D=38 T=0 F=132
const microseconds_t repeat_FAVORITE[] PROGMEM = { 417U, 278U, 167U, 278U, 167U, 611U, 167U, 444U, 167U, 611U, 167U, 278U, 167U, 278U, 167U, 278U, 167U, 278U, 167U, 278U, 167U, 611U, 167U, 444U, 167U, 611U, 167U, 611U, 167U, 278U, 167U, 444U, 167U, 278U, 167U, 65535U };
// Command #20: FORWARD
// Protocol: nokia32, Parameters: X=38 S=0 D=38 T=0 F=40
const microseconds_t repeat_FORWARD[] PROGMEM = { 417U, 278U, 167U, 278U, 167U, 611U, 167U, 444U, 167U, 611U, 167U, 278U, 167U, 278U, 167U, 278U, 167U, 278U, 167U, 278U, 167U, 611U, 167U, 444U, 167U, 611U, 167U, 278U, 167U, 611U, 167U, 611U, 167U, 278U, 167U, 65535U };
// Command #21: FUNCTION BLUE
// Protocol: nokia32, Parameters: X=38 S=0 D=38 T=0 F=193
const microseconds_t repeat_FUNCTION_BLUE[] PROGMEM = { 417U, 278U, 167U, 278U, 167U, 611U, 167U, 444U, 167U, 611U, 167U, 278U, 167U, 278U, 167U, 278U, 167U, 278U, 167U, 278U, 167U, 611U, 167U, 444U, 167U, 611U, 167U, 778U, 167U, 278U, 167U, 278U, 167U, 444U, 167U, 65535U };
// Command #22: FUNCTION GREEN
// Protocol: nokia32, Parameters: X=38 S=0 D=38 T=0 F=191
const microseconds_t repeat_FUNCTION_GREEN[] PROGMEM = { 417U, 278U, 167U, 278U, 167U, 611U, 167U, 444U, 167U, 611U, 167U, 278U, 167U, 278U, 167U, 278U, 167U, 278U, 167U, 278U, 167U, 611U, 167U, 444U, 167U, 611U, 167U, 611U, 167U, 778U, 167U, 778U, 167U, 778U, 167U, 65535U };
// Command #23: FUNCTION RED
// Protocol: nokia32, Parameters: X=38 S=0 D=38 T=0 F=190
const microseconds_t repeat_FUNCTION_RED[] PROGMEM = { 417U, 278U, 167U, 278U, 167U, 611U, 167U, 444U, 167U, 611U, 167U, 278U, 167U, 278U, 167U, 278U, 167U, 278U, 167U, 278U, 167U, 611U, 167U, 444U, 167U, 611U, 167U, 611U, 167U, 778U, 167U, 778U, 167U, 611U, 167U, 65535U };
// Command #24: FUNCTION YELLOW
// Protocol: nokia32, Parameters: X=38 S=0 D=38 T=0 F=192
const microseconds_t repeat_FUNCTION_YELLOW[] PROGMEM = { 417U, 278U, 167U, 278U, 167U, 611U, 167U, 444U, 167U, 611U, 167U, 278U, 167U, 278U, 167U, 278U, 167U, 278U, 167U, 278U, 167U, 611U, 167U, 444U, 167U, 611U, 167U, 778U, 167U, 278U, 167U, 278U, 167U, 278U, 167U, 65535U };
// Command #25: GAMES
// Protocol: nokia32, Parameters: X=38 S=0 D=38 T=0 F=22
const microseconds_t repeat_GAMES[] PROGMEM = { 417U, 278U, 167U, 278U, 167U, 611U, 167U, 444U, 167U, 611U, 167U, 278U, 167U, 278U, 167U, 278U, 167U, 278U, 167U, 278U, 167U, 611U, 167U, 444U, 167U, 611U, 167U, 278U, 167U, 444U, 167U, 444U, 167U, 611U, 167U, 65535U };
// Command #26: GUIDE
// Protocol: nokia32, Parameters: X=38 S=0 D=38 T=0 F=129
const microseconds_t repeat_GUIDE[] PROGMEM = { 417U, 278U, 167U, 278U, 167U, 611U, 167U, 444U, 167U, 611U, 167U, 278U, 167U, 278U, 167U, 278U, 167U, 278U, 167U, 278U, 167U, 611U, 167U, 444U, 167U, 611U, 167U, 611U, 167U, 278U, 167U, 278U, 167U, 444U, 167U, 65535U };
// Command #27: INFO
// Protocol: nokia32, Parameters: X=38 S=0 D=38 T=0 F=203
const microseconds_t repeat_INFO[] PROGMEM = { 417U, 278U, 167U, 278U, 167U, 611U, 167U, 444U, 167U, 611U, 167U, 278U, 167U, 278U, 167U, 278U, 167U, 278U, 167U, 278U, 167U, 611U, 167U, 444U, 167U, 611U, 167U, 778U, 167U, 278U, 167U, 611U, 167U, 778U, 167U, 65535U };
// Command #28: ITV
// Protocol: nokia32, Parameters: X=38 S=0 D=38 T=0 F=19
const microseconds_t repeat_ITV[] PROGMEM = { 417U, 278U, 167U, 278U, 167U, 611U, 167U, 444U, 167U, 611U, 167U, 278U, 167U, 278U, 167U, 278U, 167U, 278U, 167U, 278U, 167U, 611U, 167U, 444U, 167U, 611U, 167U, 278U, 167U, 444U, 167U, 278U, 167U, 778U, 167U, 65535U };
// Command #29: LIVE TV
// Protocol: nokia32, Parameters: X=38 S=0 D=38 T=0 F=18
const microseconds_t repeat_LIVE_TV[] PROGMEM = { 417U, 278U, 167U, 278U, 167U, 611U, 167U, 444U, 167U, 611U, 167U, 278U, 167U, 278U, 167U, 278U, 167U, 278U, 167U, 278U, 167U, 611U, 167U, 444U, 167U, 611U, 167U, 278U, 167U, 444U, 167U, 278U, 167U, 611U, 167U, 65535U };
// Command #30: MENU DVR
// Protocol: nokia32, Parameters: X=38 S=0 D=38 T=0 F=208
const microseconds_t repeat_MENU_DVR[] PROGMEM = { 417U, 278U, 167U, 278U, 167U, 611U, 167U, 444U, 167U, 611U, 167U, 278U, 167U, 278U, 167U, 278U, 167U, 278U, 167U, 278U, 167U, 611U, 167U, 444U, 167U, 611U, 167U, 778U, 167U, 444U, 167U, 278U, 167U, 278U, 167U, 65535U };
// Command #31: MENU MAIN
// Protocol: nokia32, Parameters: X=38 S=0 D=38 T=0 F=84
const microseconds_t repeat_MENU_MAIN[] PROGMEM = { 417U, 278U, 167U, 278U, 167U, 611U, 167U, 444U, 167U, 611U, 167U, 278U, 167U, 278U, 167U, 278U, 167U, 278U, 167U, 278U, 167U, 611U, 167U, 444U, 167U, 611U, 167U, 444U, 167U, 444U, 167U, 444U, 167U, 278U, 167U, 65535U };
// Command #32: MUTE TOGGLE
// Protocol: nokia32, Parameters: X=38 S=0 D=38 T=0 F=13
const microseconds_t repeat_MUTE_TOGGLE[] PROGMEM = { 417U, 278U, 167U, 278U, 167U, 611U, 167U, 444U, 167U, 611U, 167U, 278U, 167U, 278U, 167U, 278U, 167U, 278U, 167U, 278U, 167U, 611U, 167U, 444U, 167U, 611U, 167U, 278U, 167U, 278U, 167U, 778U, 167U, 444U, 167U, 65535U };
// Command #33: PAUSE
// Protocol: nokia32, Parameters: X=38 S=0 D=38 T=0 F=48
const microseconds_t repeat_PAUSE[] PROGMEM = { 417U, 278U, 167U, 278U, 167U, 611U, 167U, 444U, 167U, 611U, 167U, 278U, 167U, 278U, 167U, 278U, 167U, 278U, 167U, 278U, 167U, 611U, 167U, 444U, 167U, 611U, 167U, 278U, 167U, 778U, 167U, 278U, 167U, 278U, 167U, 65535U };
// Command #34: PLAY
// Protocol: nokia32, Parameters: X=38 S=0 D=38 T=0 F=44
const microseconds_t repeat_PLAY[] PROGMEM = { 417U, 278U, 167U, 278U, 167U, 611U, 167U, 444U, 167U, 611U, 167U, 278U, 167U, 278U, 167U, 278U, 167U, 278U, 167U, 278U, 167U, 611U, 167U, 444U, 167U, 611U, 167U, 278U, 167U, 611U, 167U, 778U, 167U, 278U, 167U, 65535U };
// Command #35: POWER TOGGLE
// Protocol: nokia32, Parameters: X=38 S=0 D=38 T=0 F=12
const microseconds_t repeat_POWER_TOGGLE[] PROGMEM = { 417U, 278U, 167U, 278U, 167U, 611U, 167U, 444U, 167U, 611U, 167U, 278U, 167U, 278U, 167U, 278U, 167U, 278U, 167U, 278U, 167U, 611U, 167U, 444U, 167U, 611U, 167U, 278U, 167U, 278U, 167U, 778U, 167U, 278U, 167U, 65535U };
// Command #36: PREVIOUS CHANNEL
// Protocol: nokia32, Parameters: X=38 S=0 D=38 T=0 F=131
const microseconds_t repeat_PREVIOUS_CHANNEL[] PROGMEM = { 417U, 278U, 167U, 278U, 167U, 611U, 167U, 444U, 167U, 611U, 167U, 278U, 167U, 278U, 167U, 278U, 167U, 278U, 167U, 278U, 167U, 611U, 167U, 444U, 167U, 611U, 167U, 611U, 167U, 278U, 167U, 278U, 167U, 778U, 167U, 65535U };
// Command #37: RECORD
// Protocol: nokia32, Parameters: X=38 S=0 D=38 T=0 F=55
const microseconds_t repeat_RECORD[] PROGMEM = { 417U, 278U, 167U, 278U, 167U, 611U, 167U, 444U, 167U, 611U, 167U, 278U, 167U, 278U, 167U, 278U, 167U, 278U, 167U, 278U, 167U, 611U, 167U, 444U, 167U, 611U, 167U, 278U, 167U, 778U, 167U, 444U, 167U, 778U, 167U, 65535U };
// Command #38: REVERSE
// Protocol: nokia32, Parameters: X=38 S=0 D=38 T=0 F=41
const microseconds_t repeat_REVERSE[] PROGMEM = { 417U, 278U, 167U, 278U, 167U, 611U, 167U, 444U, 167U, 611U, 167U, 278U, 167U, 278U, 167U, 278U, 167U, 278U, 167U, 278U, 167U, 611U, 167U, 444U, 167U, 611U, 167U, 278U, 167U, 611U, 167U, 611U, 167U, 444U, 167U, 65535U };
// Command #39: STOP
// Protocol: nokia32, Parameters: X=38 S=0 D=38 T=0 F=49
const microseconds_t repeat_STOP[] PROGMEM = { 417U, 278U, 167U, 278U, 167U, 611U, 167U, 444U, 167U, 611U, 167U, 278U, 167U, 278U, 167U, 278U, 167U, 278U, 167U, 278U, 167U, 611U, 167U, 444U, 167U, 611U, 167U, 278U, 167U, 778U, 167U, 278U, 167U, 444U, 167U, 65535U };
// Command #40: VOLUME DOWN
// Protocol: nokia32, Parameters: X=38 S=0 D=38 T=0 F=17
const microseconds_t repeat_VOLUME_DOWN[] PROGMEM = { 417U, 278U, 167U, 278U, 167U, 611U, 167U, 444U, 167U, 611U, 167U, 278U, 167U, 278U, 167U, 278U, 167U, 278U, 167U, 278U, 167U, 611U, 167U, 444U, 167U, 611U, 167U, 278U, 167U, 444U, 167U, 278U, 167U, 444U, 167U, 65535U };
// Command #41: VOLUME UP
// Protocol: nokia32, Parameters: X=38 S=0 D=38 T=0 F=16
const microseconds_t repeat_VOLUME_UP[] PROGMEM = { 417U, 278U, 167U, 278U, 167U, 611U, 167U, 444U, 167U, 611U, 167U, 278U, 167U, 278U, 167U, 278U, 167U, 278U, 167U, 278U, 167U, 611U, 167U, 444U, 167U, 611U, 167U, 278U, 167U, 444U, 167U, 278U, 167U, 278U, 167U, 65535U };
// Command #42: WIDGET
// Protocol: nokia32, Parameters: X=38 S=0 D=38 T=0 F=247
const microseconds_t repeat_WIDGET[] PROGMEM = { 417U, 278U, 167U, 278U, 167U, 611U, 167U, 444U, 167U, 611U, 167U, 278U, 167U, 278U, 167U, 278U, 167U, 278U, 167U, 278U, 167U, 611U, 167U, 444U, 167U, 611U, 167U, 778U, 167U, 778U, 167U, 444U, 167U, 778U, 167U, 65535U };
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 .. 42)"));
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_CHANNEL_DOWN, 36U, 36000U, times);
break;
case 2U:
sendRaw(NULL, 0U, repeat_CHANNEL_UP, 36U, 36000U, times);
break;
case 3U:
sendRaw(NULL, 0U, repeat_CURSOR_DOWN, 36U, 36000U, times);
break;
case 4U:
sendRaw(NULL, 0U, repeat_CURSOR_ENTER, 36U, 36000U, times);
break;
case 5U:
sendRaw(NULL, 0U, repeat_CURSOR_LEFT, 36U, 36000U, times);
break;
case 6U:
sendRaw(NULL, 0U, repeat_CURSOR_RIGHT, 36U, 36000U, times);
break;
case 7U:
sendRaw(NULL, 0U, repeat_CURSOR_UP, 36U, 36000U, times);
break;
case 8U:
sendRaw(NULL, 0U, repeat_DIGIT_0, 36U, 36000U, times);
break;
case 9U:
sendRaw(NULL, 0U, repeat_DIGIT_1, 36U, 36000U, times);
break;
case 10U:
sendRaw(NULL, 0U, repeat_DIGIT_2, 36U, 36000U, times);
break;
case 11U:
sendRaw(NULL, 0U, repeat_DIGIT_3, 36U, 36000U, times);
break;
case 12U:
sendRaw(NULL, 0U, repeat_DIGIT_4, 36U, 36000U, times);
break;
case 13U:
sendRaw(NULL, 0U, repeat_DIGIT_5, 36U, 36000U, times);
break;
case 14U:
sendRaw(NULL, 0U, repeat_DIGIT_6, 36U, 36000U, times);
break;
case 15U:
sendRaw(NULL, 0U, repeat_DIGIT_7, 36U, 36000U, times);
break;
case 16U:
sendRaw(NULL, 0U, repeat_DIGIT_8, 36U, 36000U, times);
break;
case 17U:
sendRaw(NULL, 0U, repeat_DIGIT_9, 36U, 36000U, times);
break;
case 18U:
sendRaw(NULL, 0U, repeat_EXIT, 36U, 36000U, times);
break;
case 19U:
sendRaw(NULL, 0U, repeat_FAVORITE, 36U, 36000U, times);
break;
case 20U:
sendRaw(NULL, 0U, repeat_FORWARD, 36U, 36000U, times);
break;
case 21U:
sendRaw(NULL, 0U, repeat_FUNCTION_BLUE, 36U, 36000U, times);
break;
case 22U:
sendRaw(NULL, 0U, repeat_FUNCTION_GREEN, 36U, 36000U, times);
break;
case 23U:
sendRaw(NULL, 0U, repeat_FUNCTION_RED, 36U, 36000U, times);
break;
case 24U:
sendRaw(NULL, 0U, repeat_FUNCTION_YELLOW, 36U, 36000U, times);
break;
case 25U:
sendRaw(NULL, 0U, repeat_GAMES, 36U, 36000U, times);
break;
case 26U:
sendRaw(NULL, 0U, repeat_GUIDE, 36U, 36000U, times);
break;
case 27U:
sendRaw(NULL, 0U, repeat_INFO, 36U, 36000U, times);
break;
case 28U:
sendRaw(NULL, 0U, repeat_ITV, 36U, 36000U, times);
break;
case 29U:
sendRaw(NULL, 0U, repeat_LIVE_TV, 36U, 36000U, times);
break;
case 30U:
sendRaw(NULL, 0U, repeat_MENU_DVR, 36U, 36000U, times);
break;
case 31U:
sendRaw(NULL, 0U, repeat_MENU_MAIN, 36U, 36000U, times);
break;
case 32U:
sendRaw(NULL, 0U, repeat_MUTE_TOGGLE, 36U, 36000U, times);
break;
case 33U:
sendRaw(NULL, 0U, repeat_PAUSE, 36U, 36000U, times);
break;
case 34U:
sendRaw(NULL, 0U, repeat_PLAY, 36U, 36000U, times);
break;
case 35U:
sendRaw(NULL, 0U, repeat_POWER_TOGGLE, 36U, 36000U, times);
break;
case 36U:
sendRaw(NULL, 0U, repeat_PREVIOUS_CHANNEL, 36U, 36000U, times);
break;
case 37U:
sendRaw(NULL, 0U, repeat_RECORD, 36U, 36000U, times);
break;
case 38U:
sendRaw(NULL, 0U, repeat_REVERSE, 36U, 36000U, times);
break;
case 39U:
sendRaw(NULL, 0U, repeat_STOP, 36U, 36000U, times);
break;
case 40U:
sendRaw(NULL, 0U, repeat_VOLUME_DOWN, 36U, 36000U, times);
break;
case 41U:
sendRaw(NULL, 0U, repeat_VOLUME_UP, 36U, 36000U, times);
break;
case 42U:
sendRaw(NULL, 0U, repeat_WIDGET, 36U, 36000U, 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