I've got a problem with my InfraRed sensor, I found it in my "Elegoo Super Starter Kit"; I connected the left pin of the sensor with GND, the central pin with 5v and the right pin with the pin 11 on Arduino; There's a red light in the sensor that always remains on and it sends out an impulse when I click a button on my remote control.
The code is here:
#include "IRremote.h"
int receiver = 11;
IRrecv irrecv(receiver);
decode_results results;
void setup()
{
Serial.begin(9600);
Serial.println("IR Receiver Button Decode");
irrecv.enableIRIn(); // Start the receiver
}
void loop()
{
if (irrecv.decode(&results))
{
Serial.println(results.value, HEX);
irrecv.resume(); // receive the next value
}
}
The problem is this: when I click a button on my remote control nothing happens in the serial monitor but sometimes, when I move the wires, some values appear in the monitor.
I hope that you can help me,
Sorry for my bad english but I am italian and I'm learning this language.
The remote and the receiver migh also work on different frequencies.
A 36kHz remote? and a 38kHz receiver? will work together, but at a limited range (centimeters, not meters).
The starter kit should have the frequency of the sensor listed. e.g. a TSOP4038 is 38kHz.
Leo..
Wawa:
The remote and the receiver migh also work on different frequencies.
A 36kHz remote? and a 38kHz receiver? will work together, but at a limited range (centimeters, not meters).
The starter kit should have the frequency of the sensor listed. e.g. a TSOP4038 is 38kHz.
Leo..
The remote control that I use is the remote control that I found in the starter kit, so I think that the remote and the IR sensor have got similar frequencies.
I tried to change the position of the wiring on the breadboard and now, in the serial monitor, some values continue to appear but if I click a button on my remote control nothing happens.
This is the text that I can read in the serial monitor after some seconds with this sketch:
#include "IRremote.h"
int receiver = 2;
IRrecv irrecv(receiver);
decode_results results;
void setup()
{
Serial.begin(9600);
Serial.println("IR Receiver Button Decode");
irrecv.enableIRIn(); // Start the receiver
}
void loop()
{
if (irrecv.decode(&results))
{
Serial.println(results.value, HEX);
irrecv.resume(); // receive the next value
}
delay(500);
}