Send some IR raw

Topics not directly related to AnalysIR or IR
Post Reply
M Beni Harja
Posts: 3
Joined: Tue Mar 12, 2019 2:58 am

Send some IR raw

Post by M Beni Harja »

Hi

I obtain my code below from analysir tools, the remote is for daikin brc4c151
{5056,2144,380,1780,380,700,388,692,384,696,384,1780,376,704,384,696,384,696,380,700,380,1780,388,692,384,1776,380,1784,384,696,384,1776,380,1780,388,1772,384,1780,376,1784,384,696,380,1780,380,700,388,692,384,696,384,700,376,704,376,704,384,1776,380,1780,380,700,388,692,384,696,384,700,376,704,376,1784,384,696,380,700,380,700,380,700,388,692,384,696,384,700,380,700,376,704,384,696,384,696,380,700,380,700,380,700,388,1776,380,1780,376,1784,384,1776,380,700,380,700,388,696,380,29420,5068,2132,384,1780,384,696,384,696,380,700,380,1780,388,692,384,696,384,696,384,696,380,1784,384,696,384,1776,380,1780,388,692,384,1780,376,1784,384,1776,380,1780,388,1772,384,696,384,1780,384,696,384,696,380,700,380,700,380,700,388,692,384,1776,380,1784,384,696,384,696,380,700,384,696,380,700,388,692,384,696,384,696,380,704,376,704,384,696,384,1776,380,1780,388,692,384,696,384,1780,376,1784,384,1776,380,700,376,704,388,692,384,696,384,700,376,704,376,704,384,696,384,696,380,700,380,700,376,704,388,692,384,696,384,1780,376,704,384,696,384,696,380,700,380,700,376,704,388,696,380,696,384,700,376,704,376,704,384,696,384,696,380,700,380,700,376,704,388,692,384,696,384,700,376,704,376,1784,384,696,380,1780,380,700,388,692,384,700,380,1780,376,704,384,1776,380,700,380,1780,388,1776,380,700,376,704,376,704,384,696,384,696,380,700,380,700,388,692,388,692,384,700,380,700,376,704,388,692,384,696,384,696,380,1780,388,692,388,692,384,700,380,1780,388,1772,384,696,380,1780,388,692,388,692,384,700,380}, //OFF19
{5072,2132,384,1776,380,700,376,704,376,704,384,1776,380,700,380,700,380,700,388,696,380,1780,380,700,376,1784,384,1776,380,700,380,1784,384,1776,380,1780,388,1772,384,1776,380,700,388,1776,380,700,380,700,380,700,376,704,384,696,384,696,384,1776,380,1784,384,696,380,700,380,700,376,704,388,696,380,1776,380,704,376,704,384,696,384,696,380,700,380,700,380,700,388,692,384,696,384,696,384,696,380,704,384,696,384,696,384,1776,380,1780,388,1772,384,1780,376,704,384,696,384,696,380,29420,5072,2132,380,1780,380,700,388,692,384,696,384,1776,380,704,384,696,384,696,380,700,380,1780,376,704,384,1776,384,1780,376,704,384,1776,380,1780,376,1784,384,1780,376,1784,384,696,384,1776,380,700,376,704,388,696,380,696,384,700,380,700,376,1784,384,1776,380,700,380,700,388,692,388,692,384,700,380,700,376,704,376,704,384,696,384,696,380,704,376,1780,388,1776,380,700,380,700,376,1784,384,1776,380,1780,388,692,388,696,380,700,380,700,380,700,388,696,380,696,384,696,380,700,380,1780,388,696,380,700,380,700,380,700,376,1784,384,696,384,696,380,700,380,700,388,696,384,696,380,700,380,700,376,704,388,692,384,696,384,700,376,700,380,700,380,704,384,696,380,700,380,700,380,700,376,1784,384,1776,380,700,380,1784,384,696,380,700,380,700,376,1784,384,696,384,1776,380,704,384,1776,380,1780,376,704,388,692,384,696,384,696,384,696,380,704,376,704,384,696,384,696,380,700,380,700,376,704,388,692,384,696,384,696,380,1784,384,696,384,696,380,1780,380,700,388,692,384,1776,384,1780,384,696,384,696,380,700,380}, //ON20
{5056,2144,380,1780,380,700,388,696,380,700,380,1780,376,704,384,696,384,696,384,696,380,1780,388,696,384,1776,380,1780,388,692,384,1776,380,1780,388,1776,380,1780,376,1784,384,696,384,1776,380,700,380,704,384,696,380,700,380,700,380,700,376,1784,384,1776,380,700,380,704,384,696,384,696,380,700,380,1780,388,692,384,696,384,696,380,700,380,704,384,696,384,696,380,700,380,700,380,700,388,692,388,692,384,696,384,700,376,1784,384,1776,380,1780,376,1784,384,696,384,700,376,704,376,29424,5064,2140,384,1776,380,700,380,700,380,700,376,1784,384,696,384,696,380,704,376,704,384,1776,380,700,380,1780,388,1772,384,696,380,1784,384,1776,380,1780,376,1784,384,1776,384,700,376,1784,384,696,380,700,380,700,380,700,392,688,384,696,384,1780,376,1784,384,700,376,700,380,700,380,700,388,692,384,696,384,700,380,700,376,704,384,696,384,696,384,1776,380,1780,388,692,384,696,384,1784,384,1772,384,1776,380,700,388,692,388,696,380,700,380,700,376,704,388,692,384,696,384,696,384,1776,380,704,384,696,384,696,380,700,380,1780,388,692,384,696,384,696,380,700,380,704,384,696,384,696,380,700,380,700,380,700,388,692,384,696,384,696,384,696,380,704,384,696,384,696,384,696,380,700,380,700,376,704,388,1772,384,1780,376,704,384,696,384,696,384,1776,380,700,388,1772,384,696,384,1780,384,1776,384,696,380,700,380,700,388,692,388,692,384,696,384,700,376,704,376,704,384,696,384,696,380,700,380,700,380,700,388,692,384,1780,380,700,376,704,384,1776,384,1776,380,700,388,1776,380,1780,376,704,388,692,384,696,384}, //ON21
{5056,2144,384,1776,380,700,380,700,388,696,384,1776,380,728,348,732,360,720,356,696,384,1776,380,700,380,1784,380,1780,380,700,376,1784,384,1776,380,1780,388,1776,380,1780,376,704,384,1776,384,696,380,732,348,732,356,696,384,724,352,728,352,1780,388,1772,384,696,380,704,376,732,356,724,356,696,380,1780,380,728,348,704,384,696,384,696,412,700,380,672,404,676,404,676,412,668,412,696,380,672,408,676,404,672,416,664,416,1744,380,1784,384,1776,380,1780,388,692,416,664,416,696,380,29392,5084,2148,380,1748,388,696,412,668,412,668,408,1752,384,696,416,664,412,700,380,668,412,1752,412,668,412,1748,408,1752,416,664,416,1748,408,1752,404,1756,412,1748,408,1752,416,664,412,1752,408,672,404,676,412,668,412,668,412,668,408,672,408,1752,416,1748,408,672,404,676,412,668,412,668,412,668,408,672,408,672,408,672,416,668,408,672,408,672,408,1752,412,1748,412,668,408,672,408,1752,416,1748,408,1752,416,664,412,668,412,668,412,668,408,672,408,672,416,668,412,668,408,672,408,1752,412,668,412,668,412,668,408,672,408,1756,412,668,440,640,440,640,436,644,404,676,412,668,412,668,408,672,408,672,408,676,412,668,408,672,408,672,408,672,404,676,412,668,412,668,412,668,408,704,376,1752,416,668,408,1752,408,1752,412,668,412,668,412,704,372,1752,416,668,412,1744,412,672,404,1756,412,1748,408,700,380,704,376,704,372,708,384,696,380,700,380,700,376,704,376,708,380,696,384,700,376,704,376,704,372,708,372,708,380,1752,376,732,376,704,376,1756,380,732,344,1784,384,1780,376,1784,376,736,372,704,372,712,380}, //ON22
{5060,2172,352,1776,384,700,376,704,376,732,356,1776,380,700,380,732,344,704,388,724,352,1776,384,700,376,1784,384,1776,380,700,380,1780,388,1776,380,1780,376,1784,384,1776,380,700,380,1784,380,700,380,700,376,704,376,704,384,696,384,696,384,1776,380,1780,384,728,352,700,380,700,376,732,360,692,384,1776,380,700,380,732,348,700,408,676,412,696,384,696,384,668,408,700,380,672,416,696,384,664,412,700,380,672,404,676,412,1748,412,1748,408,1752,412,1752,408,668,408,676,404,704,384,29388,5088,2144,384,1748,408,672,408,676,400,676,416,1744,412,668,412,700,376,676,412,696,384,1748,408,672,408,1752,412,1752,408,672,404,1756,412,1748,408,1752,408,1752,412,1748,412,672,404,1756,412,668,412,668,408,672,408,672,416,664,412,668,412,1752,404,1756,412,668,412,668,408,672,408,672,404,676,416,664,412,700,380,672,404,676,404,676,412,668,412,1748,408,1752,416,664,416,668,408,1752,404,1756,412,1748,408,672,408,672,416,664,416,664,412,672,408,672,408,672,404,676,412,668,412,1748,408,672,408,672,416,664,412,672,408,1752,404,676,416,664,412,668,412,668,408,672,408,672,408,676,412,668,408,700,380,700,380,672,436,644,436,644,432,648,440,640,440,640,408,676,412,668,412,696,380,672,408,1752,416,1744,412,1748,408,672,408,676,412,668,412,1752,404,672,404,1756,412,668,412,1748,408,1756,412,668,408,672,408,672,404,704,376,704,376,704,384,700,380,700,376,704,376,704,372,708,372,708,380,700,380,700,376,704,376,1756,412,696,380,704,376,1752,416,1748,408,1752,404,1756,412,1748,408,704,376,704,372,708,372}, //ON23
{5060,2168,356,1776,384,696,380,732,348,700,388,1776,380,700,380,700,376,704,388,720,356,1776,380,700,380,1780,388,1776,380,700,380,1780,384,1776,384,1776,380,1784,380,1780,380,700,376,1784,384,696,384,696,380,732,348,732,356,696,384,696,380,1780,376,1784,384,696,384,696,380,700,380,700,380,704,384,1776,380,700,380,728,348,704,408,672,416,664,412,668,412,700,380,672,404,704,384,668,412,668,408,700,380,672,408,704,384,1744,412,1752,404,1756,412,1748,408,672,408,704,376,672,416,29388,5088,2144,380,1748,408,676,404,708,380,696,384,1748,408,672,408,672,416,664,412,668,412,1748,408,676,412,1748,412,1748,408,672,416,1744,412,1748,408,1756,412,1748,408,1752,416,664,416,1744,412,668,408,676,404,676,412,668,412,696,380,700,380,1752,416,1744,412,668,408,676,404,676,412,668,412,696,380,672,408,672,408,672,416,664,412,668,412,672,408,1752,412,1748,412,668,408,676,404,1752,416,1744,412,1752,412,668,412,668,412,668,408,672,408,672,404,676,416,664,412,668,412,672,404,1756,412,668,412,668,408,672,408,672,408,1752,412,668,412,672,404,676,404,676,412,668,412,668,412,668,408,672,408,672,416,668,408,672,408,672,436,644,436,644,436,644,432,648,440,640,408,704,376,672,408,1756,408,1752,404,1756,412,1748,408,672,408,672,408,672,416,1748,408,672,408,1752,412,668,412,1748,408,1752,416,664,412,672,408,672,408,700,376,704,376,704,384,696,384,696,380,700,380,704,372,708,372,708,380,700,380,700,376,704,376,1756,412,696,380,704,376,1752,404,708,380,700,380,700,380,700,376,1752,416,696,384,696,380}, //ON24
{5060,2140,388,1776,380,696,380,700,380,700,380,1784,380,700,380,700,380,700,376,704,384,1776,384,696,380,1780,388,1776,380,728,352,1780,384,1776,384,1776,380,1784,384,1776,380,728,348,1784,384,728,352,728,348,732,348,732,348,732,356,724,352,1780,380,1780,384,728,352,728,352,728,348,732,348,732,356,1776,380,728,352,728,348,704,388,724,352,696,384,728,348,700,380,732,356,696,384,696,380,700,380,700,376,704,388,692,384,1776,380,1784,376,1784,380,1780,380,732,344,704,384,696,416,29388,5088,2112,412,1748,412,700,376,676,412,668,412,1748,408,700,380,672,404,676,416,664,412,1748,408,704,376,1756,412,1748,408,704,376,1752,412,1752,404,1756,412,1748,408,1752,408,704,384,1744,412,700,380,672,404,676,412,696,384,668,412,668,408,1752,416,1744,412,700,380,672,408,672,404,676,412,668,412,668,408,672,408,672,408,672,416,664,412,668,412,1752,404,1756,412,696,384,668,408,1752,416,1748,408,1752,404,704,384,668,412,668,412,668,408,672,408,672,416,664,416,664,412,672,408,1752,416,664,412,668,412,668,408,672,408,1752,416,664,412,672,408,672,404,676,404,676,412,668,412,672,404,672,408,672,404,676,416,664,412,672,408,672,404,676,404,676,412,668,412,668,408,672,408,672,408,672,416,664,412,672,408,672,408,1752,412,668,412,668,412,1748,408,672,416,1748,408,672,408,1752,404,1756,412,668,408,672,408,672,408,672,416,668,408,672,408,672,408,672,404,676,412,668,412,668,412,668,408,672,408,672,416,668,412,1748,408,672,404,676,404,1756,412,1748,408,672,408,676,432,648,440,1720,436,644,436,644,432}, //ON25
{5068,2136,380,1780,376,704,388,692,384,696,384,1776,380,704,384,696,384,696,380,700,380,1780,388,692,384,1776,380,1784,384,696,384,1776,380,1780,388,1772,384,1776,380,1784,384,696,380,1780,376,704,388,692,384,696,384,696,380,700,380,704,384,1776,380,1780,376,704,388,696,380,696,384,696,380,700,380,1784,384,696,380,700,380,700,376,704,388,692,384,696,384,696,380,704,376,704,384,696,384,696,380,700,380,704,376,700,388,1772,384,1776,380,1784,384,1776,380,700,380,700,388,692,384,29420,5056,2144,384,1776,380,700,388,692,388,692,384,1776,380,704,376,704,384,696,384,696,380,1780,380,700,388,1772,384,1780,376,704,384,1776,380,1780,380,1780,384,1776,384,1780,384,696,384,1776,380,700,380,700,388,692,384,696,384,696,384,700,376,1788,380,1776,380,700,380,700,376,704,384,696,384,696,384,700,376,704,376,704,384,696,384,696,380,700,380,1780,388,1776,380,700,376,704,376,1784,384,1776,380,1780,388,692,384,696,384,700,376,704,376,704,384,696,384,696,380,700,380,700,376,1784,384,696,384,700,376,704,376,704,384,1776,380,700,380,700,380,700,388,692,384,696,384,700,376,704,376,704,384,696,384,696,380,700,380,700,380,700,388,692,384,696,384,700,376,704,376,704,384,696,384,1776,380,700,380,700,388,692,384,1780,380,700,376,704,384,1776,380,700,380,1780,388,692,384,1776,384,1780,384,696,384,696,384,696,380,700,380,700,376,704,388,696,380,696,384,700,376,704,376,704,384,696,384,696,380,700,380,700,380,1780,384,696,384,700,376,1784,384,696,384,1776,380,700,380,700,388,1772,384,704,376,700,376}, //ON26

