|
|
|
![]() |
|
|||||||
|
||||||||
|
|
Thread Tools | Rate Thread | Display Modes |
|
#1
|
||||
|
||||
|
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 |
|
|
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 |