Thread: IR Programming
View Single Post
  #4   Spotlight this post!  
Unread 15-02-2008, 16:25
RyanW RyanW is offline
Registered User
FRC #0449 (Blair Robot Project)
Team Role: Programmer
 
Join Date: Feb 2007
Rookie Year: 2007
Location: MD
Posts: 40
RyanW has a spectacular aura aboutRyanW has a spectacular aura about
Re: IR Programming

Amicsa,

What exactly are you trying to do?

A couple of things:

Whatever you plug the IR board into must be configured as an INPUT; otherwise it will always read 0.
If the IR board is not plugged in, you'll get all 1s for the inputs, so you need to check for that as well.
If you want it to do something in hybrid mode, it does need to go in the user_routines_fast.c file, in the user_autonomous method (or else it's called something similar to that - I'm using WPILIB and so don't remember exactly).

Depending on what you do with them, you'll want to write code for each input.

Code:
[indent]if(rc_dig_in01){
do_stuff_01();
}//end if[indent]else if(rc_dig_in02){
do_stuff_02();
}//end if[indent]else if(rc_dig_in03){
do_stuff_03();
}//end if
else if(rc_dig_in04){
do_stuff_04();
}//end if