Chief Delphi

Chief Delphi (http://www.chiefdelphi.com/forums/index.php)
-   Java (http://www.chiefdelphi.com/forums/forumdisplay.php?f=184)
-   -   Limit switches are always on. (http://www.chiefdelphi.com/forums/showthread.php?t=144271)

StewEsho 02-20-2016 08:26 PM

Limit switches are always on.
 
Our team is having a difficult problem with the limit switches. While they used to work, earlier today they stopped working correctly and always returned a "true" value, regardless of whether they were pressed or not. We tries rewiring in every possible way, we tried adding the most basic limit switch code into a sample program, we tried looking online for solutions, but nothing works. Does anyone know what the problem could be?

Information
Here is the source code for the sample program we tried running (comments and all):
https://gist.github.com/StewEsho/68871eb0a2c541ee2b07

Here are the images of the wiring (just looking at the wire for the switch in port 1, but all switches have similar problems):
http://imgur.com/a/c02fV

When testing, we tried printing the outputs from all ten ports, even the ones with nothing plugged in, and they all returned "true".

Shortly before this problem arose, we couldn't run the robot and the driver station said "Brownout Error". We were forced to power cycle the robot to continue use. Could this possibly be related to our issue?

All other motors, speed controllers, and encoders work perfectly fine.


Thank you in advance for your time and your help!

Ether 02-20-2016 08:35 PM

Re: Limit switches are always on.
 
Quote:

Originally Posted by StewEsho (Post 1543351)
Our team is having a difficult problem with the limit switches. While they used to work, earlier today they stopped working correctly and always returned a "true" value, regardless of whether they were pressed or not.

Have you tried unplugging the limit switches and testing them with a multimeter?



StewEsho 02-20-2016 08:40 PM

Re: Limit switches are always on.
 
Yes, we tried using a multimeter and the switches seemed to work just fine.

FrankJ 02-20-2016 08:51 PM

Re: Limit switches are always on.
 
The inputs pull high (true) when not connected. You need to ground the signal to make it false. The switch should be connected to the white and black.

StewEsho 02-20-2016 09:24 PM

Re: Limit switches are always on.
 
Yes, that solved the problem. Thank you so much!

Ether 02-21-2016 09:05 PM

Re: Limit switches are always on.
 
Quote:

Originally Posted by StewEsho (Post 1543351)
Our team is having a difficult problem with the limit switches. While they used to work, earlier today they stopped working correctly

Quote:

Originally Posted by FrankJ (Post 1543371)
you need to ground the signal to make it false. The switch should be connected to the white and black.

Quote:

Originally Posted by StewEsho (Post 1543400)
Yes, that solved the problem. Thank you so much!

So... someone on your team played a prank and changed the wiring while you weren't looking?




All times are GMT -5. The time now is 09:00 AM.

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