then I use this code to send the raw code with progmem but isn't working, can anyone tell me the problem
Thank you


Code: Select all

IRsend irsend; 
void setup() {                
  Serial.begin(9600);
}
String inData;


const unsigned int irTable[8][359] PROGMEM = { 
  {5056,2144,380,1780,380,700,388,692,384,696,384,1780,376,704,384,696,384,696,380,700,380,1780,388,692,384,1776,380,1784,384,696,384,1776,380,1780,388,1772,384,1780,376,1784,384,696,380,1780,380,700,388,692,384,696,384,700,376,704,376,704,384,1776,380,1780,380,700,388,692,384,696,384,700,376,704,376,1784,384,696,380,700,380,700,380,700,388,692,384,696,384,700,380,700,376,704,384,696,384,696,380,700,380,700,380,700,388,1776,380,1780,376,1784,384,1776,380,700,380,700,388,696,380,29420,5068,2132,384,1780,384,696,384,696,380,700,380,1780,388,692,384,696,384,696,384,696,380,1784,384,696,384,1776,380,1780,388,692,384,1780,376,1784,384,1776,380,1780,388,1772,384,696,384,1780,384,696,384,696,380,700,380,700,380,700,388,692,384,1776,380,1784,384,696,384,696,380,700,384,696,380,700,388,692,384,696,384,696,380,704,376,704,384,696,384,1776,380,1780,388,692,384,696,384,1780,376,1784,384,1776,380,700,376,704,388,692,384,696,384,700,376,704,376,704,384,696,384,696,380,700,380,700,376,704,388,692,384,696,384,1780,376,704,384,696,384,696,380,700,380,700,376,704,388,696,380,696,384,700,376,704,376,704,384,696,384,696,380,700,380,700,376,704,388,692,384,696,384,700,376,704,376,1784,384,696,380,1780,380,700,388,692,384,700,380,1780,376,704,384,1776,380,700,380,1780,388,1776,380,700,376,704,376,704,384,696,384,696,380,700,380,700,388,692,388,692,384,700,380,700,376,704,388,692,384,696,384,696,380,1780,388,692,388,692,384,700,380,1780,388,1772,384,696,380,1780,388,692,388,692,384,700,380},  //OFF19
  {5072,2132,384,1776,380,700,376,704,376,704,384,1776,380,700,380,700,380,700,388,696,380,1780,380,700,376,1784,384,1776,380,700,380,1784,384,1776,380,1780,388,1772,384,1776,380,700,388,1776,380,700,380,700,380,700,376,704,384,696,384,696,384,1776,380,1784,384,696,380,700,380,700,376,704,388,696,380,1776,380,704,376,704,384,696,384,696,380,700,380,700,380,700,388,692,384,696,384,696,384,696,380,704,384,696,384,696,384,1776,380,1780,388,1772,384,1780,376,704,384,696,384,696,380,29420,5072,2132,380,1780,380,700,388,692,384,696,384,1776,380,704,384,696,384,696,380,700,380,1780,376,704,384,1776,384,1780,376,704,384,1776,380,1780,376,1784,384,1780,376,1784,384,696,384,1776,380,700,376,704,388,696,380,696,384,700,380,700,376,1784,384,1776,380,700,380,700,388,692,388,692,384,700,380,700,376,704,376,704,384,696,384,696,380,704,376,1780,388,1776,380,700,380,700,376,1784,384,1776,380,1780,388,692,388,696,380,700,380,700,380,700,388,696,380,696,384,696,380,700,380,1780,388,696,380,700,380,700,380,700,376,1784,384,696,384,696,380,700,380,700,388,696,384,696,380,700,380,700,376,704,388,692,384,696,384,700,376,700,380,700,380,704,384,696,380,700,380,700,380,700,376,1784,384,1776,380,700,380,1784,384,696,380,700,380,700,376,1784,384,696,384,1776,380,704,384,1776,380,1780,376,704,388,692,384,696,384,696,384,696,380,704,376,704,384,696,384,696,380,700,380,700,376,704,388,692,384,696,384,696,380,1784,384,696,384,696,380,1780,380,700,388,692,384,1776,384,1780,384,696,384,696,380,700,380}, //ON20
  {5056,2144,380,1780,380,700,388,696,380,700,380,1780,376,704,384,696,384,696,384,696,380,1780,388,696,384,1776,380,1780,388,692,384,1776,380,1780,388,1776,380,1780,376,1784,384,696,384,1776,380,700,380,704,384,696,380,700,380,700,380,700,376,1784,384,1776,380,700,380,704,384,696,384,696,380,700,380,1780,388,692,384,696,384,696,380,700,380,704,384,696,384,696,380,700,380,700,380,700,388,692,388,692,384,696,384,700,376,1784,384,1776,380,1780,376,1784,384,696,384,700,376,704,376,29424,5064,2140,384,1776,380,700,380,700,380,700,376,1784,384,696,384,696,380,704,376,704,384,1776,380,700,380,1780,388,1772,384,696,380,1784,384,1776,380,1780,376,1784,384,1776,384,700,376,1784,384,696,380,700,380,700,380,700,392,688,384,696,384,1780,376,1784,384,700,376,700,380,700,380,700,388,692,384,696,384,700,380,700,376,704,384,696,384,696,384,1776,380,1780,388,692,384,696,384,1784,384,1772,384,1776,380,700,388,692,388,696,380,700,380,700,376,704,388,692,384,696,384,696,384,1776,380,704,384,696,384,696,380,700,380,1780,388,692,384,696,384,696,380,700,380,704,384,696,384,696,380,700,380,700,380,700,388,692,384,696,384,696,384,696,380,704,384,696,384,696,384,696,380,700,380,700,376,704,388,1772,384,1780,376,704,384,696,384,696,384,1776,380,700,388,1772,384,696,384,1780,384,1776,384,696,380,700,380,700,388,692,388,692,384,696,384,700,376,704,376,704,384,696,384,696,380,700,380,700,380,700,388,692,384,1780,380,700,376,704,384,1776,384,1776,380,700,388,1776,380,1780,376,704,388,692,384,696,384}, //ON21
  {5056,2144,384,1776,380,700,380,700,388,696,384,1776,380,728,348,732,360,720,356,696,384,1776,380,700,380,1784,380,1780,380,700,376,1784,384,1776,380,1780,388,1776,380,1780,376,704,384,1776,384,696,380,732,348,732,356,696,384,724,352,728,352,1780,388,1772,384,696,380,704,376,732,356,724,356,696,380,1780,380,728,348,704,384,696,384,696,412,700,380,672,404,676,404,676,412,668,412,696,380,672,408,676,404,672,416,664,416,1744,380,1784,384,1776,380,1780,388,692,416,664,416,696,380,29392,5084,2148,380,1748,388,696,412,668,412,668,408,1752,384,696,416,664,412,700,380,668,412,1752,412,668,412,1748,408,1752,416,664,416,1748,408,1752,404,1756,412,1748,408,1752,416,664,412,1752,408,672,404,676,412,668,412,668,412,668,408,672,408,1752,416,1748,408,672,404,676,412,668,412,668,412,668,408,672,408,672,408,672,416,668,408,672,408,672,408,1752,412,1748,412,668,408,672,408,1752,416,1748,408,1752,416,664,412,668,412,668,412,668,408,672,408,672,416,668,412,668,408,672,408,1752,412,668,412,668,412,668,408,672,408,1756,412,668,440,640,440,640,436,644,404,676,412,668,412,668,408,672,408,672,408,676,412,668,408,672,408,672,408,672,404,676,412,668,412,668,412,668,408,704,376,1752,416,668,408,1752,408,1752,412,668,412,668,412,704,372,1752,416,668,412,1744,412,672,404,1756,412,1748,408,700,380,704,376,704,372,708,384,696,380,700,380,700,376,704,376,708,380,696,384,700,376,704,376,704,372,708,372,708,380,1752,376,732,376,704,376,1756,380,732,344,1784,384,1780,376,1784,376,736,372,704,372,712,380}, //ON22
  {5060,2172,352,1776,384,700,376,704,376,732,356,1776,380,700,380,732,344,704,388,724,352,1776,384,700,376,1784,384,1776,380,700,380,1780,388,1776,380,1780,376,1784,384,1776,380,700,380,1784,380,700,380,700,376,704,376,704,384,696,384,696,384,1776,380,1780,384,728,352,700,380,700,376,732,360,692,384,1776,380,700,380,732,348,700,408,676,412,696,384,696,384,668,408,700,380,672,416,696,384,664,412,700,380,672,404,676,412,1748,412,1748,408,1752,412,1752,408,668,408,676,404,704,384,29388,5088,2144,384,1748,408,672,408,676,400,676,416,1744,412,668,412,700,376,676,412,696,384,1748,408,672,408,1752,412,1752,408,672,404,1756,412,1748,408,1752,408,1752,412,1748,412,672,404,1756,412,668,412,668,408,672,408,672,416,664,412,668,412,1752,404,1756,412,668,412,668,408,672,408,672,404,676,416,664,412,700,380,672,404,676,404,676,412,668,412,1748,408,1752,416,664,416,668,408,1752,404,1756,412,1748,408,672,408,672,416,664,416,664,412,672,408,672,408,672,404,676,412,668,412,1748,408,672,408,672,416,664,412,672,408,1752,404,676,416,664,412,668,412,668,408,672,408,672,408,676,412,668,408,700,380,700,380,672,436,644,436,644,432,648,440,640,440,640,408,676,412,668,412,696,380,672,408,1752,416,1744,412,1748,408,672,408,676,412,668,412,1752,404,672,404,1756,412,668,412,1748,408,1756,412,668,408,672,408,672,404,704,376,704,376,704,384,700,380,700,376,704,376,704,372,708,372,708,380,700,380,700,376,704,376,1756,412,696,380,704,376,1752,416,1748,408,1752,404,1756,412,1748,408,704,376,704,372,708,372}, //ON23
  {5060,2168,356,1776,384,696,380,732,348,700,388,1776,380,700,380,700,376,704,388,720,356,1776,380,700,380,1780,388,1776,380,700,380,1780,384,1776,384,1776,380,1784,380,1780,380,700,376,1784,384,696,384,696,380,732,348,732,356,696,384,696,380,1780,376,1784,384,696,384,696,380,700,380,700,380,704,384,1776,380,700,380,728,348,704,408,672,416,664,412,668,412,700,380,672,404,704,384,668,412,668,408,700,380,672,408,704,384,1744,412,1752,404,1756,412,1748,408,672,408,704,376,672,416,29388,5088,2144,380,1748,408,676,404,708,380,696,384,1748,408,672,408,672,416,664,412,668,412,1748,408,676,412,1748,412,1748,408,672,416,1744,412,1748,408,1756,412,1748,408,1752,416,664,416,1744,412,668,408,676,404,676,412,668,412,696,380,700,380,1752,416,1744,412,668,408,676,404,676,412,668,412,696,380,672,408,672,408,672,416,664,412,668,412,672,408,1752,412,1748,412,668,408,676,404,1752,416,1744,412,1752,412,668,412,668,412,668,408,672,408,672,404,676,416,664,412,668,412,672,404,1756,412,668,412,668,408,672,408,672,408,1752,412,668,412,672,404,676,404,676,412,668,412,668,412,668,408,672,408,672,416,668,408,672,408,672,436,644,436,644,436,644,432,648,440,640,408,704,376,672,408,1756,408,1752,404,1756,412,1748,408,672,408,672,408,672,416,1748,408,672,408,1752,412,668,412,1748,408,1752,416,664,412,672,408,672,408,700,376,704,376,704,384,696,384,696,380,700,380,704,372,708,372,708,380,700,380,700,376,704,376,1756,412,696,380,704,376,1752,404,708,380,700,380,700,380,700,376,1752,416,696,384,696,380}, //ON24
  {5060,2140,388,1776,380,696,380,700,380,700,380,1784,380,700,380,700,380,700,376,704,384,1776,384,696,380,1780,388,1776,380,728,352,1780,384,1776,384,1776,380,1784,384,1776,380,728,348,1784,384,728,352,728,348,732,348,732,348,732,356,724,352,1780,380,1780,384,728,352,728,352,728,348,732,348,732,356,1776,380,728,352,728,348,704,388,724,352,696,384,728,348,700,380,732,356,696,384,696,380,700,380,700,376,704,388,692,384,1776,380,1784,376,1784,380,1780,380,732,344,704,384,696,416,29388,5088,2112,412,1748,412,700,376,676,412,668,412,1748,408,700,380,672,404,676,416,664,412,1748,408,704,376,1756,412,1748,408,704,376,1752,412,1752,404,1756,412,1748,408,1752,408,704,384,1744,412,700,380,672,404,676,412,696,384,668,412,668,408,1752,416,1744,412,700,380,672,408,672,404,676,412,668,412,668,408,672,408,672,408,672,416,664,412,668,412,1752,404,1756,412,696,384,668,408,1752,416,1748,408,1752,404,704,384,668,412,668,412,668,408,672,408,672,416,664,416,664,412,672,408,1752,416,664,412,668,412,668,408,672,408,1752,416,664,412,672,408,672,404,676,404,676,412,668,412,672,404,672,408,672,404,676,416,664,412,672,408,672,404,676,404,676,412,668,412,668,408,672,408,672,408,672,416,664,412,672,408,672,408,1752,412,668,412,668,412,1748,408,672,416,1748,408,672,408,1752,404,1756,412,668,408,672,408,672,408,672,416,668,408,672,408,672,408,672,404,676,412,668,412,668,412,668,408,672,408,672,416,668,412,1748,408,672,404,676,404,1756,412,1748,408,672,408,676,432,648,440,1720,436,644,436,644,432}, //ON25
  {5068,2136,380,1780,376,704,388,692,384,696,384,1776,380,704,384,696,384,696,380,700,380,1780,388,692,384,1776,380,1784,384,696,384,1776,380,1780,388,1772,384,1776,380,1784,384,696,380,1780,376,704,388,692,384,696,384,696,380,700,380,704,384,1776,380,1780,376,704,388,696,380,696,384,696,380,700,380,1784,384,696,380,700,380,700,376,704,388,692,384,696,384,696,380,704,376,704,384,696,384,696,380,700,380,704,376,700,388,1772,384,1776,380,1784,384,1776,380,700,380,700,388,692,384,29420,5056,2144,384,1776,380,700,388,692,388,692,384,1776,380,704,376,704,384,696,384,696,380,1780,380,700,388,1772,384,1780,376,704,384,1776,380,1780,380,1780,384,1776,384,1780,384,696,384,1776,380,700,380,700,388,692,384,696,384,696,384,700,376,1788,380,1776,380,700,380,700,376,704,384,696,384,696,384,700,376,704,376,704,384,696,384,696,380,700,380,1780,388,1776,380,700,376,704,376,1784,384,1776,380,1780,388,692,384,696,384,700,376,704,376,704,384,696,384,696,380,700,380,700,376,1784,384,696,384,700,376,704,376,704,384,1776,380,700,380,700,380,700,388,692,384,696,384,700,376,704,376,704,384,696,384,696,380,700,380,700,380,700,388,692,384,696,384,700,376,704,376,704,384,696,384,1776,380,700,380,700,388,692,384,1780,380,700,376,704,384,1776,380,700,380,1780,388,692,384,1776,384,1780,384,696,384,696,384,696,380,700,380,700,376,704,388,696,380,696,384,700,376,704,376,704,384,696,384,696,380,700,380,700,380,1780,384,696,384,700,376,1784,384,696,384,1776,380,700,380,700,388,1772,384,704,376,700,376}, //ON26
  };
