Go Down

Topic: Error while reading values from two differant Infrared receivers? (Read 467 times) previous topic - next topic


Hi i got a problem and i need help

i use Ken Shirriff's IRremote library

i want to read differant values from two differant ir receiver.
i can read one value but when connect second ir receiver and try to read 1 and 2 together, i cant see any result.

here is my code

* IRremote: IRrecvDemo - demonstrates receiving IR codes with IRrecv
* An IR detector/demodulator must be connected to the input RECV_PIN.
* Version 0.1 July, 2009
* Copyright 2009 Ken Shirriff
* http://arcfn.com

#include <IRremote.h>

int F = 2;
int B = 3;

IRrecv irrecvF(F);
IRrecv irrecvB(B); // bunu yaz?nca cal??smiyor

decode_results resultsF;
decode_results resultsB;

void setup()
 irrecvF.enableIRIn(); // Start the receiver

void loop() {
 if (irrecvF.decode(&resultsF)) {  
   Serial.print("F: ");
   Serial.println(resultsF.value, DEC);  
   irrecvF.resume(); // Receive the next value  
 if (irrecvB.decode(&resultsB)) {
   Serial.print("B: ");
   Serial.println(resultsB.value, DEC);  
   irrecvB.resume(); // Receive the next value


what actually happens when you run this ?

is the "resume()" function causing the whole thing to wait indefinitely ?

Go Up

Please enter a valid email to subscribe

Confirm your email address

We need to confirm your email address.
To complete the subscription, please click the link in the email we just sent you.

Thank you for subscribing!

via Egeo 16
Torino, 10131