|
|
|
![]() |
|
|||||||
|
||||||||
![]() |
| Thread Tools | Rate Thread | Display Modes |
|
#1
|
|||
|
|||
|
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.
Last edited by ShaneWong : 08-02-2015 at 09:44. |
|
#2
|
||||
|
||||
|
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 |
|
#3
|
|||
|
|||
|
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
|
|
#4
|
||||
|
||||
|
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!");
}
|
![]() |
| Thread Tools | |
| Display Modes | Rate This Thread |
|
|