unsigned int irBuf[200];

void sendir(int i) {
  memcpy_P ( irBuf, &irTable[i][0], 359 * 2);
  irsend.sendRaw (irBuf, 67, 38);
}

void loop() 
{

   while (Serial.available() > 0)
    {
        char recieved = Serial.read();
        inData += recieved; 

        // Process message when new line character is recieved
        if (recieved == '\n')
        {
    
    if (inData == "OFF") {
      sendir(0);
    }
    if (inData == "ON pada 20") {
      sendir(1);
    }
    if (inData == "ON pada 21") {
      sendir(2);
    }
    if (inData == "ON pada 22") {
      sendir(3);
    }

    if (inData == "ON pada 23") {
      sendir(4);
    }
    if (inData == "ON pada 24") {
      sendir(5);
    }
    if (inData == "ON pada 25") {
      sendir(6);
    }
    if (inData == "ON pada 26") {
      sendir(7);
    }
    
   
     Serial.print(inData);
        
            inData = ""; // Clear recieved buffer
        }
    }

}
M Beni Harja
Posts: 3
Joined: Tue Mar 12, 2019 2:58 am

Re: Send some IR raw

Post by M Beni Harja »

But I used esp8266, i have tried and its hard to find same code for esp8266
Help me :((
User avatar
AnalysIR
Site Admin
Posts: 793
Joined: Sat Aug 31, 2013 3:51 pm
Location: Dublin, Ireland
Contact:

Re: Send some IR raw

Post by AnalysIR »

It may have been more helpful, if you had mentioned ESP8266 in your first post !

From Our blog:https://www.analysir.com/blog/2017/01/2 ... r-signals/ shows how to send signals on ESP8266.

Alternatively, you could also try the ESP8266 fork of IRremote: https://github.com/markszabo/IRremoteESP8266

We also offer an A.IR Shield on our web-shop, using ESP8266 or ESP32: https://www.analysir.com/blog/product/a ... ed-module/
M Beni Harja
Posts: 3
Joined: Tue Mar 12, 2019 2:58 am

Re: Send some IR raw

Post by M Beni Harja »

Hi i try to modified the sketch myself, no error notifications comes up in compiling. But when i connect the ir LED to pin D2 of esp8266, there is no signal transmitted from the ir LED

Code: Select all

#include <Arduino.h>
#include <IRremoteESP8266.h>
#include <IRsend.h>

const uint16_t kIrLed = 4;  // ESP8266 GPIO pin to use. Recommended: 4 (D2).

IRsend irsend(kIrLed);  // Set the GPIO to be used to sending the message.

//Example signals from various units (very long signals)
const unsigned int AC_irSignal1[] PROGMEM = {5072,2132,384,1776,380,700,376,704,376,704,384,1776,380,700,380,700,380,700,388,696,380,1780,380,700,376,1784,384,1776,380,700,380,1784,384,1776,380,1780,388,1772,384,1776,380,700,388,1776,380,700,380,700,380,700,376,704,384,696,384,696,384,1776,380,1784,384,696,380,700,380,700,376,704,388,696,380,1776,380,704,376,704,384,696,384,696,380,700,380,700,380,700,388,692,384,696,384,696,384,696,380,704,384,696,384,696,384,1776,380,1780,388,1772,384,1780,376,704,384,696,384,696,380,29420,5072,2132,380,1780,380,700,388,692,384,696,384,1776,380,704,384,696,384,696,380,700,380,1780,376,704,384,1776,384,1780,376,704,384,1776,380,1780,376,1784,384,1780,376,1784,384,696,384,1776,380,700,376,704,388,696,380,696,384,700,380,700,376,1784,384,1776,380,700,380,700,388,692,388,692,384,700,380,700,376,704,376,704,384,696,384,696,380,704,376,1780,388,1776,380,700,380,700,376,1784,384,1776,380,1780,388,692,388,696,380,700,380,700,380,700,388,696,380,696,384,696,380,700,380,1780,388,696,380,700,380,700,380,700,376,1784,384,696,384,696,380,700,380,700,388,696,384,696,380,700,380,700,376,704,388,692,384,696,384,700,376,700,380,700,380,704,384,696,380,700,380,700,380,700,376,1784,384,1776,380,700,380,1784,384,696,380,700,380,700,376,1784,384,696,384,1776,380,704,384,1776,380,1780,376,704,388,692,384,696,384,696,384,696,380,704,376,704,384,696,384,696,380,700,380,700,376,704,388,692,384,696,384,696,380,1784,384,696,384,696,380,1780,380,700,388,692,384,1776,384,1780,384,696,384,696,380,700,380}; //ON20
const unsigned int AC_irSignal2[] PROGMEM = {5056,2144,380,1780,380,700,388,696,380,700,380,1780,376,704,384,696,384,696,384,696,380,1780,388,696,384,1776,380,1780,388,692,384,1776,380,1780,388,1776,380,1780,376,1784,384,696,384,1776,380,700,380,704,384,696,380,700,380,700,380,700,376,1784,384,1776,380,700,380,704,384,696,384,696,380,700,380,1780,388,692,384,696,384,696,380,700,380,704,384,696,384,696,380,700,380,700,380,700,388,692,388,692,384,696,384,700,376,1784,384,1776,380,1780,376,1784,384,696,384,700,376,704,376,29424,5064,2140,384,1776,380,700,380,700,380,700,376,1784,384,696,384,696,380,704,376,704,384,1776,380,700,380,1780,388,1772,384,696,380,1784,384,1776,380,1780,376,1784,384,1776,384,700,376,1784,384,696,380,700,380,700,380,700,392,688,384,696,384,1780,376,1784,384,700,376,700,380,700,380,700,388,692,384,696,384,700,380,700,376,704,384,696,384,696,384,1776,380,1780,388,692,384,696,384,1784,384,1772,384,1776,380,700,388,692,388,696,380,700,380,700,376,704,388,692,384,696,384,696,384,1776,380,704,384,696,384,696,380,700,380,1780,388,692,384,696,384,696,380,700,380,704,384,696,384,696,380,700,380,700,380,700,388,692,384,696,384,696,384,696,380,704,384,696,384,696,384,696,380,700,380,700,376,704,388,1772,384,1780,376,704,384,696,384,696,384,1776,380,700,388,1772,384,696,384,1780,384,1776,384,696,380,700,380,700,388,692,388,692,384,696,384,700,376,704,376,704,384,696,384,696,380,700,380,700,380,700,388,692,384,1780,380,700,376,704,384,1776,384,1776,380,700,388,1776,380,1780,376,704,388,692,384,696,384}; //ON21
const unsigned int AC_irSignal3[] PROGMEM = {5056,2144,384,1776,380,700,380,700,388,696,384,1776,380,728,348,732,360,720,356,696,384,1776,380,700,380,1784,380,1780,380,700,376,1784,384,1776,380,1780,388,1776,380,1780,376,704,384,1776,384,696,380,732,348,732,356,696,384,724,352,728,352,1780,388,1772,384,696,380,704,376,732,356,724,356,696,380,1780,380,728,348,704,384,696,384,696,412,700,380,672,404,676,404,676,412,668,412,696,380,672,408,676,404,672,416,664,416,1744,380,1784,384,1776,380,1780,388,692,416,664,416,696,380,29392,5084,2148,380,1748,388,696,412,668,412,668,408,1752,384,696,416,664,412,700,380,668,412,1752,412,668,412,1748,408,1752,416,664,416,1748,408,1752,404,1756,412,1748,408,1752,416,664,412,1752,408,672,404,676,412,668,412,668,412,668,408,672,408,1752,416,1748,408,672,404,676,412,668,412,668,412,668,408,672,408,672,408,672,416,668,408,672,408,672,408,1752,412,1748,412,668,408,672,408,1752,416,1748,408,1752,416,664,412,668,412,668,412,668,408,672,408,672,416,668,412,668,408,672,408,1752,412,668,412,668,412,668,408,672,408,1756,412,668,440,640,440,640,436,644,404,676,412,668,412,668,408,672,408,672,408,676,412,668,408,672,408,672,408,672,404,676,412,668,412,668,412,668,408,704,376,1752,416,668,408,1752,408,1752,412,668,412,668,412,704,372,1752,416,668,412,1744,412,672,404,1756,412,1748,408,700,380,704,376,704,372,708,384,696,380,700,380,700,376,704,376,708,380,696,384,700,376,704,376,704,372,708,372,708,380,1752,376,732,376,704,376,1756,380,732,344,1784,384,1780,376,1784,376,736,372,704,372,712,380}; //ON22
const unsigned int AC_irSignal4[] PROGMEM = {5060,2172,352,1776,384,700,376,704,376,732,356,1776,380,700,380,732,344,704,388,724,352,1776,384,700,376,1784,384,1776,380,700,380,1780,388,1776,380,1780,376,1784,384,1776,380,700,380,1784,380,700,380,700,376,704,376,704,384,696,384,696,384,1776,380,1780,384,728,352,700,380,700,376,732,360,692,384,1776,380,700,380,732,348,700,408,676,412,696,384,696,384,668,408,700,380,672,416,696,384,664,412,700,380,672,404,676,412,1748,412,1748,408,1752,412,1752,408,668,408,676,404,704,384,29388,5088,2144,384,1748,408,672,408,676,400,676,416,1744,412,668,412,700,376,676,412,696,384,1748,408,672,408,1752,412,1752,408,672,404,1756,412,1748,408,1752,408,1752,412,1748,412,672,404,1756,412,668,412,668,408,672,408,672,416,664,412,668,412,1752,404,1756,412,668,412,668,408,672,408,672,404,676,416,664,412,700,380,672,404,676,404,676,412,668,412,1748,408,1752,416,664,416,668,408,1752,404,1756,412,1748,408,672,408,672,416,664,416,664,412,672,408,672,408,672,404,676,412,668,412,1748,408,672,408,672,416,664,412,672,408,1752,404,676,416,664,412,668,412,668,408,672,408,672,408,676,412,668,408,700,380,700,380,672,436,644,436,644,432,648,440,640,440,640,408,676,412,668,412,696,380,672,408,1752,416,1744,412,1748,408,672,408,676,412,668,412,1752,404,672,404,1756,412,668,412,1748,408,1756,412,668,408,672,408,672,404,704,376,704,376,704,384,700,380,700,376,704,376,704,372,708,372,708,380,700,380,700,376,704,376,1756,412,696,380,704,376,1752,416,1748,408,1752,404,1756,412,1748,408,704,376,704,372,708,372}; //ON23
const unsigned int AC_irSignal5[] PROGMEM = {5060,2168,356,1776,384,696,380,732,348,700,388,1776,380,700,380,700,376,704,388,720,356,1776,380,700,380,1780,388,1776,380,700,380,1780,384,1776,384,1776,380,1784,380,1780,380,700,376,1784,384,696,384,696,380,732,348,732,356,696,384,696,380,1780,376,1784,384,696,384,696,380,700,380,700,380,704,384,1776,380,700,380,728,348,704,408,672,416,664,412,668,412,700,380,672,404,704,384,668,412,668,408,700,380,672,408,704,384,1744,412,1752,404,1756,412,1748,408,672,408,704,376,672,416,29388,5088,2144,380,1748,408,676,404,708,380,696,384,1748,408,672,408,672,416,664,412,668,412,1748,408,676,412,1748,412,1748,408,672,416,1744,412,1748,408,1756,412,1748,408,1752,416,664,416,1744,412,668,408,676,404,676,412,668,412,696,380,700,380,1752,416,1744,412,668,408,676,404,676,412,668,412,696,380,672,408,672,408,672,416,664,412,668,412,672,408,1752,412,1748,412,668,408,676,404,1752,416,1744,412,1752,412,668,412,668,412,668,408,672,408,672,404,676,416,664,412,668,412,672,404,1756,412,668,412,668,408,672,408,672,408,1752,412,668,412,672,404,676,404,676,412,668,412,668,412,668,408,672,408,672,416,668,408,672,408,672,436,644,436,644,436,644,432,648,440,640,408,704,376,672,408,1756,408,1752,404,1756,412,1748,408,672,408,672,408,672,416,1748,408,672,408,1752,412,668,412,1748,408,1752,416,664,412,672,408,672,408,700,376,704,376,704,384,696,384,696,380,700,380,704,372,708,372,708,380,700,380,700,376,704,376,1756,412,696,380,704,376,1752,404,708,380,700,380,700,380,700,376,1752,416,696,384,696,380}; //ON24
const unsigned int AC_irSignal6[] PROGMEM = {5060,2140,388,1776,380,696,380,700,380,700,380,1784,380,700,380,700,380,700,376,704,384,1776,384,696,380,1780,388,1776,380,728,352,1780,384,1776,384,1776,380,1784,384,1776,380,728,348,1784,384,728,352,728,348,732,348,732,348,732,356,724,352,1780,380,1780,384,728,352,728,352,728,348,732,348,732,356,1776,380,728,352,728,348,704,388,724,352,696,384,728,348,700,380,732,356,696,384,696,380,700,380,700,376,704,388,692,384,1776,380,1784,376,1784,380,1780,380,732,344,704,384,696,416,29388,5088,2112,412,1748,412,700,376,676,412,668,412,1748,408,700,380,672,404,676,416,664,412,1748,408,704,376,1756,412,1748,408,704,376,1752,412,1752,404,1756,412,1748,408,1752,408,704,384,1744,412,700,380,672,404,676,412,696,384,668,412,668,408,1752,416,1744,412,700,380,672,408,672,404,676,412,668,412,668,408,672,408,672,408,672,416,664,412,668,412,1752,404,1756,412,696,384,668,408,1752,416,1748,408,1752,404,704,384,668,412,668,412,668,408,672,408,672,416,664,416,664,412,672,408,1752,416,664,412,668,412,668,408,672,408,1752,416,664,412,672,408,672,404,676,404,676,412,668,412,672,404,672,408,672,404,676,416,664,412,672,408,672,404,676,404,676,412,668,412,668,408,672,408,672,408,672,416,664,412,672,408,672,408,1752,412,668,412,668,412,1748,408,672,416,1748,408,672,408,1752,404,1756,412,668,408,672,408,672,408,672,416,668,408,672,408,672,408,672,404,676,412,668,412,668,412,668,408,672,408,672,416,668,412,1748,408,672,404,676,404,1756,412,1748,408,672,408,676,432,648,440,1720,436,644,436,644,432}; //ON25
const unsigned int AC_irSignal7[] PROGMEM = {5068,2136,380,1780,376,704,388,692,384,696,384,1776,380,704,384,696,384,696,380,700,380,1780,388,692,384,1776,380,1784,384,696,384,1776,380,1780,388,1772,384,1776,380,1784,384,696,380,1780,376,704,388,692,384,696,384,696,380,700,380,704,384,1776,380,1780,376,704,388,696,380,696,384,696,380,700,380,1784,384,696,380,700,380,700,376,704,388,692,384,696,384,696,380,704,376,704,384,696,384,696,380,700,380,704,376,700,388,1772,384,1776,380,1784,384,1776,380,700,380,700,388,692,384,29420,5056,2144,384,1776,380,700,388,692,388,692,384,1776,380,704,376,704,384,696,384,696,380,1780,380,700,388,1772,384,1780,376,704,384,1776,380,1780,380,1780,384,1776,384,1780,384,696,384,1776,380,700,380,700,388,692,384,696,384,696,384,700,376,1788,380,1776,380,700,380,700,376,704,384,696,384,696,384,700,376,704,376,704,384,696,384,696,380,700,380,1780,388,1776,380,700,376,704,376,1784,384,1776,380,1780,388,692,384,696,384,700,376,704,376,704,384,696,384,696,380,700,380,700,376,1784,384,696,384,700,376,704,376,704,384,1776,380,700,380,700,380,700,388,692,384,696,384,700,376,704,376,704,384,696,384,696,380,700,380,700,380,700,388,692,384,696,384,700,376,704,376,704,384,696,384,1776,380,700,380,700,388,692,384,1780,380,700,376,704,384,1776,380,700,380,1780,388,692,384,1776,384,1780,384,696,384,696,384,696,380,700,380,700,376,704,388,696,380,696,384,700,376,704,376,704,384,696,384,696,380,700,380,700,380,1780,384,696,384,700,376,1784,384,696,384,1776,380,700,380,700,388,1772,384,704,376,700,376}; //ON26
const unsigned int AC_irSignal8[] PROGMEM = {5056,2144,380,1780,380,700,388,692,384,696,384,1780,376,704,384,696,384,696,380,700,380,1780,388,692,384,1776,380,1784,384,696,384,1776,380,1780,388,1772,384,1780,376,1784,384,696,380,1780,380,700,388,692,384,696,384,700,376,704,376,704,384,1776,380,1780,380,700,388,692,384,696,384,700,376,704,376,1784,384,696,380,700,380,700,380,700,388,692,384,696,384,700,380,700,376,704,384,696,384,696,380,700,380,700,380,700,388,1776,380,1780,376,1784,384,1776,380,700,380,700,388,696,380,29420,5068,2132,384,1780,384,696,384,696,380,700,380,1780,388,692,384,696,384,696,384,696,380,1784,384,696,384,1776,380,1780,388,692,384,1780,376,1784,384,1776,380,1780,388,1772,384,696,384,1780,384,696,384,696,380,700,380,700,380,700,388,692,384,1776,380,1784,384,696,384,696,380,700,384,696,380,700,388,692,384,696,384,696,380,704,376,704,384,696,384,1776,380,1780,388,692,384,696,384,1780,376,1784,384,1776,380,700,376,704,388,692,384,696,384,700,376,704,376,704,384,696,384,696,380,700,380,700,376,704,388,692,384,696,384,1780,376,704,384,696,384,696,380,700,380,700,376,704,388,696,380,696,384,700,376,704,376,704,384,696,384,696,380,700,380,700,376,704,388,692,384,696,384,700,376,704,376,1784,384,696,380,1780,380,700,388,692,384,700,380,1780,376,704,384,1776,380,700,380,1780,388,1776,380,700,376,704,376,704,384,696,384,696,380,700,380,700,388,692,388,692,384,700,380,700,376,704,388,692,384,696,384,696,380,1780,388,692,388,692,384,700,380,1780,388,1772,384,696,380,1780,388,692,388,692,384,700,380};  //OFF19


void setup() {
  //insert your own setup code here
  irsend.begin();
#if ESP8266
  Serial.begin(115200, SERIAL_8N1, SERIAL_TX_ONLY);
#else  // ESP8266
  Serial.begin(115200, SERIAL_8N1);
#endif  // ESP8266
}

void loop() {
  //replace this with your own code.
  while (true){ //loop forever sending the test signals, with 5 second gaps 
  sendRAW_Flash(AC_irSignal1, sizeof(AC_irSignal1)/sizeof(int),38); //send AC signal #1 @ 38kHz
  delay(5000); //a good idea to have gaps between signals

  sendRAW_Flash(AC_irSignal2, sizeof(AC_irSignal2)/sizeof(int),38); //send AC signal #2 @ 38kHz
  delay(5000); //a good idea to have gaps between signals

  sendRAW_Flash(AC_irSignal3, sizeof(AC_irSignal3)/sizeof(int),38); //send AC signal #3 @ 38kHz
  delay(5000); //a good idea to have gaps between signals

  sendRAW_Flash(AC_irSignal4, sizeof(AC_irSignal4)/sizeof(int),38); //send AC signal #4 @ 38kHz
  delay(5000); //a good idea to have gaps between signals

  sendRAW_Flash(AC_irSignal5, sizeof(AC_irSignal5)/sizeof(int),38); //send AC signal #5 @ 38kHz
  delay(5000); //a good idea to have gaps between signals

   sendRAW_Flash(AC_irSignal6, sizeof(AC_irSignal6)/sizeof(int),38); //send AC signal #6 @ 38kHz
  delay(5000); //a good idea to have gaps between signals

   sendRAW_Flash(AC_irSignal7, sizeof(AC_irSignal7)/sizeof(int),38); //send AC signal #7 @ 38kHz
  delay(5000); //a good idea to have gaps between signals

   sendRAW_Flash(AC_irSignal8, sizeof(AC_irSignal8)/sizeof(int),38); //send AC signal #8 @ 38kHz
  delay(5000); //a good idea to have gaps between signals
  }
}

void sendRAW_Flash(const unsigned int * signalArray, unsigned int signalLength, unsigned char carrierFreq) {

  irsend.enableIROut(carrierFreq); //initialise the carrier frequency for each signal to be sent
  
  for (unsigned int i=0;i<signalLength;i++){
    //tmp=pgm_read_word_near(&signalArray[i]);
   // tmp=cleanPanasonic(tmp); //not needed
    if (i & 1) irsend.space(pgm_read_word_near(&signalArray[i]));
    else irsend.mark(pgm_read_word_near(&signalArray[i]));
  }
  irsend.space(1);//make sure IR is turned off at end of signal

}
Help me to repair my sketch :(((
Thank you everyone.
User avatar
AnalysIR
Site Admin
Posts: 793
Joined: Sat Aug 31, 2013 3:51 pm
Location: Dublin, Ireland
Contact:

Re: Send some IR raw

Post by AnalysIR »

Now that you are using IRremoteESP8266, just use the sendraw example from this library.

The code from our blog, is different. Ignore that code as well & start from the beginning with the library example
(The PROGMEM & sendRawFlash were for AVRs not ESP)

Start with the code provided in the library example.

Only when you get that working, proceed to using your own signals.
lenthaprasna
Posts: 5
Joined: Sun Sep 08, 2019 4:58 pm

Re: Send some IR raw

Post by lenthaprasna »

i try to send raw panasonic AC data with esp 8266 but when i use code "Recording long Infrared Remote control signals with Arduino" to see my send data from my esp 8266.
this my send code esp 8266:

Code: Select all

/* IRremoteESP8266: IRsendDemo - demonstrates sending IR codes with IRsend.
 *
 * Version 1.1 January, 2019
 * Based on Ken Shirriff's IrsendDemo Version 0.1 July, 2009,
 * Copyright 2009 Ken Shirriff, http://arcfn.com
 *
 * An IR LED circuit *MUST* be connected to the ESP8266 on a pin
 * as specified by kIrLed below.
 *
 * TL;DR: The IR LED needs to be driven by a transistor for a good result.
 *
 * Suggested circuit:
 *     https://github.com/crankyoldgit/IRremoteESP8266/wiki#ir-sending
 *
 * Common mistakes & tips:
 *   * Don't just connect the IR LED directly to the pin, it won't
 *     have enough current to drive the IR LED effectively.
 *   * Make sure you have the IR LED polarity correct.
 *     See: https://learn.sparkfun.com/tutorials/polarity/diode-and-led-polarity
 *   * Typical digital camera/phones can be used to see if the IR LED is flashed.
 *     Replace the IR LED with a normal LED if you don't have a digital camera
 *     when debugging.
 *   * Avoid using the following pins unless you really know what you are doing:
 *     * Pin 0/D3: Can interfere with the boot/program mode & support circuits.
 *     * Pin 1/TX/TXD0: Any serial transmissions from the ESP8266 will interfere.
 *     * Pin 3/RX/RXD0: Any serial transmissions to the ESP8266 will interfere.
 *   * ESP-01 modules are tricky. We suggest you use a module with more GPIOs
 *     for your first time. e.g. ESP-12 etc.
 */

#include <Arduino.h>
#include <IRremoteESP8266.h>
#include <IRsend.h>

const uint16_t kIrLed = 4;  // ESP8266 GPIO pin to use. Recommended: 4 (D2).

IRsend irsend(kIrLed);  // Set the GPIO to be used to sending the message.


uint16_t rawData[439] = {3500,1750,435,435,435,1300,435,435,435,435,435,435,435,435,435,435,435,435,435,435,435,435,435,435,435,435,435,435,435,1300,435,435,435,435,435,435,435,435,435,435,435,435,435,435,435,1300,435,1300,435,1300,435,435,435,435,435,1300,435,435,435,435,435,435,435,435,435,435,435,435,435,435,435,435,435,435,435,435,435,435,435,435,435,435,435,435,435,435,435,435,435,435,435,435,435,435,435,435,435,435,435,435,435,435,435,435,435,435,435,435,435,435,435,435,435,435,435,435,435,1300,435,1300,435,435,435,435,435,435,435,435,435,435,435,10664,3500,1750,435,435,435,1300,435,435,435,435,435,435,435,435,435,435,435,435,435,435,435,435,435,435,435,435,435,435,435,1300,435,435,435,435,435,435,435,435,435,435,435,435,435,435,435,1300,435,1300,435,1300,435,435,435,435,435,1300,435,435,435,435,435,435,435,435,435,435,435,435,435,435,435,435,435,435,435,435,435,435,435,435,435,435,435,1300,435,435,435,435,435,1300,435,1300,435,1300,435,435,435,435,435,435,435,1300,435,1300,435,435,435,1300,435,1300,435,435,435,435,435,435,435,435,435,435,435,435,435,435,435,435,435,435,435,1300,435,1300,435,1300,435,1300,435,1300,435,435,435,1300,435,435,435,1300,435,435,435,435,435,435,435,435,435,435,435,435,435,435,435,435,435,435,435,435,435,435,435,435,435,435,435,435,435,435,435,435,435,435,435,1300,435,1300,435,1300,435,435,435,435,435,435,435,435,435,435,435,435,435,435,435,435,435,435,435,1300,435,1300,435,1300,435,435,435,435,435,435,435,435,435,435,435,435,435,435,435,435,435,435,435,435,435,435,435,435,435,435,435,435,435,435,435,435,435,1300,435,435,435,435,435,435,435,435,435,435,435,435,435,1300,435,435,435,435,435,435,435,435,435,435,435,435,435,435,435,435,435,435,435,435,435,435,435,435,435,435,435,435,435,435,435,435,435,1300,435,1300,435,435,435,435,435,1300,435,435,435,435,435,435,435}; //AnalysIR Batch Export (IRremote) - RAW


void setup() {
  irsend.begin();
#if ESP8266
  Serial.begin(115200, SERIAL_8N1, SERIAL_TX_ONLY);
#else  // ESP8266
  Serial.begin(115200, SERIAL_8N1);
#endif  // ESP8266
}

void loop() {
  Serial.println("NEC");
  irsend.sendRaw(rawData,439,38);
  delay(10000);

}
but RAW data that i get is:
Raw: (105) 72, -16560, 76, -800, 60, -1668, 60, -816, 60, -816, 60, -15652, 76, -812, 64, -812, 64, -800, 76, -800, 76, -800, 60, -828, 60, -800, 60, -13948, 76, -800, 60, -2576, 64, -18880, 64, -17436, 72, -1664, 64, -812, 64, -1700, 64, -15640, 76, -1684, 80, -796, 64, -2552, 56, -13908, 72, -1668, 60, -1676, 64, -4296, 56, -13052, 60, -1668, 60, -1680, 60, -15676, 76, -800, 76, -800, 60, -816, 72, -800, 64, -4292, 60, -9560, 56, -3436, 64, -2540, 60, -816, 76, -1676, 56, -13948, 64, -804, 60, -812, 60, -816, 60, -816, 60, -17428, 76, -3416, 56, -2560, 56, -816, 60,

Press the button on the remote now - once only

Raw: (2) 5612, -60,

Press the button on the remote now - once only

Raw: (93) 60, -17276, 60, -13924, 56, -1692, 76, -3428, 60, -816, 60, -804, 76, -14760, 76, -812, 64, -800, 60, -816, 60, -816, 60, -816, 60, -16572, 60, -816, 60, -816, 60, -816, 60, -816, 72, -35504, 60, -2556, 72, -804, 72, -804, 56, -13028, 76, -2552, 60, -816, 60, -812, 76, -800, 60, -16532, 60, -4296, 72, -804, 60, -16516, 60, -3432, 64, -800, 60, -14800, 76, -1688, 60, -1680, 72, -804, 60, -14776, 76, -1664, 76, -1664, 76, -812, 64, -15672, 56, -1696, 60, -18312, 60, -3420, 76, -812, 60, -9860, 72,

Press the button on the remote now - once only

Raw: (0)

Press the button on the remote now - once only

Raw: (85) 56, -45580, 76, -788, 76, -796, 64, -812, 60, -816, 60, -14780, 72, -1668, 60, -2564, 64, -3440, 56, -12200, 76, -1672, 64, -2564, 60, -816, 76, -35512, 64, -800, 76, -800, 76, -800, 76, -800, 60, -16516, 60, -3444, 60, -18292, 64, -800, 76, -17376, 76, -3408, 56, -15656, 76, -1676, 60, -812, 64, -812, 64, -812, 60, -15668, 56, -816, 60, -1680, 64, -1676, 64, -2552, 48, -14824, 76, -800, 60, -816, 76, -800, 60, -1692, 52, -13952, 64, -2552, 76, -1664, 76,

Press the button on the remote now - once only

Raw: (2) 52216, -56,

Press the button on the remote now - once only

Raw: (107) 64, -812, 60, -1692, 60, -816, 76, -796, 64, -1692, 56, -828, 64, -1664, 60, -2568, 56, -12156, 76, -800, 56, -816, 76, -804, 72, -800, 64, -15696, 76, -800, 76, -800, 72, -1676, 76, -800, 76, -35500, 64, -812, 60, -828, 64, -3416, 60, -1688, 60, -13040, 80, -784, 76, -800, 64, -812, 60, -816, 60, -816, 60, -15652, 64, -812, 60, -5172, 56, -15656, 64, -1676, 60, -4296, 60, -12176, 60, -828, 64, -808, 64, -812, 80, -788, 56, -816, 60, -1692, 60, -13036, 64, -824, 64, -1664, 76, -17412, 76, -1664, 60, -816, 60, -816, 60, -1704, 60, -1680, 56, -13064, 56, -6048, 56,

Press the button on the remote now - once only

Raw: (2) 46140, -56,

Press the button on the remote now - once only

Raw: (99) 56, -36648, 56, -2548, 60, -812, 64, -812, 60, -13028, 60, -3440, 64, -1692, 72, -1688, 64, -1688, 60, -13936, 60, -2576, 80, -1648, 64, -17152, 76, -19160, 76, -800, 60, -816, 60, -816, 60, -816, 60, -4308, 56, -6912, 56, -5208, 64, -800, 76, -812, 64, -812, 64, -800, 60, -2564, 60, -13020, 60, -4292, 76, -11284, 76, -5156, 64, -2540, 60, -18300, 64, -812, 60, -1692, 64, -16516, 76, -788, 76, -800, 72, -800, 76, -800, 64, -14808, 76, -800, 76, -800, 60, -2556, 60, -816, 56, -14816, 72, -1664, 64, -812, 80, -796, 64, -4304, 60,

Press the button on the remote now - once only

Raw: (3) 52, -25952, 60,

Press the button on the remote now - once only

Raw: (97) 80, -3400, 56, -10440, 56, -5196, 76, -2540, 76, -14784, 64, -812, 64, -800, 60, -816, 72, -804, 76, -796, 64, -15688, 72, -1664, 64, -812, 64, -1688, 76, -18900, 60, -1692, 76, -14784, 60, -1700, 64, -804, 56, -1680, 64, -1676, 60, -13928, 76, -800, 56, -816, 76, -800, 76, -19972, 60, -816, 60, -816, 60, -1692, 56, -14760, 60, -2556, 60, -812, 76, -800, 60, -11324, 56, -5184, 64, -1664, 60, -816, 60, -15664, 60, -816, 60, -816, 60, -5192, 60, -10436, 56, -4308, 76, -1676, 60, -13052, 60, -3440, 80, -784, 76, -800, 76,

Press the button on the remote now - once only

Raw: (4) 40092, -56, 29304, -60,

why the RAW data tha i get is different? please help me
User avatar
AnalysIR
Site Admin
Posts: 793
Joined: Sat Aug 31, 2013 3:51 pm
Location: Dublin, Ireland
Contact:

Re: Send some IR raw

Post by AnalysIR »

The signal you get is clearly bad. However I do'nt know anything about your IR emitter circuit & type of ESP8266 you are using. Also the receiver you are using. Links & photos/schematics would help.

Similarly desbribe you Rx platform as well.

Please copy the all of the above and the additional info above to a new post with a new title & I will look at it.

FYI: we have the A.IR Shield ESP8266/ESP32 available in our webshop, which would likely make life a lot easier for you. Also make sure to check our our numerous blog post on ESP in our forum.
Post Reply