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);
}
}
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
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.
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.