-1

im having a problem with my new project with arduino + ir emitter + big raw codes.

I've tryed this way:

https://gist.github.com/jjmjr/41ed083c8229d0218c962641c5af27b0

As you can see each of my raw code from air conditioner is huge so i've tryed with progmem using "a" (as turn on) command on serial to send the first line from the ir raw codes but didnt work.

Any one can help me?

Thanks

  • 2
    didnt work is a very poor description of the observed result .... it contains no information that could be used to solve the problem – jsotola Jan 5 at 3:53
  • 1
    please add the code listing to your question ..... use the {} button to format it as code – jsotola Jan 5 at 3:55
  • 1
    Please make it clear in your question that the code you are asking about is in the github.com link in the question. In fact, you may go as far as copying some of that code into your question. If true, I think I can see how you can cut your data array in half. Divide all the values in your array by 50 and change the type from unsigned int to unsigned char. This should work as long as all the resulting numbers (after you divide by 50) are less than 256. Then, when you call the IR library methods, multiply the array values by 50 to restore the original value. – st2000 Jan 5 at 4:40
  • ...Let us know if the above works and I'll copy it to an Answer you can accept. – st2000 Jan 5 at 4:41
  • it doesn't help to have the arrays as PROGMEM if you load them to RAM as whole. @st2000, one of the codes is 25060 – Juraj Jan 5 at 6:56
0

These are the beginning few data pairs.

You can see that they repeat in a predictable pattern.

Reduce the data in your sketch by storing a "key" for each pair of numbers.

First few pairs would be stored as something like this.

0, 0, 0, 0, 0, X, Y, 1, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 1, 1, 0,

 508, 356,         // 0   make all zeros 508, 360 
 508, 360,         // 0   adjust the values if necessary
 504, 364,         // 0
 508, 356,         // 0
 508, 360,         // 0

 508, 25052,       // X

 3540, 1664,       // Y

 504, 1232,        // 1   make all (1) 508, 1230

 496, 364,         // 0
 504, 360,         // 0
 508, 360,         // 0

 508, 1232,        // 1

 492, 368,         // 0
 508, 356,         // 0
 512, 356,         // 0
 508, 360,         // 0

 508, 1232,        // 1

 492, 364,         // 0

 512, 1228,        // 1
 496, 1240,        // 1

 492, 368,         // 0

 508, 1228,
 496, 1240,
 492, 1240,
 492, 1240,
 492, 1240,

Check this out https://test.sui.li/oszi/

Your Answer

By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.

Not the answer you're looking for? Browse other questions tagged or ask your own question.