Go to Post Michigan teams will eat your souls. You have been warned. - MishraArtificer [more]
Home
Go Back   Chief Delphi > Technical > Electrical
CD-Media   CD-Spy  
portal register members calendar search Today's Posts Mark Forums Read FAQ rules

 
 
 
Thread Tools Rate Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Spotlight this post!  
Unread 15-02-2010, 22:37
nekng's Avatar
nekng nekng is offline
Former 1836 Captain
AKA: Nate
FRC #1836 (MilkenKnights)
Team Role: Alumni
 
Join Date: Aug 2006
Rookie Year: 2007
Location: Los Angeles
Posts: 43
nekng is on a distinguished road
Another Switch Help Thread

Hi all,

I can't seem to figure this out. From what I understand, if I use a switch to bridge the signal and ground of one of the GPIO channels on the Digital Sidecar, then when the switch is closed I ought to get a reading of 0 and when it is open I ought to get a reading of 1. As far as I'm aware, the DSC has an internal resistor and I do not need an additional one. And also, as far as I'm aware, the following code should work:

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

So why is digi10->Get() always false no matter what the switch position is?

Also, before I tried to get a simple switch to work, I was attempting to use the photoswitch to work (the one provided in the 2006 KOP). Both the receiver and source require 12v which I supply from the power distribution board. The green/white wires are each a signal, one is NC and one NO. I tried plugging one of these into a GPIO port but that didn't work...The photoswitch itself is working though--it has a red light on the receiver that turns on when the beam is unbroken.

Any suggestions?
__________________
 


Thread Tools
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Yet another Camera thread... Pancake C/C++ 2 26-01-2009 11:42
Yet another bumper thread Vikesrock Technical Discussion 26 19-01-2009 17:04
Need Help Wiring Micro Switch/Limiting Switch Windward Electrical 2 07-02-2006 18:26
Another VEX related thread... Joe Johnson FIRST Tech Challenge 0 22-03-2005 11:52
Yet another reason to make the Switch... Joe Matt Chit-Chat 56 15-01-2005 18:00


All times are GMT -5. The time now is 12:37.

The Chief Delphi Forums are sponsored by Innovation First International, Inc.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2017, Jelsoft Enterprises Ltd.
Copyright © Chief Delphi