True statement.
I only suggest using something like what I posted to test and debug the inputs, not to actually process commands on the playing field.
To debug this problem you want a direct readout on your OI of what signals are working and you want the lights to latch on the brief 100ms signal, so you don't have to hope to see a flicker. If you see one of the lights on without having pushed the corresponding IR remote button then it means your signal wire is disconnected. You can use a printf there as well to accomplish the same thing. The advantage of OI LEDs is you'll immediately see a disconnected signal wire in the pits and on the field without having a laptop hooked up.
For competition you'd have to add what Tom suggested, as well as turn off previous commands and OI lights when a new selection is made.
Quote:
Originally Posted by Tom Line
You will also want to add a line of code surrounding all of this that states if you see multiple inputs from the board simultaneously, it should disregard all input from the board.
Since a disconnected wire results in a "1", and a connected wire that sees a signal results in a "1", the only way to tell the difference is to make sure you see only one signal wire sending a "1". This will protect against a runaway or out of control condition where the IR board is left disconnected and ALL your values return as "1" - nasty things can happen if you don't protect against this.
|