As an alternative way to power the board, you could connect the power and ground wires to an unused PWM output. The 7.2 volts from that is enough for its operation.
Here's the code we're currently using to get the inputs (using WPILib):
Code:
unsigned char Previous_Value;
int GetIR (void) {
unsigned char IR_Value;
IR_Value=GetDigitalInput(IR_1)+(GetDigitalInput(IR_2)*2)+(GetDigitalInput(IR_3)*3)+(GetDigitalInput(IR_4)*4);
if(IR_Value>0) {
Time=0;
Previous_Value = IR_Value;
return IR_Value;
} else if(Time>250) {
Time = 0;
Previous_Value = 0;
return 0;
}else if(IR_Value==0) {
++Time;
return Previous_Value;
}
}