Page 1 of 1

IRLib example sending Mitsubishi 288 bit Infrared Protocol

Posted: Fri Dec 26, 2014 4:34 pm
by AnalysIR
Here is an example of sending these long signals for a Mitsubishi AC unit using automatically generated code from AnalysIR for IRLib.

We show 6 example signals, but because of SRAM limits we can only compile one signal at a time for testing.

Also, because of a restriction in IRLib, you will first need to make a change to the library as explained here:
http://www.analysir.com/joomla/IRforum/ ... ?f=5&t=445

Code: Select all

#include <IRLib.h>

IRsend My_Sender;

void setup()
{
  Serial.begin(9600);
}

void loop() {
  if (Serial.read() != -1) {
/*
Automatically Generated by AnalysIR - Batch Export Utility
Registered to: xxxxxxxx
Session History: mitsubitshi_aircon
Type : Key : Value : Bits
0 : MITSUBISHI288AC :  : C4D36480000418A06C02710000000000006AC4D36480000418A06C02710000000000006A : 288
1 : MITSUBISHI288AC :  : C4D36480000418206C0271000000000000AAC4D36480000418206C0271000000000000AA : 288
2 : MITSUBISHI288AC :  : C4D36480000418406C0271000000000000CAC4D36480000418406C0271000000000000CA : 288
3 : MITSUBISHI288AC :  : C4D36480000418C06C02710000000000002AC4D36480000418C06C02710000000000002A : 288
4 : MITSUBISHI288AC :  : C4D36480000418A06C02710000000000006AC4D36480000418A06C02710000000000006A : 288
5 : MITSUBISHI288AC :  : C4D36480000418A06C02710000000000006AC4D36480000418A06C02710000000000006A : 288
*/

// NB: Not all protocols are supported by IRremote or IRLib. You may need to edit the code below manually
// Automatically Generated by AnalysIR for xxxxxxxx, visit http://www.AnalysIR.com or email info@....... for further details
int khz=38; //NB Change this default value as neccessary to the correct modulation frequency


unsigned int Signal_0_0[] = {3460,1688,440,1280,440,1280,444,424,436,432,440,428,444,1272,440,428,444,420,440,1280,444,1280,440,428,444,1276,436,428,476,400,440,1280,444,1276,520,348,440,1284,436,1284,440,424,524,340,516,1212,440,424,448,416,516,1208,440,424,440,424,448,420,512,352,520,348,524,348,504,360,500,364,516,356,496,364,520,348,500,364,500,364,444,424,436,436,500,364,444,424,500,368,492,372,500,364,496,1220,504,364,496,368,496,372,496,368,496,372,500,1220,512,1208,440,424,500,364,520,344,496,1228,492,372,520,1204,520,352,500,364,496,364,496,380,492,368,496,376,492,1232,492,1228,516,352,520,1204,516,1208,496,372,500,364,516,356,496,364,516,356,496,368,492,368,464,404,496,1224,468,400,492,376,496,1232,500,1224,492,1224,496,376,496,368,492,368,492,1232,492,372,448,416,444,420,464,400,440,424,448,416,444,428,444,424,448,420,440,428,444,420,440,428,444,416,448,420,440,424,468,400,440,420,464,408,440,424,468,408,464,400,464,404,444,420,444,420,440,432,440,424,436,428,444,420,492,372,440,424,448,420,440,420,440,428,444,416,444,424,440,424,448,416,496,372,504,364,440,424,488,380,472,392,468,400,492,372,492,376,472,392,472,388,472,396,476,392,468,1252,472,1248,476,392,476,1240,472,396,472,1252,476,404,468,16984,3600,1680,488,1236,496,1232,440,420,472,388,472,392,472,1248,472,392,492,372,500,1224,476,1244,468,396,496,1228,492,372,492,376,476,1244,496,1232,472,392,488,1232,492,1232,480,388,492,376,476,1244,468,400,472,396,476,1240,492,380,472,392,468,408,496,368,492,376,476,388,472,396,464,404,468,396,464,400,472,392,492,372,468,396,476,392,468,392,472,396,472,388,476,392,468,396,476,388,492,1232,472,396,484,380,472,392,468,396,468,396,476,1244,476,1244,468,396,488,376,472,396,496,1232,472,396,476,1244,488,380,472,400,492,380,468,392,492,376,476,388,472,1260,492,1232,472,392,500,1228,492,1232,492,380,472,388,472,392,492,372,476,388,476,388,472,392,468,400,472,1244,468,396,476,388,472,1248,484,1244,468,1252,472,388,496,372,496,368,496,1224,496,368,496,368,504,360,520,348,512,356,496,364,496,372,500,364,500,364,516,352,508,360,484,380,488,380,484,388,484,384,476,392,468,396,476,388,472,396,436,432,472,392,468,392,468,408,476,388,472,396,476,388,472,392,472,396,444,424,436,432,492,376,476,392,468,400,492,380,472,388,492,376,476,388,472,392,468,396,476,392,472,388,472,392,468,400,472,392,468,400,484,388,472,388,444,424,468,396,476,1244,488,1240,492,376,476,1244,488,380,472,1248,472,392,472}; //AnalysIR Batch Export - RAW

My_Sender.IRsendRaw::send(Signal_0_0, sizeof(Signal_0_0)/sizeof(int), khz); //AnalysIR Batch Export (IRLib) - RAW
 // AnalysIR IR Protocol: MITSUBISHI288AC, Key:  


////unsigned int Signal_1_1[] = {3436,1716,512,1212,440,1280,444,416,444,420,512,360,512,1212,512,352,448,420,440,1280,444,1280,440,420,516,1220,440,424,448,416,516,1208,444,1276,476,400,512,1212,440,1284,436,428,516,352,436,1288,436,424,520,344,444,1276,436,428,444,424,512,348,440,424,448,416,444,424,512,356,492,372,440,432,500,364,496,368,496,368,492,376,496,368,512,356,496,364,520,352,496,368,476,400,512,352,520,1200,448,416,496,372,492,376,496,364,516,356,496,1224,520,1200,520,348,492,368,516,352,520,348,512,356,496,1224,496,368,516,352,496,368,444,424,500,364,496,368,492,1228,496,1224,500,368,492,1228,492,1228,496,372,500,368,492,372,440,432,500,368,464,400,500,364,500,368,440,1280,496,372,500,364,496,1228,516,1208,460,1264,500,364,468,404,496,368,444,1280,460,404,460,408,492,376,468,404,444,420,444,420,440,424,448,416,436,428,440,432,444,420,440,432,440,424,520,356,440,424,440,436,444,420,444,420,440,428,444,424,436,424,448,416,444,420,444,424,444,416,436,436,448,416,432,436,448,428,464,404,448,416,444,420,440,428,476,400,472,400,440,428,444,416,496,376,444,424,440,424,444,420,444,420,440,424,436,428,496,372,440,428,444,416,496,376,444,1272,472,404,464,1264,440,424,448,1272,440,420,472,1252,472,388,492,16968,3596,1684,476,1248,472,1248,488,376,492,376,488,380,468,1260,476,388,492,376,476,1244,476,1244,472,392,488,1236,476,384,488,380,472,1252,468,1252,492,376,484,1236,496,1228,476,396,496,376,476,1244,468,392,468,396,476,1244,468,392,488,380,492,372,492,372,488,380,472,392,468,400,472,396,476,388,472,392,472,392,488,376,476,392,468,396,476,388,472,392,472,392,468,396,476,388,472,396,488,1236,476,400,472,392,468,400,472,392,468,400,472,1248,476,1240,472,392,500,372,476,388,476,392,468,396,476,1244,476,392,472,392,468,396,476,392,472,396,472,388,496,1232,468,1252,472,392,468,1252,492,1232,468,396,476,396,464,396,468,400,472,388,472,392,492,376,472,396,468,1252,480,388,472,388,496,1240,472,1244,496,1228,496,376,476,388,472,392,468,1256,480,384,476,388,472,388,496,372,476,388,476,388,492,380,480,388,496,372,480,388,504,360,500,368,492,368,496,372,500,364,516,352,500,364,508,356,516,352,496,372,492,372,500,364,496,368,504,368,492,372,500,360,492,380,468,396,468,396,476,392,468,396,484,384,468,400,492,376,436,428,492,380,472,400,472,384,476,392,472,388,440,428,464,400,472,388,496,376,472,392,472,392,436,436,468,400,472,1244,488,384,468,1256,488,376,492,1232,480,388,476,1244,468,396,476}; //AnalysIR Batch Export - RAW

////My_Sender.IRsendRaw::send(Signal_1_1, sizeof(Signal_1_1)/sizeof(int), khz); //AnalysIR Batch Export (IRLib) - RAW
 // AnalysIR IR Protocol: MITSUBISHI288AC, Key:  


////unsigned int Signal_2_2[] = {3440,1716,464,1256,444,1276,448,420,440,420,464,408,440,1280,516,352,448,416,444,1276,520,1204,444,416,520,1204,444,416,520,352,516,1208,516,1204,448,420,524,1200,520,1208,444,424,444,424,440,1276,444,424,440,424,448,1272,440,424,520,348,512,352,448,416,496,376,496,368,512,356,496,372,500,364,496,364,500,368,492,372,436,432,492,368,444,424,520,344,516,352,500,364,496,364,496,372,468,1272,516,352,444,424,500,364,496,368,496,368,512,1220,492,1224,468,404,500,364,516,360,524,344,496,1232,488,376,496,368,496,368,492,372,492,380,500,364,496,372,500,1224,500,1224,516,348,516,1208,512,1212,500,368,496,368,524,348,504,360,520,352,500,364,496,364,464,404,492,1224,516,356,496,372,500,1216,496,1228,516,1204,496,372,500,368,492,368,496,1224,496,372,460,408,492,372,460,404,448,420,440,428,444,416,444,428,444,420,440,424,440,420,460,412,440,424,436,428,444,424,436,432,440,428,444,420,440,424,440,424,448,420,460,404,468,400,440,428,436,432,436,424,440,428,496,368,472,400,440,424,436,424,440,424,444,424,440,424,448,420,440,424,488,380,440,420,492,376,444,424,492,376,492,376,488,380,440,420,492,376,444,416,444,424,492,376,440,1276,436,1284,492,376,496,372,488,1236,476,388,496,1224,476,388,496,17148,3600,1680,468,1252,492,1232,448,420,472,392,472,392,468,1252,472,392,488,380,472,1248,472,1248,476,384,476,1248,476,396,484,384,468,1252,472,1252,468,400,472,1248,476,1244,488,380,472,392,500,1224,476,388,496,372,488,1236,488,384,464,400,472,392,492,376,472,396,468,392,468,400,472,408,472,392,492,380,472,388,472,388,496,372,476,392,472,392,468,396,476,392,468,392,468,396,488,380,472,1252,468,392,492,380,468,392,492,376,476,392,488,1240,492,1232,472,392,488,376,476,388,472,396,476,1244,468,396,476,392,492,372,488,380,492,380,472,396,472,396,488,1236,476,1244,476,388,476,1244,500,1224,476,388,496,368,492,376,496,372,468,396,476,384,476,392,500,376,476,1244,476,388,476,392,468,1252,472,1248,472,1248,476,388,472,388,472,404,468,1252,472,396,476,388,472,392,492,376,492,368,496,380,492,368,492,376,496,372,500,364,496,364,496,372,500,364,508,360,504,356,512,356,516,348,516,352,496,368,496,368,492,372,532,344,476,388,492,384,488,384,468,392,468,400,472,388,484,384,476,392,468,396,468,400,480,384,468,396,464,400,484,380,492,384,488,384,476,388,472,392,472,392,468,396,476,392,468,396,488,388,484,376,472,392,468,392,472,1252,492,1228,472,400,472,392,468,1252,472,388,496,1232,468,392,500}; //AnalysIR Batch Export - RAW

////My_Sender.IRsendRaw::send(Signal_2_2, sizeof(Signal_2_2)/sizeof(int), khz); //AnalysIR Batch Export (IRLib) - RAW
 // AnalysIR IR Protocol: MITSUBISHI288AC, Key:  


////unsigned int Signal_3_3[] = {3464,1684,444,1276,444,1280,444,416,444,420,444,420,440,1284,520,344,444,424,440,1280,440,1284,472,400,440,1280,516,352,444,424,520,1204,448,1268,444,420,472,1264,512,1212,436,432,460,408,444,1280,440,424,512,352,520,1204,444,420,516,352,444,424,492,372,500,364,496,372,500,364,496,368,492,368,516,356,496,368,492,372,500,368,492,372,512,356,492,376,520,348,440,424,520,352,496,372,500,1220,516,352,496,368,516,348,512,360,492,372,500,1224,496,1220,504,360,500,376,496,368,492,1232,492,1232,488,376,496,376,516,352,500,364,496,364,500,364,496,372,500,1224,496,1224,520,348,492,1228,496,1224,520,352,496,372,492,376,464,408,496,364,464,404,500,364,496,368,492,1224,500,368,492,368,464,1260,492,1232,460,1256,496,368,464,408,444,420,460,1260,464,404,468,408,460,408,444,424,460,408,440,424,440,428,464,400,440,424,436,428,444,420,440,428,488,376,444,420,492,376,496,372,448,416,444,420,440,424,440,428,444,420,440,424,436,428,444,424,448,416,496,376,444,416,496,372,440,424,448,416,444,420,440,428,476,384,476,388,476,392,468,396,476,392,488,384,468,392,488,380,472,392,472,404,496,376,476,392,468,396,488,380,468,400,472,392,472,392,476,392,472,1248,472,392,492,1232,468,396,468,1252,436,428,476,16980,3596,1680,444,1280,444,1276,448,416,496,376,484,380,472,1252,472,396,472,396,468,1248,472,1248,476,392,468,1248,476,388,472,392,472,1248,492,1232,492,376,496,1228,472,1248,496,372,488,380,492,1232,472,392,468,396,476,1248,472,392,472,388,492,376,476,388,472,392,492,376,496,376,472,392,492,380,472,392,468,396,476,388,472,396,464,400,496,372,468,392,488,384,468,396,496,376,496,372,488,1232,472,392,480,384,476,392,468,396,496,376,476,1244,488,1232,492,376,472,392,472,396,476,1244,476,1244,468,396,476,388,496,372,476,392,472,392,468,396,476,384,488,1240,492,1232,468,396,496,1228,496,1228,476,392,468,396,476,388,472,396,464,396,468,396,496,372,468,400,472,1252,472,396,464,392,500,1236,496,1224,520,1204,516,352,500,364,496,372,500,1220,472,392,468,400,472,388,484,384,468,392,468,400,484,384,444,424,468,400,444,424,476,388,476,392,468,396,464,400,472,392,492,380,468,392,492,376,472,392,504,372,488,380,472,392,488,380,472,392,488,380,472,392,468,400,472,388,476,392,468,396,476,388,472,396,464,396,488,380,440,428,496,376,464,400,472,392,468,396,464,396,436,432,472,392,468,392,488,384,468,396,464,400,444,428,472,396,468,392,488,384,468,1252,472,392,476,1248,476,384,488,1236,476,392,468}; //AnalysIR Batch Export - RAW

////My_Sender.IRsendRaw::send(Signal_3_3, sizeof(Signal_3_3)/sizeof(int), khz); //AnalysIR Batch Export (IRLib) - RAW
 // AnalysIR IR Protocol: MITSUBISHI288AC, Key:  


////unsigned int Signal_4_4[] = {3440,1712,468,1256,444,1276,512,352,444,420,464,408,440,1280,444,424,436,428,444,1276,436,1280,516,352,520,1204,516,352,440,424,448,1268,516,1208,440,428,444,1276,448,1276,516,344,520,348,520,1204,448,420,512,352,448,1272,440,424,520,348,440,424,520,348,444,420,492,372,500,368,524,356,444,420,524,348,492,368,504,360,512,352,496,372,492,372,436,428,444,424,500,360,436,428,520,348,500,1224,500,360,520,352,500,360,520,356,516,352,512,1224,496,1220,512,356,496,368,516,352,496,1220,512,356,496,1224,436,432,440,424,520,348,504,360,460,408,440,424,524,1208,460,1264,500,364,520,1200,436,1288,508,356,496,368,440,432,492,368,440,428,496,368,468,400,496,364,468,1260,492,376,496,368,464,1260,460,1264,440,1280,464,404,496,368,444,424,444,1272,440,424,440,424,452,408,468,404,448,416,436,432,436,428,468,400,460,408,444,420,492,372,488,380,472,404,488,372,488,380,492,372,436,428,444,420,444,420,440,428,444,416,496,372,468,404,448,420,440,428,496,376,444,416,496,372,440,424,448,416,444,420,440,424,448,416,488,376,496,368,472,396,476,392,488,380,472,392,488,376,488,380,500,376,496,376,484,384,468,392,492,380,480,388,472,392,492,372,488,1232,492,1236,476,388,492,1232,468,400,472,1248,496,372,488,17144,3596,1680,492,1232,488,1236,496,376,496,372,468,400,472,1248,476,384,476,388,496,1232,488,1236,476,388,472,1252,472,404,488,384,468,1252,492,1228,492,380,472,1252,492,1236,476,388,492,376,488,1232,488,388,472,392,472,1248,472,392,492,376,484,384,468,392,488,384,488,376,496,372,492,376,484,380,472,388,492,372,488,380,492,376,468,396,484,380,492,372,488,380,472,392,468,392,492,376,504,1228,476,388,492,380,472,388,472,392,468,396,476,1244,468,1248,496,372,488,376,488,376,496,1228,472,388,472,1248,496,372,480,384,488,380,468,396,468,396,484,380,492,1232,468,1256,468,396,476,1244,468,1256,488,380,492,372,488,376,476,388,484,380,488,380,492,376,476,388,444,1276,496,368,504,360,492,1232,512,1208,504,1216,516,352,500,364,516,356,476,1240,492,372,488,380,472,388,484,380,488,380,472,396,468,396,484,384,468,396,476,384,476,392,488,380,484,384,476,388,472,392,472,392,488,384,468,396,484,388,476,396,496,376,464,396,476,384,476,392,440,428,472,388,444,424,468,396,484,388,476,384,488,380,468,396,488,384,436,432,440,424,468,396,484,384,468,392,468,400,484,380,468,396,468,396,464,400,472,392,436,432,440,424,440,428,444,424,468,396,464,1252,440,1284,468,392,492,1232,436,428,464,1256,468,396,432}; //AnalysIR Batch Export - RAW

////My_Sender.IRsendRaw::send(Signal_4_4, sizeof(Signal_4_4)/sizeof(int), khz); //AnalysIR Batch Export (IRLib) - RAW
 // AnalysIR IR Protocol: MITSUBISHI288AC, Key:  


////unsigned int Signal_5_5[] = {3440,1712,468,1256,444,1276,448,412,448,416,468,404,516,1208,516,352,436,428,444,1276,448,1276,444,416,520,1204,444,416,520,348,520,1204,448,1276,444,424,512,1212,448,1276,444,428,444,424,440,1276,444,420,444,420,448,1272,440,428,444,416,448,420,440,424,500,364,496,368,492,372,472,408,492,372,520,352,500,364,496,364,520,348,492,372,500,364,496,368,492,376,496,364,500,364,516,352,500,1224,444,416,520,352,500,360,520,356,516,352,436,1304,492,1224,444,420,496,368,512,356,496,1220,512,356,496,1228,496,368,500,368,516,352,500,360,500,368,460,404,436,1288,468,1256,516,352,500,1220,512,1212,500,368,496,368,492,376,496,368,492,376,496,376,464,404,500,364,496,1224,500,360,500,364,496,1224,456,1268,496,1228,496,368,492,372,460,412,488,1232,460,404,468,404,436,428,516,356,468,400,460,408,440,420,444,424,448,424,444,416,448,420,440,420,464,404,444,420,444,420,440,424,448,416,444,420,440,424,448,420,444,420,460,408,464,400,440,428,496,372,436,428,444,420,496,372,500,368,440,424,448,412,448,416,444,424,448,416,444,424,440,424,488,384,448,412,488,380,472,392,488,380,492,376,496,372,468,396,488,380,472,388,472,392,488,380,472,388,472,1252,472,1248,476,384,476,1244,448,416,476,1248,496,368,472,16988,3596,1684,472,1248,444,1280,496,372,468,396,476,388,472,1252,492,372,468,400,472,1244,476,1244,492,372,496,1224,480,392,488,380,472,1252,472,1248,472,392,468,1252,472,1248,496,372,480,388,472,1268,476,388,492,376,476,1244,476,388,476,392,468,396,496,376,476,384,488,380,468,396,496,376,488,376,496,372,476,388,496,372,468,392,468,396,496,376,468,388,472,396,476,388,472,392,488,380,472,1248,464,396,488,376,496,372,468,396,476,392,500,1224,496,1228,476,388,492,380,472,396,476,1244,488,380,472,1252,488,376,496,376,464,400,472,388,476,388,472,396,476,1252,468,1248,476,388,472,1252,472,1244,480,388,472,400,472,388,492,380,472,392,468,392,472,396,476,388,472,1248,472,392,472,392,468,1252,492,1236,496,1220,504,360,520,344,496,368,504,1216,476,388,472,392,472,392,488,380,492,376,476,388,472,396,476,388,472,388,496,372,488,380,492,376,484,384,488,384,488,380,472,392,468,400,472,392,468,396,488,384,464,396,476,388,476,400,468,392,472,400,472,392,468,396,464,404,488,376,444,424,492,380,468,400,472,396,488,380,472,392,488,380,472,392,468,396,464,400,472,392,468,392,472,396,464,400,472,392,468,404,488,380,472,392,440,424,468,400,500,1232,480,1240,472,392,504,1228,492,376,476,1248,472,396,468}; //AnalysIR Batch Export - RAW

////My_Sender.IRsendRaw::send(Signal_5_5, sizeof(Signal_5_5)/sizeof(int), khz); //AnalysIR Batch Export (IRLib) - RAW
 // AnalysIR IR Protocol: MITSUBISHI288AC, Key:  

  }
}