View Single Post
  #4   Spotlight this post!  
Unread 24-06-2002, 00:59
archiver archiver is offline
Forum Archival System
#0047 (ChiefDelphi)
 
Join Date: May 2001
Location: Pontiac, MI
Posts: 21,214
archiver has a reputation beyond reputearchiver has a reputation beyond reputearchiver has a reputation beyond reputearchiver has a reputation beyond reputearchiver has a reputation beyond reputearchiver has a reputation beyond reputearchiver has a reputation beyond reputearchiver has a reputation beyond reputearchiver has a reputation beyond reputearchiver has a reputation beyond reputearchiver has a reputation beyond repute
Wiring Additional Switches on the OI

Posted by Michael Bloomfield at 2/17/2001 9:00 AM EST


Student on team #375, Robotic Plague, from Staten Island Tech and Verizon.


In Reply to: Assigning Joystick buttons....
Posted by Bradford Stephens on 2/16/2001 9:36 PM EST:



Well here is some help on wiring additional digital switches on the OI. Let me know if u need additional help or need something explained in more detail.

Lets start off by realizing that one switch is actually 2 different input(variables)...so the middle pin on the switch is the ground and the other pins are the actual hot pins that output the 1(variable pins).

__
| |- Goes to one of Variable Pins
| |- Goes to Ground (See Pinout)
|_|- Goes to another one of Variable Pins

So lets say the top will be p4_sw_aux1 then would be set to pin 10. And lets say bottom will be set to p4_sw_aux2 would be set to pin 14. Middle goes to ground which lets use pin 4.

Port 4 Pinout for Digital Inputs

Pin Default Variable
2 p4_sw_trig
7 p4_sw_top
10 p4_sw_aux1
14 p4_sw_aux2
5 p1_sw_trig*
8 p1_sw_top*
9 p1_sw_aux1*
15 p1_sw_aux2*
4(ground)
12(gound)

* = Port 4 has access to the 4 unique digital inputs from Port 1 if you need those variables in Custom Switch. Allowing for a total of 16 unique digital inputs because every port has 4 unique variables but all the 16 variables can be accessed from Port 3 and 4 alone.

Now in your program just use p4_sw_aux1 and p4_sw_aux2 to access the different settings of switch using the wiring above. Same thing for analog except a little different to wire let me know if you need help with this as well. I hope that this helped a little and please feel free to email me if you have any other questions.

Also in code to make the switch stay when pushed forward and shut off when pushed other way try this:

In main loop:

' If pushed forward turn on
IF (p4_sw_aux1 = 0) THEN NotOn:
relay1_fwd = 1
relay1_rev = 0
NotOn:

' If pushed other way turn off
IF (p4_sw_aux2 = 0) THEN NotOff:
relay1_fwd = 0
relay_rev = 0
NotOff:

Hope this helps...let me know.








__________________
This message was archived from an earlier forum system. Some information may have been left out. Start new discussion in the current forums, and refer back to these threads when necessary.