View Single Post
  #9   Spotlight this post!  
Unread 05-02-2008, 06:30
popnbrown's Avatar
popnbrown popnbrown is offline
FIRST 5125 HOTH Lead Mentor
AKA: Sravan S
FRC #5125 (Hawks on the Horizon)
Team Role: Mentor
 
Join Date: Feb 2007
Rookie Year: 2007
Location: Illinois
Posts: 367
popnbrown has a reputation beyond reputepopnbrown has a reputation beyond reputepopnbrown has a reputation beyond reputepopnbrown has a reputation beyond reputepopnbrown has a reputation beyond reputepopnbrown has a reputation beyond reputepopnbrown has a reputation beyond reputepopnbrown has a reputation beyond reputepopnbrown has a reputation beyond reputepopnbrown has a reputation beyond reputepopnbrown has a reputation beyond repute
Re: Programming the Infrared board

I see.

If i do use the rc_dig_inXX variables will they not provide the same input as GetDigitalInput(XX)? The reason I'm asking is that when I press the remote button the light on the IR Sensor lights up but it doesn't show anything.

By using the if structure:
Code:
	
if(GetDigitalInput(IR_IN1))
	printf("IR #1\n");
else if(GetDigitalInput(IR_IN2))
	printf("IR #2\n");
else if(GetDigitalInput(IR_IN3))
	printf("IR #3\n");
else if(GetDigitalInput(IR_IN4))
	printf("IR #4\n");
I would be able to see when buttons 1, 2, 3, or 4 are pushed correct.

What I originally had was the code above in a very long loop to just see if any of the above printf() commands would work however they did not.

I will try using the rc_dig_inXX variables and after that implement a quicker Check() function.

Thanks for all the help.
Reply With Quote