View Single Post
  #6   Spotlight this post!  
Unread 27-02-2007, 09:27
Japper's Avatar
Japper Japper is offline
Registered User
FRC #3692 (RocknRobots)
Team Role: Mentor
 
Join Date: Jan 2007
Rookie Year: 2007
Location: Rutland Wisconsin
Posts: 147
Japper has a spectacular aura aboutJapper has a spectacular aura about
Re: Converting Joystick controls over to switches

I used the four analog inputs on port 4 as each of my four switches is replacing a joystick X or Y value. I hacked up a Radio Shack joytick "Y" cable to get all the port pins that I needed...

On the switches, I connected one pole to +5v and the other to Ground and then tied the switch common to the appropriate joystick port pin and the wiper of a 100K ohm trimmer pot (which is tied to +5v and ground through 1K ohm bleeder resitors.)

In the switch off position for each switch, I adjusted the trimmer pots to 2.5V and verified that switching to either of the two positions gives me +5 or 0V on the common.

This should work (in theory) but I do not have an OI to test it with right now...

Also, I tied the port 4 trigger switch pin to ground (this is not used on my port 3 or port 4 joysticks). Then I modified the code to read this port 4 trigger switch and if it is low to process code specifically for the control box or if it is high to process code specifically for the joysticks, that way I can use either without changing the code...

Hope it works...

Thanks for everyone's feedback on this issue !!!