![]() |
How in the world do I code and wire this wacky sensor(a.k.a. Photoswitch)
1 Attachment(s)
So, we're tossing a telescoping blocker on our robot, and the mentors want a way to control it so it doesn't try and go past it's safe spot. So they handed me this thingy and told me "Figure out how to wire this. Then figure out how to program it." The Javadocs don't have anything I could see about using these. So how they work is a little beyond me.
I know that this is a photoswitch/photometer and that I want to get a true false value out of the thing's feedback. But where do these four wires connect to, is it analog or digital, and how do I write code for it? Note that other members of my team might write replies to this topic consorting with me, so check our team number before you get confused by someone's post. Also, apologies for tossing the pictures of the thing in a word document. It was the only way to get the file size down. |
Re: How in the world do I code and wire this wacky sensor(a.k.a. Photoswitch)
The wiring diagram is on the back of the sensor.
Blue = ground Brown = 12v White or Black = signal (pick one, they just give opposite results) It gets wired to a Digital Input and in code it'll act like a switch. Something to be aware of with these sensors is they nominally require at least 11v, so if your robot power dips too low you may see bogus inputs. It works best if you can feed it with a regulated 12v of power. Allen-Bradley RightSight Specs |
Re: How in the world do I code and wire this wacky sensor(a.k.a. Photoswitch)
One thing to beware of is that unlike most sensors, you are going to want to wire this guy to your power distribution board for 12v and ground. There should only be a signal wire going to the digital side car; whether you choose the white or black only changes whether light = true or light = false.
Treat it like a normal digital input in code. I can't remember how you do that in Java, but it should be fairly simple. |
Re: How in the world do I code and wire this wacky sensor(a.k.a. Photoswitch)
It is actually 24 volts according to the manufacture's manual that we printed- don't mean to be a know-it-all.
Anyways, we can't even get the part to move without the sensor. The Jag code all looks normal to me. We tested and the jag will operate with BDC-Comm. Anyone have a clue what's wrong with our code? Code:
/*----------------------------------------------------------------------------*/ |
Re: How in the world do I code and wire this wacky sensor(a.k.a. Photoswitch)
Quote:
|
| All times are GMT -5. The time now is 09:55. |
Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2017, Jelsoft Enterprises Ltd.
Copyright © Chief Delphi