My very first try on ir receiver and sender

i need to convert a ir signal from a amazon fire stick crappy ir code library with my arduino nano so i can turn on and of the projetor on and off, that's all i need, i'm learning trough youtube tutorials + chatgpt. here is my remote code which i want to turn on the projector: Protocol=Sony Address=0x1 Command=0x15 Raw-Data=0x95 12 bits LSB first
and here is the ir output signal that arduino has to send to projetor Protocol=NEC Address=0x3 Command=0x10 Raw-Data=0xEF10FC03 32 bits LSB first

with help of bing AI i came with this code, should be a simple task receive one signal and send another but for me is something totally new if anyone can help me out find a way no make it happen i will be so gratefully, i get several projectors every year, for my home cinema and sell some so this code would be super usefull as most of chinese brands aren't listed on fire TV database:

#include <IRremote.h>

IRrecv irrecv(2);
IRsend irsend;

decode_results results;

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

void loop()
{
  if (irrecv.decode(&results))
  {
    if (results.decode_type == NEC)
    {
      if (results.value == 0xFF000033)
      {
        delay(500);
        irsend.sendNEC(0x80, 0xD7, 32);
        delayMicroseconds(39400);
        irsend.sendNEC(0x80, 0xD7, 32);
      }
    }
    irrecv.resume();
  }
}

Enter your data here:

1 Like

What version of the IRremote library are you using? The posted code is written for a version prior to version 3.x. There are significant differences between the new versions of the library and the older versions.

I'm probably using 2.x cause Bing AI uses older version i asked to update to version 4 but gives me errors, that's all i know for now it's my third day trying arduino, I'm amazed specially for home applications as I use homeassistant, could you point me to the right direction? I've read the document to update to version 4 but all i get are formatting errors.

This code was a try of Bing AI to update the code to the version 4.x btw

It is late here. I may be able to spend some time tomorrow.

Use NI and learn using libraries.

2 Likes

Thanks :pray:t4:

I'm trying but I think it takes a bit of time but I'm on the way.
I tried starting with examples which gives me the data from remotes, but they are full of different versions of hardware I'm trying to debloat and start with the simplest.

What hardware?

I mean, the example contains codes for all arduino versions, I just need for nano.

This topic was automatically closed 180 days after the last reply. New replies are no longer allowed.