Thread: IR Sensor
View Single Post
  #3   Spotlight this post!  
Unread 23-01-2008, 23:51
Chaos in a Can Chaos in a Can is offline
Joel Spadin
FRC #1736 (Robot Casserole)
Team Role: Programmer
 
Join Date: Mar 2007
Rookie Year: 2007
Location: Peoria, IL
Posts: 58
Chaos in a Can is an unknown quantity at this point
Send a message via MSN to Chaos in a Can
Re: IR Sensor

There is no default code for the sensor, but if you wire the four outputs on the IR board to four of the digital i/o pins, you can easily read the values it sends.

Include ifi_aliases.h and use the names it gives you for the digital inputs.
If you wired the board to the inputs 3-6, your code might look something like this:

Code:
#include "ifi_aliases.h"
char IR_in1 = rc_dig_in03;
char IR_in2 = rc_dig_in04;
char IR_in3 = rc_dig_in05;
char IR_in4 = rc_dig_in06;
__________________
2006 Xerox Creativity Award
2007 General Motors Industrial Design Award
2008 Judges' Award
2009 Chrysler Team Spirit Award