View Single Post
  #13   Spotlight this post!  
Unread 14-03-2008, 14:02
Racer26 Racer26 is offline
Registered User
no team
Team Role: Alumni
 
Join Date: Apr 2003
Rookie Year: 2003
Location: Beaverton, ON
Posts: 2,229
Racer26 has a reputation beyond reputeRacer26 has a reputation beyond reputeRacer26 has a reputation beyond reputeRacer26 has a reputation beyond reputeRacer26 has a reputation beyond reputeRacer26 has a reputation beyond reputeRacer26 has a reputation beyond reputeRacer26 has a reputation beyond reputeRacer26 has a reputation beyond reputeRacer26 has a reputation beyond reputeRacer26 has a reputation beyond repute
Re: General question.

Yes, you will receive that data in code as 1 or 0 in a variable, but remember, the IR Board only gives a momentary signal.

I suggest something like this to allow the RC to remember which was pushed

Code:
int IRSignal = 0;

if(func1 == 1){
  IRSignal = 1;
}else if(func2 == 1){
  IRSignal = 2;
}else if(func3 == 1){
  IRSignal = 3;
}else if(func4 == 1){
  IRSignal = 4;
}

switch(IRSignal){

  case 0:
    //no button pushed yet
    break;
  case 1:
    //button 1 pushed
    break;
  case 2:
    //button 2 pushed
    break;
  case 3:
    //button 3 pushed
    break;
  case 4:
    //button 4 pushed
    break;

}