Pages: [1]   Go Down
Author Topic: Iremote problem  (Read 1688 times)
0 Members and 1 Guest are viewing this topic.
0
Offline Offline
Full Member
***
Karma: 0
Posts: 102
Arduino rocks
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

I'm using the Iremote lib and my LG controller is: when I press any button, he send the code of this button one time ex: 551489775, and then starts sending a confirmation number (4294967295) that is being sent until I release the button. I wrote a code to verify if the power button were pressed and then turn a led on until I release the power button. But It's not working!

if (remote()=="551489775") {
delay(50);
     while(remote()=="4294967295") {
digitalWrite(led, HIGH);
     }
      digitalWrite(led, LOW);
   }

//The function
String remote () {
   String code = "";
  if (irrecv.decode(&results)) {
    code += String (results.value, HEX);
    irrecv.resume(); // Receive the next value
        return(code);
    }
}
Logged

0
Offline Offline
Full Member
***
Karma: 0
Posts: 102
Arduino rocks
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Detail: this confirmation number is the same for ALL the buttons, so that's why I need to verify the code of the button first.
Logged

Pages: [1]   Go Up
Jump to: