Chief Delphi

Chief Delphi (http://www.chiefdelphi.com/forums/index.php)
-   Java (http://www.chiefdelphi.com/forums/forumdisplay.php?f=184)
-   -   How to attach and code fsp 8268909? (http://www.chiefdelphi.com/forums/showthread.php?t=134186)

ShaneWong 08-02-2015 08:33

How to attach and code fsp 8268909?
 
Hi I'm from team 4732, I've been having trouble figuring out how to attach/program this button (http://www.repairclinic.com/PartDeta...8268909/830916). Any help you could offer would be greatly appreciated.

otherguy 08-02-2015 09:58

Re: How to attach and code fsp 8268909?
 
Wire one side of the switch to ground and the other to a digital input channel.

On the programming side, look at the DigitalInput class:
http://team2168.org/javadoc/edu/wpi/...italInput.html

curtis0gj 10-02-2015 06:41

Re: How to attach and code fsp 8268909?
 
I was struggling for a long time trying to figure out how to program these to stop motors when pressed and if that's your plan check out this thread: http://www.chiefdelphi.com/forums/sh...=133983&page=4

Ozuru 10-02-2015 11:13

Re: How to attach and code fsp 8268909?
 
It is hooked up to a PWM cable. You only need to wire the ground and signal (black and white, respectively) as the positive (red) wire has no use in a switch. Instead of plugging it into the PWM section of your RoboRIO, plug it into the section designated for digital inputs.

Programming side:

Code:

DigitalInput _switch1 = new DigitalInput(0);
if(_switch1.get) {
    System.out.println("Switch 1 is pressed!");
}



All times are GMT -5. The time now is 10:53.

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