View Single Post
  #6   Spotlight this post!  
Unread 29-01-2008, 14:38
Mark McLeod's Avatar
Mark McLeod Mark McLeod is offline
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,801
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_Sensor Programming

Here's an example of a working IR program built on the default code.
http://team358.org/files/programming...or_example.zip

Everything is contained within user_routines.c, Default_Routine().

It expects the four IR digital inputs to be connected to digital inputs 15,16,17,18. If any are not connected properly it will not do anything (for safety reasons).

The user byte display on the OI will show 1, 2, 4, or 8 for the different IR commands received.
If you see anything else, then the digital pins are not connected properly.

P.S.
This code is set to work with a common ground (both the Robot Controller and the IR sensor powered from the same battery). If you are using a separate battery the code will need additional checks in two places for "15"
__________________
"Rationality is our distinguishing characteristic - it's what sets us apart from the beasts." - Aristotle

Last edited by Mark McLeod : 29-01-2008 at 14:50.