View Single Post
  #5   Spotlight this post!  
Unread 05-01-2003, 02:04
rbayer's Avatar Unsung FIRST Hero
rbayer rbayer is offline
Blood, Sweat, and Code
no team (Teamless Orphan)
 
Join Date: Mar 2002
Rookie Year: 2001
Location: Minnetonka, MN
Posts: 1,087
rbayer is a glorious beacon of lightrbayer is a glorious beacon of lightrbayer is a glorious beacon of lightrbayer is a glorious beacon of lightrbayer is a glorious beacon of light
Send a message via AIM to rbayer
Ah, I see your problem. Only three of the wires are actually used, but you have to decide which three. Here's a quick run-down of all four wires:

Brown --> +12V (from main electrical system)
Blue --> Ground on RC switch inputs
Black --> Switch input
White --> Switch input

Now, you're probably wondering why both Black and White go to sensor input, and justly so. Pick one or the other, and only use that one. But be consistent--if you decide to use the white wire, use the white on ALL optical sensors.

The thing is, the black and white wires carry the same data, just inverted. For example, if the sensor "sees" the target, the white wire will read "1" in the software, but the Black will read "0". If the target disappears, white will read "0" and black will read "1". It may be the other way around, but it really doesn't matter as long as you are consistent.

One possible use for using both: safety. If you use both wires, the corresponding values in PBASIC should ALWAYS be opposite. If for some reason they aren't, you know an error occurred with the sensor. This also you to distinguish between a sensor that has come unplugged and one that just doesn't see anything.

--Rob

P.S. Check out page 13 of the Robot manual. It's got all the info you need for sensor pinouts.
__________________
New C-based RoboEmu2 (code simulator) available at: http://www.robbayer.com/software.php