#PLEASE# Extremely expert at IR remote controller ## PLEASE ##

I watched your videos and came to the conclusion there is a problem with your code but without seeing your code it is difficult to say much more. Would it be convenient for you to include your code?

i just know that i have to convert from hexadecimal to decimal , if i am wrong pls let me correct.

You are. The value in decode_results when the function gets a valid IR signal is in binary. You can compare that value to a binary value, a decimal value, or a hexadecimal value. They are ALL stored internally in binary. YOU don't have to do ANY conversion.

PaulS: You are. The value in decode_results when the function gets a valid IR signal is in binary. You can compare that value to a binary value, a decimal value, or a hexadecimal value. They are ALL stored internally in binary. YOU don't have to do ANY conversion.

Thanks for your responds. i will try now

try

unsigned long value = results.value;


PS: Your title does not help to explain the problem…which if my suggestion is correct is a C coding problem not an IR problem???

I prepared as much as simple a mini scetch which represents my main scetch. Only an led and an IR are included.
Expecting results is when IR get feed back LED11 blinks

But result is when IR get feed back only one time LED11 blinks then program. Then waiting next IR feed back to repeat the function. Therefore
i need to press the button to execute the function every time.
So, if i manage the LED11 goes to blink continuously,i could sort main scetch out
Regards

#include <Wire.h> 
#include <HMC5883L.h> 


#include <IRremote.h>    //IRremote control
int RECV_PIN = 7;        //  hmc5883 compass pin attached to pin 7
IRrecv irrecv(RECV_PIN);
decode_results results;

#define rightbutton   16761405
int LED11=false;
void setup() 
{ 
 irrecv.enableIRIn(); // Start the receiver
 

Serial.begin(9600); 
Wire.begin(); 
pinMode(13, OUTPUT);    //led1
pinMode(12, OUTPUT);    //led2
pinMode(11, OUTPUT);    //led3
pinMode(10, OUTPUT);    //led4
pinMode(5,OUTPUT);      //5V, vcc for IRremote
digitalWrite(5,HIGH);   // 5V, vcc for IRremote


} 
void loop() 
{ 
  if (irrecv.decode(&results)) {
 irrecv.resume();
    unsigned int value = results.value;                
   Serial.println(value); 
                   
if(results.value == rightbutton) LED11 = 1; 



if(LED11 == 1)

{  
digitalWrite(11, HIGH);
delay(100);
digitalWrite(11, LOW); 
return; 
}




}

}

2 things:

  1. Please put the code into code tags in your last post. 2.What happened when you tried the suggestion in my last post?

Please do not "double post" as it wastes peoples time :sob:

http://forum.arduino.cc/index.php?topic=319860.0;topicseen

Your code to blink the LED is inside 'if (irrecv.decode(&results)) {' So it will only blink once per button push.

If you change this

if(LED11 == 1)

{                          
digitalWrite(11, HIGH);
delay(100);
digitalWrite(11, LOW);                  
return;                  
}

}

}

to this

}
if(LED11 == 1)

{                          
digitalWrite(11, HIGH);
delay(100);
digitalWrite(11, LOW);                  
return;              
}

}

that might work better.

Hi evanmars thanks a lot, you sort it out my prob.

also thanks for all you guys to spending your valuable times.

AnalysIR:
2 things:

  1. Please put the code into code tags in your last post.
    2.What happened when you tried the suggestion in my last post?

structure of the IR code where in the void loop causes the problem. and it has been fixed.
thanks for your afford.

It's "loop function", not "void loop".