View Single Post
  #15   Spotlight this post!  
Unread 11-04-2008, 10:59
Mark McLeod's Avatar
Mark McLeod Mark McLeod is online now
Just Itinerant
AKA: Hey dad...Father...MARK
FRC #0358 (Robotic Eagles)
Team Role: Engineer
 
Join Date: Mar 2003
Rookie Year: 2002
Location: Hauppauge, Long Island, NY
Posts: 8,854
Mark McLeod has a reputation beyond reputeMark McLeod has a reputation beyond reputeMark McLeod has a reputation beyond reputeMark McLeod has a reputation beyond reputeMark McLeod has a reputation beyond reputeMark McLeod has a reputation beyond reputeMark McLeod has a reputation beyond reputeMark McLeod has a reputation beyond reputeMark McLeod has a reputation beyond reputeMark McLeod has a reputation beyond reputeMark McLeod has a reputation beyond repute
Re: IR Board Programming/Wiring Problems

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 View Post
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.
__________________
"Rationality is our distinguishing characteristic - it's what sets us apart from the beasts." - Aristotle

Last edited by Mark McLeod : 11-04-2008 at 11:25.