IR Reciver crazy

Hello,
I'm trying to use a remote controller but when i print the value in the serial monitor it give me value too much different for the same botton.
I'm using the library IRRemoteControl at the lastest version.
This is the code

/*
 * IRsend: IRRemoteControlDemo - demonstrates receiving/sending IR codes.
 * Created by Cristiano Borges - STI - Fatesg
 * August, 2017
 */

#include "IRRemoteControl.h"

IRRecv irRecv;
IRSend irSend;

const int IR_RECV_PIN = 3;

const int MAX_IR_BUFFER_LENGTH = 650;
unsigned int irBuffer[MAX_IR_BUFFER_LENGTH];
int currentIrBufferLength = 0;

const int FREQ_KHZ = 40;

void setup() {
  Serial.begin(115200);
  pinMode(LED_BUILTIN, OUTPUT);
  irRecv.start(IR_RECV_PIN, irBuffer, MAX_IR_BUFFER_LENGTH, currentIrBufferLength);
}

void loop() {
  Serial.print(".");
  delay(1000);
  
  if (currentIrBufferLength > 0) {
    irRecv.stop(IR_RECV_PIN);

    Serial.println();
    Serial.println(F("Code: "));
    
    for (int i = 0; i < currentIrBufferLength; i++) {
      if (i > 0) {
        Serial.println();
      }
      Serial.print(irBuffer[i]);
    }
    
    Serial.println();

    irRecv.start(IR_RECV_PIN, irBuffer, MAX_IR_BUFFER_LENGTH, currentIrBufferLength);
  }
}

I use the arduino uno

Hi,
which value should print and which value is printing.
Put the printout inside the </> tags.

it should print some near value ( max. variation 150).
But it print
14884 800 144 200 172 1120 148 748 112 120 272 848 140 360 144 408 996 352 38208 248 for example

Hi,
Is your IR sensor 40 KHz?
The ones I use are 38 KHz.

I don't use this library.
And I use " IRremote.h"
@ GitHub - Arduino-IRremote/Arduino-IRremote: Infrared remote library for Arduino: send and receive infrared signals with multiple protocols

I don't know :cry: but i think is 38Kz
This is the link where i bought

If i use the IRremote.h instead where i can find some updated tutorials for the remote controller?

see if this link helps:

No :disappointed_relieved: it doesn't print anything into the serial

Did you try running the library example sketches?

@anon57585045 this is the example whitout some lines

Whatever you took out might have broken it. Try an unmodified example.

it doesn't change anytingh :disappointed:

Please use simple, direct language that describes exactly what happened. Which sketch, post a link to it, what happened...

If a library example sketch doesn't work, what do you think, would the person who wrote the library notice? Yes. Or the 1000 people that downloaded it. For that reason, if that is the case, you likely have a hardware problem.

I think it isn't a hardware problema because i use 2 differenti remote controller and 3 differenti Ir reciver but if is it what can i do?

Put on your thinking cap and reconsider what I have told you. Suppose the example sketch didn't work. What would happen? Start with, the moment when the library author writes and tests it.

You have compromised your chances of getting help here, by not following the forum guidelines and providing hardware information (except for a few vague words).

Example sketches are a de facto method of testing hardware, which is trustworthy because it is understood that many, many people have used it successfully.

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