Sign up ×
Arduino Stack Exchange is a question and answer site for developers of open-source hardware and software that is compatible with Arduino. It's 100% free, no registration required.

I just bought VS1838B IR module (from here) and trying to work with it. I have connect 1838B receiver like this :

enter image description here

And this is my code (whole code here) :

#include <IRremote.h>

int RECV_PIN = 2;
IRrecv irrecv(RECV_PIN);
decode_results results;
#define CH1 0xFFA25D 
#define CH 0xFF629D
#define CH2 0xFFE21D
...
#define BUTON8 0xFF4AB5
#define BUTON9 0xFF52AD

void setup()

{

 Serial.begin(9600);

 irrecv.enableIRIn(); 

}

void loop() {


 if (irrecv.decode(&results)) 
  {

 if (results.value == CH1) 

 {

 Serial.println("CH-"); 
 }

 if (results.value == CH) 

 {

 Serial.println("CH"); 

 }

 if (results.value == CH2) 

 {

 Serial.println("CH+"); 

 }

 ...

 if (results.value == BUTON8) 

 {

 Serial.println("BUTON8"); 

 }
if (results.value == BUTON9) 

 {

 Serial.println("BUTON9"); 

 }
 irrecv.resume();

 }



}

But I'm not getting any output on serisal monitor. Can you help me for debugging it?

share|improve this question
    
Are you sure you have a proper remote control? How did you get the constant values from? – jfpoilpret Aug 25 '14 at 20:30
1  
You should add Serial.println(results.value); after if irrecv.decode(&results)) { to check what codes are really received from your remote. – jfpoilpret Aug 25 '14 at 20:35
    
@jfpoilpret It's not printing anything, it's not going inside of that if() . I'm use I'm using a proper controller because all they came together, as a kit. – Eray Aug 25 '14 at 21:42

3 Answers 3

Looking further here

http://forum.arduino.cc/index.php/topic,188236.0.h...

I found the following

"Removing the files - libraries\RobotIRremote\IRremoteTools.cpp and libraries\RobotIRremote\IRremoteTools.h solved the problem. They are example files which somehow are getting included. You can move those two files to some other location as backup."

I went to my libraries file and did this and can confirm that the example given above then compiles fine without downloading a new library. Its an Arduino libraries problem .

Either way will work

answer from here and worked for me

i use this code:

#include <IRremote.h>
int input_pin = 10; //set D10 as input signal pin
IRrecv irrecv(input_pin);
decode_results signals;
void setup()
{
    Serial.begin(9600);
    irrecv.enableIRIn(); // enable input from IR receiver
}
void loop() {
if (irrecv.decode(&signals)) {
        Serial.println(signals.value, HEX);
        irrecv.resume(); // get the next signal
    }
}
share|improve this answer

I could be wrong, but I believe that this receiver operates at 38kHz (at least that is listed in the specs), so the IR source must be oscillating at that frequency for this receiver to see it. Check out this link to see how to create a circuit to oscillate your IR LED:

http://www.electro-tech-online.com/threads/ir-emitter-at-38khz.94119/

share|improve this answer
    
Whilst you link may answer the question, it would be preferable to include the essential parts of the linked here, and provide the link for citation. Thanks! – Annonomus Penguin May 3 at 22:58

i have also bought this IR receiver with a remote controller (as a kit), and i had the same problem, i changed the remote controller and it worked perfectly, so even if the IR and RC came as a kit it doesn't mean they will work, if you don't have another remote controller in hand you can use a lighter just to check if the IR is working.

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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