View Single Post
  #2   Spotlight this post!  
Unread 16-02-2010, 01:55
eugenebrooks eugenebrooks is offline
Team Role: Engineer
AKA: Dr. Brooks
no team (WRRF)
 
Join Date: Jan 2004
Rookie Year: 2001
Location: Livermore, CA
Posts: 601
eugenebrooks has a reputation beyond reputeeugenebrooks has a reputation beyond reputeeugenebrooks has a reputation beyond reputeeugenebrooks has a reputation beyond reputeeugenebrooks has a reputation beyond reputeeugenebrooks has a reputation beyond reputeeugenebrooks has a reputation beyond reputeeugenebrooks has a reputation beyond reputeeugenebrooks has a reputation beyond reputeeugenebrooks has a reputation beyond reputeeugenebrooks has a reputation beyond repute
Re: Another Switch Help Thread

First, try:

DigitalInput* digi10= new DigitalInput(4,10);
if (digi10->Get()) printf("Pin 10: TRUE\n");
else printf("Pin 10: FALSE\n");

If it is not true, its false...

We typically test for the closure of a switch,
the digital input going to zero, so to speak.
Which way you go here can depend on which
way you want a wiring failure to influence your
control logic.

Next, for your switch case, make sure that you are closing
a connection between the ground (-) and the signal input,
leaving the 5 volt power line not connected to anything.

For the banner sensor, make sure that it is an NPN unit
and wire the 12 volt line directly to a breaker, the
ground line to the ground (-) connection on the digital
input and the line that closes appropriately to the signal
line. Make sure that you refer to correct documentation
for the sensor, as the wire colors are non-intuitive. On the
sensor we are using, the brown is 12V, the blue is ground
or (-) and the white and black lines are the signal lines,
one NC and one NO.

Have fun,
Eugene

Last edited by eugenebrooks : 16-02-2010 at 01:58.