Odpověď na: IR ovladač
Úvodní stránka › Fórum › Vaše projekty › Arduino › IR ovladač › Odpověď na: IR ovladač
15.5.2016 v 20:36
#6879
Účastník
Tak pauza před odeslání je asi to pravé řešení. Stačí dát delay(100); a už to odesílá. Nyní jsem ale narazil na jiný problém a to:
Projekt zabírá 14 692 bytů (47%) úložného místa pro program. Maximum je 30 720 bytů.
Globální proměnné zabírají 3 924 bytů (191%) dynamické paměti, -1 876 bytů zůstává pro lokální proměnné. Maximum je 2 048 bytů.
processing.app.debug.RunnerException: Nedostatek peměti;
Aktuální kód je tento:
#include <IRremote.h>
// Deklarace pinů
int RECV_PIN = 11;
// STB
const unsigned int srPower[67] = {8950, 4350, 650, 450, 650, 450, 650, 450, 650, 450, 650, 450, 650, 450, 650, 1550, 650, 500, 600, 500, 650, 450, 650, 450, 650, 450, 650, 450, 650, 450, 650, 1550, 650, 500, 600, 500, 600, 1600, 650, 450, 650, 1550, 650, 500, 600, 500, 600, 500, 600, 500, 650, 1550, 650, 450, 650, 1600, 650, 450, 650, 1550, 650, 1600, 600, 1600, 650, 1550, 650}; // NEC 20250AF
const unsigned int srMute[67] = {8900, 4350, 650, 450, 650, 450, 650, 450, 650, 450, 650, 450, 650, 450, 650, 1600, 600, 500, 650, 450, 650, 450, 650, 450, 650, 450, 650, 450, 650, 450, 650, 1550, 650, 500, 600, 500, 650, 450, 650, 1550, 650, 1600, 600, 500, 600, 500, 600, 500, 650, 450, 650, 1550, 650, 1600, 600, 500, 650, 450, 650, 1550, 650, 1600, 600, 1600, 650, 1550, 650}; // NEC 20230CF
const unsigned int srHelp[67] = {8950, 4350, 600, 500, 600, 500, 600, 500, 650, 450, 650, 450, 650, 450, 650, 1550, 650, 450, 650, 450, 650, 500, 600, 500, 600, 500, 600, 500, 650, 450, 650, 1550, 650, 450, 650, 1600, 650, 1550, 650, 1550, 650, 1600, 650, 450, 650, 450, 650, 450, 650, 450, 650, 450, 650, 450, 700, 400, 650, 500, 600, 1600, 650, 1550, 650, 1600, 650, 1550, 650}; // NEC 202F00F
const unsigned int sr1[67] = {8950, 4300, 650, 450, 650, 450, 650, 450, 650, 450, 650, 450, 650, 450, 650, 1600, 650, 450, 650, 450, 650, 450, 650, 450, 650, 450, 650, 450, 650, 450, 650, 1600, 650, 450, 650, 1550, 650, 450, 650, 450, 650, 450, 650, 500, 600, 500, 600, 500, 600, 500, 650, 450, 650, 1550, 650, 1600, 650, 1550, 650, 1550, 650, 1600, 650, 1550, 650, 1600, 650}; // NEC 202807F
const unsigned int sr2[67] = {8950, 4300, 650, 450, 650, 450, 650, 450, 650, 450, 650, 450, 650, 450, 650, 1600, 650, 450, 650, 450, 650, 450, 650, 450, 650, 450, 650, 450, 650, 450, 650, 1600, 600, 500, 650, 450, 650, 1550, 650, 450, 650, 450, 650, 450, 650, 450, 650, 450, 650, 500, 600, 1600, 650, 450, 650, 1550, 650, 1600, 650, 1550, 650, 1600, 650, 1550, 650, 1600, 600}; // NEC 20240BF
const unsigned int sr3[67] = {8950, 4350, 650, 450, 650, 450, 650, 450, 650, 450, 650, 450, 650, 450, 650, 1550, 650, 500, 600, 500, 650, 450, 650, 450, 650, 450, 650, 450, 650, 450, 650, 1550, 650, 500, 600, 1600, 650, 1550, 650, 450, 650, 450, 650, 450, 650, 500, 600, 500, 600, 500, 650, 450, 650, 450, 650, 1550, 650, 1600, 600, 1600, 650, 1550, 650, 1600, 650, 1550, 650}; // NEC 202C03F
const unsigned int sr4[67] = {8950, 4300, 650, 450, 650, 450, 650, 450, 650, 450, 650, 500, 600, 500, 600, 1600, 650, 450, 650, 450, 650, 450, 650, 450, 650, 450, 650, 450, 650, 500, 600, 1600, 650, 450, 650, 450, 650, 450, 650, 1600, 600, 500, 650, 450, 650, 450, 650, 450, 650, 450, 650, 1550, 650, 1600, 650, 450, 650, 1550, 650, 1600, 600, 1600, 650, 1550, 650, 1600, 650}; // NEC 20220DF
const unsigned int sr5[67] = {8950, 4300, 650, 450, 650, 450, 650, 500, 600, 500, 600, 500, 650, 450, 650, 1550, 650, 450, 650, 450, 650, 450, 650, 450, 650, 500, 600, 500, 600, 500, 600, 1600, 650, 450, 650, 1600, 600, 500, 650, 1550, 650, 450, 650, 450, 650, 450, 650, 450, 650, 450, 650, 450, 650, 1600, 650, 450, 650, 1550, 650, 1600, 650, 1550, 650, 1600, 600, 1600, 650}; // NEC 202A05F
const unsigned int sr6[67] = {8900, 4350, 650, 450, 650, 450, 650, 450, 650, 450, 650, 450, 650, 450, 650, 1600, 650, 450, 650, 450, 650, 450, 650, 450, 650, 450, 650, 450, 650, 450, 650, 1600, 650, 450, 650, 450, 650, 1550, 650, 1600, 650, 450, 650, 450, 650, 450, 650, 450, 650, 450, 650, 1550, 650, 500, 600, 500, 600, 1600, 650, 1550, 650, 1600, 650, 1550, 650, 1600, 600}; // NEC 202609F
const unsigned int sr7[67] = {8950, 4300, 650, 450, 650, 450, 650, 450, 650, 450, 650, 450, 650, 500, 600, 1600, 650, 450, 650, 450, 650, 450, 650, 450, 650, 450, 650, 450, 650, 450, 650, 1600, 650, 450, 650, 1550, 650, 1600, 650, 1550, 650, 450, 650, 450, 650, 450, 650, 450, 650, 500, 600, 500, 600, 500, 600, 500, 650, 1550, 650, 1600, 600, 1600, 650, 1550, 650, 1600, 650}; // NEC 202E01F
const unsigned int sr8[67] = {8950, 4350, 600, 500, 600, 500, 600, 500, 650, 450, 650, 450, 650, 450, 650, 1550, 650, 450, 650, 450, 650, 500, 600, 500, 600, 500, 600, 500, 650, 450, 650, 1550, 650, 450, 650, 450, 650, 450, 650, 450, 650, 1600, 600, 500, 650, 450, 650, 450, 650, 450, 650, 1600, 600, 1600, 650, 1550, 650, 450, 650, 1600, 650, 1550, 650, 1600, 600, 1600, 650}; // NEC 20210EF
const unsigned int sr9[67] = {8900, 4350, 600, 500, 600, 500, 600, 500, 600, 500, 600, 500, 600, 500, 600, 1650, 600, 500, 600, 500, 600, 500, 600, 500, 600, 500, 600, 500, 600, 500, 600, 1600, 650, 500, 600, 1600, 600, 500, 600, 500, 600, 1600, 650, 500, 600, 500, 600, 500, 600, 500, 600, 500, 600, 1600, 650, 1600, 600, 500, 600, 1600, 600, 1600, 650, 1600, 600, 1600, 650}; // NEC 202906F
const unsigned int sr0[67] = {8950, 4300, 650, 450, 650, 500, 600, 500, 600, 500, 650, 450, 650, 450, 650, 1550, 650, 450, 650, 450, 650, 450, 650, 500, 600, 500, 600, 500, 600, 500, 650, 1550, 650, 450, 650, 450, 650, 450, 650, 450, 650, 450, 650, 500, 600, 500, 600, 500, 650, 450, 650, 1550, 650, 1600, 600, 1600, 650, 1550, 650, 1600, 650, 1550, 650, 1600, 600, 1600, 650}; // NEC 20200FF
const unsigned int srDisplay[67] = {8950, 4300, 650, 450, 650, 500, 600, 500, 600, 500, 600, 500, 650, 450, 650, 1550, 650, 450, 650, 450, 650, 450, 650, 450, 650, 500, 600, 500, 600, 500, 650, 1550, 650, 450, 650, 1600, 600, 500, 600, 1600, 650, 450, 650, 450, 650, 450, 650, 1600, 600, 500, 650, 450, 650, 1550, 650, 450, 650, 1600, 650, 1550, 650, 1550, 650, 500, 600, 1600, 650}; // NEC 202A25D
const unsigned int srClear[67] = {8950, 4350, 600, 500, 600, 500, 600, 500, 600, 500, 600, 500, 600, 500, 600, 1600, 650, 500, 600, 500, 600, 500, 600, 500, 600, 500, 600, 500, 600, 500, 600, 1600, 650, 500, 600, 1600, 600, 500, 600, 1600, 650, 1600, 600, 1600, 650, 450, 650, 450, 650, 450, 650, 450, 650, 1600, 600, 500, 600, 500, 650, 450, 600, 1600, 650, 1600, 600, 1600, 650}; // NEC 202B847
const unsigned int srPUp[67] = {8900, 4350, 600, 500, 600, 500, 600, 500, 650, 450, 650, 450, 650, 450, 650, 1600, 600, 500, 600, 500, 600, 500, 600, 500, 600, 500, 650, 450, 650, 450, 650, 1600, 600, 500, 600, 500, 600, 1600, 650, 450, 650, 450, 650, 450, 650, 450, 650, 1600, 600, 500, 600, 1600, 650, 450, 650, 1600, 600, 1600, 650, 1600, 600, 1600, 600, 500, 650, 1600, 600}; // NEC 20242BD
const unsigned int srPDown[67] = {8950, 4350, 650, 450, 600, 500, 650, 450, 650, 450, 650, 450, 650, 450, 650, 1550, 650, 500, 600, 500, 600, 500, 650, 450, 650, 450, 650, 450, 650, 450, 650, 1550, 650, 450, 650, 500, 600, 1600, 650, 450, 650, 1550, 650, 1600, 650, 450, 650, 450, 650, 450, 650, 1550, 650, 450, 650, 1600, 650, 450, 650, 450, 650, 1550, 650, 1600, 650, 1550, 650}; // NEC 20258A7
const unsigned int srExit[67] = {8900, 4350, 600, 500, 600, 500, 650, 450, 650, 450, 650, 450, 650, 450, 650, 1600, 600, 500, 600, 500, 600, 500, 650, 450, 650, 450, 650, 450, 650, 450, 650, 1550, 650, 500, 650, 450, 650, 450, 650, 450, 650, 450, 650, 450, 650, 450, 650, 1550, 650, 500, 600, 1600, 650, 1550, 650, 1600, 650, 1550, 650, 1600, 600, 1600, 650, 450, 650, 1550, 650}; // NEC 20202FD
const unsigned int srBack[67] = {8900, 4350, 650, 450, 650, 450, 650, 450, 600, 500, 650, 450, 650, 450, 650, 1600, 600, 500, 650, 450, 600, 500, 650, 450, 650, 450, 650, 450, 650, 450, 600, 1600, 650, 500, 600, 1600, 600, 500, 650, 450, 600, 500, 600, 500, 650, 450, 650, 1600, 600, 500, 600, 500, 600, 1600, 600, 1650, 600, 1600, 600, 1600, 650, 1600, 600, 500, 650, 1550, 650}; // NEC 202827D
const unsigned int srUp[67] = {8950, 4350, 650, 450, 650, 450, 650, 450, 650, 450, 650, 450, 650, 450, 650, 1550, 650, 500, 650, 450, 650, 450, 650, 450, 650, 450, 650, 450, 650, 450, 650, 1550, 650, 500, 600, 1600, 650, 1550, 650, 450, 650, 1600, 650, 450, 650, 450, 650, 450, 650, 450, 650, 450, 650, 450, 650, 1600, 600, 500, 600, 1600, 650, 1550, 650, 1600, 650, 1550, 650}; // NEC 202D02F
const unsigned int srDown[67] = {8950, 4300, 650, 450, 650, 500, 600, 500, 600, 500, 600, 500, 650, 450, 650, 1550, 650, 450, 650, 450, 650, 450, 650, 450, 650, 500, 600, 500, 600, 500, 650, 1550, 650, 450, 650, 450, 650, 1600, 650, 1550, 650, 1550, 650, 500, 600, 500, 600, 500, 600, 500, 650, 1550, 650, 450, 650, 450, 650, 450, 650, 1600, 650, 1550, 650, 1600, 600, 1600, 650}; // NEC 202708F
const unsigned int srLeft[67] = {8950, 4350, 600, 500, 650, 450, 650, 450, 650, 450, 650, 450, 650, 450, 650, 1550, 650, 500, 600, 500, 600, 500, 650, 450, 650, 450, 650, 450, 650, 450, 650, 1550, 650, 450, 650, 450, 650, 500, 600, 500, 600, 500, 650, 1550, 650, 450, 650, 450, 650, 450, 650, 1600, 650, 1550, 650, 1600, 600, 1600, 600, 500, 600, 1600, 650, 1600, 600, 1600, 650}; // NEC 20208F7
const unsigned int srRight[67] = {8950, 4300, 650, 450, 650, 450, 650, 450, 650, 450, 650, 450, 650, 450, 650, 1600, 650, 450, 650, 450, 650, 450, 650, 450, 650, 450, 650, 450, 650, 450, 650, 1600, 600, 500, 650, 1550, 650, 450, 650, 450, 650, 450, 650, 1600, 650, 450, 650, 450, 650, 450, 650, 450, 650, 1550, 650, 1600, 650, 1550, 650, 450, 650, 1600, 650, 1550, 650, 1600, 600}; // NEC 2028877
const unsigned int srOK[67] = {8900, 4350, 600, 500, 650, 450, 650, 450, 650, 450, 650, 450, 650, 450, 650, 1600, 650, 450, 650, 450, 650, 450, 650, 450, 650, 450, 600, 500, 650, 450, 650, 1600, 600, 500, 650, 1550, 650, 450, 650, 1600, 600, 1600, 650, 450, 650, 450, 650, 450, 650, 450, 650, 450, 650, 1600, 650, 450, 650, 450, 650, 1550, 650, 1600, 600, 1600, 650, 1550, 650}; // NEC 202B04F
const unsigned int srPPlus[67] = {8950, 4350, 600, 500, 600, 500, 650, 450, 600, 500, 650, 450, 650, 450, 650, 1550, 650, 450, 650, 450, 650, 500, 600, 500, 600, 500, 650, 450, 650, 450, 650, 1550, 650, 450, 650, 1600, 650, 450, 650, 1550, 650, 450, 650, 1600, 600, 500, 650, 450, 650, 450, 650, 450, 650, 1550, 650, 450, 650, 1600, 650, 450, 650, 1550, 650, 1600, 600, 1600, 650}; // NEC 202A857
const unsigned int srPMinus[67] = {8900, 4350, 650, 450, 650, 450, 650, 450, 650, 450, 650, 450, 650, 450, 650, 1550, 650, 500, 600, 500, 650, 450, 650, 450, 650, 450, 650, 450, 650, 450, 650, 1550, 650, 500, 600, 500, 600, 500, 600, 1600, 650, 1550, 650, 1600, 650, 450, 650, 450, 650, 450, 650, 1550, 650, 1600, 650, 450, 650, 450, 650, 450, 650, 1550, 650, 1600, 650, 1550, 650}; // NEC 20238C7
const unsigned int srVPlus[67] = {8950, 4300, 650, 450, 650, 450, 650, 450, 650, 450, 650, 450, 650, 450, 650, 1600, 650, 450, 650, 450, 650, 450, 650, 450, 650, 450, 650, 450, 650, 450, 650, 1600, 600, 500, 650, 1550, 650, 1600, 600, 1600, 650, 1550, 650, 1600, 650, 450, 650, 450, 650, 450, 650, 450, 650, 450, 650, 450, 650, 450, 650, 450, 650, 1600, 650, 1550, 650, 1600, 600}; // NEC 202F807
const unsigned int srVMinus[67] = {8950, 4300, 650, 450, 650, 450, 650, 450, 650, 450, 650, 450, 650, 500, 600, 1600, 650, 450, 650, 450, 650, 450, 650, 450, 650, 450, 650, 450, 650, 450, 650, 1600, 650, 450, 650, 450, 650, 1550, 650, 1600, 650, 1600, 600, 1600, 600, 500, 650, 450, 650, 450, 650, 1550, 650, 450, 650, 450, 650, 450, 650, 450, 650, 1600, 650, 1550, 650, 1600, 650}; // NEC 2027887
const unsigned int srRed[67] = {8950, 4350, 600, 500, 650, 450, 650, 450, 650, 450, 650, 450, 650, 450, 650, 1550, 650, 500, 600, 500, 600, 500, 600, 500, 600, 500, 650, 450, 650, 450, 650, 1550, 650, 450, 650, 450, 650, 1600, 650, 1550, 650, 450, 650, 1600, 600, 500, 650, 450, 650, 450, 650, 1550, 650, 450, 650, 450, 650, 1600, 650, 450, 650, 1550, 650, 1600, 650, 1550, 650}; // NEC 2026897
const unsigned int srGreen[67] = {8900, 4350, 600, 500, 600, 500, 600, 500, 600, 500, 600, 500, 600, 550, 550, 1650, 600, 500, 600, 500, 600, 500, 600, 500, 600, 500, 600, 500, 600, 500, 600, 1650, 600, 500, 600, 1600, 600, 1650, 600, 1600, 650, 450, 650, 1600, 600, 500, 600, 500, 600, 500, 600, 500, 600, 500, 600, 500, 600, 1600, 650, 500, 600, 1600, 650, 1550, 650, 1600, 650}; // NEC 202E817
const unsigned int srBlue[67] = {8950, 4300, 650, 450, 650, 450, 650, 450, 650, 450, 650, 450, 650, 450, 650, 1600, 650, 450, 650, 450, 650, 450, 650, 450, 650, 450, 650, 450, 650, 450, 700, 1550, 650, 450, 650, 450, 650, 450, 650, 450, 650, 1550, 650, 1600, 650, 450, 650, 450, 650, 450, 650, 1600, 600, 1600, 650, 1550, 650, 450, 650, 450, 650, 1600, 650, 1550, 650, 1600, 650}; // NEC 20218E7
const unsigned int srYellow[67] = {8950, 4300, 650, 450, 650, 450, 700, 400, 650, 450, 650, 450, 700, 400, 650, 1600, 650, 450, 650, 450, 650, 450, 650, 450, 650, 450, 700, 400, 700, 400, 650, 1600, 650, 450, 650, 1550, 650, 450, 650, 450, 700, 1550, 650, 1550, 650, 450, 700, 400, 700, 400, 650, 450, 650, 1600, 650, 1550, 650, 450, 700, 400, 650, 1600, 650, 1550, 650, 1600, 600}; // NEC 2029867
const unsigned int srMenu[67] = {8950, 4300, 650, 450, 700, 400, 650, 500, 650, 450, 650, 450, 650, 450, 650, 1550, 650, 450, 700, 400, 700, 400, 650, 450, 700, 400, 700, 450, 600, 500, 600, 1600, 650, 450, 650, 450, 700, 1550, 650, 450, 650, 450, 650, 1550, 650, 450, 650, 450, 700, 400, 650, 1600, 650, 450, 650, 1550, 650, 1600, 650, 450, 650, 1550, 650, 1600, 600, 1600, 650}; // NEC 20248B7
const unsigned int srRev[67] = {8950, 4300, 650, 450, 650, 450, 650, 450, 650, 450, 700, 400, 700, 400, 700, 1550, 650, 450, 650, 450, 650, 450, 650, 450, 650, 450, 650, 450, 650, 450, 650, 1600, 650, 450, 650, 1550, 650, 1600, 600, 500, 600, 500, 650, 1550, 650, 450, 650, 450, 650, 450, 700, 400, 650, 450, 650, 1600, 650, 1550, 700, 400, 700, 1550, 650, 1550, 650, 1600, 600}; // NEC 202C837
const unsigned int srFwd[67] = {8900, 4350, 650, 450, 650, 450, 650, 450, 650, 450, 650, 450, 650, 450, 650, 1600, 600, 500, 650, 450, 650, 450, 650, 450, 650, 450, 650, 450, 650, 450, 650, 1550, 650, 500, 650, 1550, 650, 1550, 650, 450, 650, 1600, 650, 1550, 650, 450, 650, 450, 650, 500, 600, 500, 600, 500, 600, 1600, 650, 450, 650, 450, 650, 1550, 650, 1600, 650, 1550, 650}; // NEC 202D827
const unsigned int srPlay[67] = {9000, 4300, 650, 450, 650, 450, 650, 450, 650, 450, 650, 450, 650, 450, 650, 1550, 650, 500, 650, 450, 650, 450, 650, 450, 650, 450, 650, 450, 650, 450, 650, 1550, 650, 450, 650, 500, 600, 500, 600, 1600, 650, 450, 650, 1550, 650, 450, 650, 500, 600, 500, 650, 1550, 650, 1550, 650, 450, 700, 1550, 650, 450, 650, 1550, 650, 1600, 650, 1550, 650}; // NEC 20228D7
const unsigned int srStop[67] = {8950, 4300, 650, 450, 650, 450, 650, 450, 650, 450, 650, 450, 650, 450, 650, 1600, 650, 450, 650, 450, 650, 450, 650, 450, 650, 450, 650, 450, 650, 450, 650, 1600, 600, 500, 650, 450, 650, 450, 650, 1550, 650, 450, 700, 400, 650, 450, 700, 1550, 650, 450, 650, 1550, 650, 1600, 650, 450, 650, 1550, 650, 1600, 650, 1550, 650, 450, 650, 1600, 600}; // NEC 20222DD
const unsigned int srSubtitle[67] = {8950, 4300, 650, 450, 650, 450, 650, 450, 650, 500, 650, 450, 600, 500, 600, 1600, 650, 450, 650, 450, 650, 450, 650, 450, 650, 450, 650, 500, 600, 500, 600, 1600, 650, 450, 650, 1600, 600, 1600, 650, 450, 650, 450, 650, 1550, 650, 450, 650, 1600, 650, 450, 650, 450, 650, 450, 650, 1600, 600, 1600, 650, 450, 650, 1550, 650, 450, 650, 1600, 650}; // NEC 202CA35
const unsigned int srAudio[67] = {8900, 4350, 600, 500, 600, 500, 600, 500, 600, 500, 600, 500, 600, 500, 600, 1650, 600, 500, 600, 500, 600, 500, 600, 500, 600, 500, 600, 500, 600, 500, 600, 1650, 550, 550, 600, 1600, 600, 1650, 550, 550, 600, 1600, 600, 1600, 600, 500, 600, 1650, 550, 550, 600, 500, 600, 500, 600, 1650, 550, 550, 550, 550, 550, 1650, 600, 500, 600, 1650, 550}; // NEC 202DA25
const unsigned int srRec[67] = {8950, 4300, 650, 450, 650, 450, 650, 450, 700, 400, 700, 400, 700, 450, 650, 1550, 650, 450, 650, 450, 700, 400, 700, 400, 700, 400, 700, 400, 700, 400, 700, 1550, 650, 450, 650, 1550, 700, 1550, 650, 1550, 650, 450, 700, 1550, 600, 500, 650, 1550, 650, 450, 700, 400, 700, 400, 700, 400, 650, 1600, 650, 450, 650, 1550, 650, 450, 700, 1550, 650}; // NEC 202EA15
const unsigned int srGoto[67] = {8950, 4300, 700, 400, 700, 400, 700, 450, 650, 450, 650, 450, 650, 450, 650, 1550, 650, 450, 700, 400, 700, 400, 700, 400, 700, 450, 650, 450, 650, 450, 650, 1550, 650, 450, 700, 400, 700, 400, 700, 1550, 650, 450, 650, 1550, 700, 400, 700, 1550, 650, 450, 650, 1550, 700, 1550, 650, 450, 650, 1550, 650, 450, 650, 1550, 700, 450, 650, 1550, 650}; // NEC 2022AD5
// TV
#define tPower 0xE0E040BF
#define tPowerS 0xE0E007F8
#define tSource 0xE0E0807F
#define t1 0xE0E020DF
#define t2 0xE0E0A05F
#define t3 0xE0E0609F
#define t4 0xE0E010EF
#define t5 0xFFFFFFFF
#define t6 0xE0E050AF
#define t7 0xE0E030CF
#define t8 0xE0E0B04F
#define t9 0xE0E0708F
#define t0 0xE0E08877
#define tTTX 0xE0E034CB
#define tPRECH 0xE0E0C837
#define tMute 0xE0E0F00F
#define tVUp 0xE0E0E01F
#define tVDown 0xE0E0D02F
#define tPUp 0xE0E048B7
#define tPDown 0xE0E008F7
#define tCHlist 0xE0E0D629
#define tMenu 0xE0E058A7
#define tSmart 0xE0E09E61
#define tGuide 0xE0E0F20D
#define tTools 0xE0E0D22D
#define tInfo 0xE0E0F807
#define tUp 0xE0E006F9
#define tDown 0xE0E08679
#define tLeft 0xE0E0A659
#define tRight 0xE0E046B9
#define tOK 0xE0E016E9
#define tReturn 0xE0E01AE5
#define tExit 0xE0E0B44B
#define tRed 0xE0E036C9
#define tGreen 0xE0E028D7
#define tYellow 0xE0E0A857
#define tBlue 0xE0E06897
#define tRev 0xE0E0A25D
#define tFwd 0xE0E012ED
#define tPause 0xE0E052AD
#define tPlay 0xE0E0E21D
#define tRec 0xE0E0926D
#define tStop 0xE0E0629D
// Definice IR
IRrecv irrecv(RECV_PIN);
IRsend irsend;
decode_results results;
// Proměnné
void setup()
{
Serial.begin(9600);
irrecv.enableIRIn(); // Start the receiver
}
void loop() {
// Rozpoznání přijatého kódu
if (irrecv.decode(&results)) {
Serial.print("Prijato: ");
Serial.println(results.value, HEX);
delay(100); // Zpožděné odeslání
switch (results.value) {
case tRed:
irsend.sendRaw(srRed, 67, 38);
break;
case tGreen:
irsend.sendRaw(srGreen, 67, 38);
break;
case tYellow:
irsend.sendRaw(srYellow, 67, 38);
break;
case tBlue:
irsend.sendRaw(srBlue, 67, 38);
break;
case tUp:
irsend.sendRaw(srUp, 67, 38);
break;
case tDown:
irsend.sendRaw(srDown, 67, 38);
break;
case tLeft:
irsend.sendRaw(srLeft, 67, 38);
break;
case tRight:
irsend.sendRaw(srRight, 67, 38);
break;
case tOK:
irsend.sendRaw(srOK, 67, 38);
break;
case t1:
irsend.sendRaw(sr1, 67, 38);
break;
case t2:
irsend.sendRaw(sr2, 67, 38);
break;
case t3:
irsend.sendRaw(sr3, 67, 38);
break;
case t4:
irsend.sendRaw(sr4, 67, 38);
break;
case t5:
irsend.sendRaw(sr5, 67, 38);
break;
case t6:
irsend.sendRaw(sr6, 67, 38);
break;
case t7:
irsend.sendRaw(sr7, 67, 38);
break;
case t8:
irsend.sendRaw(sr8, 67, 38);
break;
case t9:
irsend.sendRaw(sr9, 67, 38);
break;
case t0:
irsend.sendRaw(sr0, 67, 38);
break;
case tPUp:
irsend.sendRaw(srPUp, 67, 38);
break;
case tPDown:
irsend.sendRaw(srPDown, 67, 38);
break;
case tPlay:
irsend.sendRaw(srPlay, 67, 38);
break;
case tPause:
irsend.sendRaw(srPlay, 67, 38);
break;
case tStop:
irsend.sendRaw(srStop, 67, 38);
break;
case tRev:
irsend.sendRaw(srRev, 67, 38);
break;
case tFwd:
irsend.sendRaw(srFwd, 67, 38);
break;
case tRec:
irsend.sendRaw(srRec, 67, 38);
break;
}
irrecv.enableIRIn();
irrecv.resume(); // Receive the next value
}
}
Neřekl bych, že je tam toho moc? Trochu to nechápu. U každého case jsem měl Serial.println(„Nejaky text“); po odstranění těchto debug informací se velikost globálních proměnných snížila, ale nevím jak to snížit dále?