OCCRA
Go to Post This is probably one of the most important robots in FRC history and it never even was in an official event. - gyroscopeRaptor [more]
Home
Go Back   Chief Delphi > Old Forum Archives > 2001
CD-Events   CD-Media   CD-Spy   FRC-Spy  
portal register members calendar search Today's Posts Mark Forums Read FAQ rules

 
 
Thread Tools Rate Thread Display Modes
  #1   Spotlight this post!  
Unread 06-23-2002, 11:59 PM
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
Assigning Joystick buttons....

Posted by Bradford Stephens at 2/16/2001 9:36 PM EST


Student on team #351, Robomon All-Stars, from Clay High School and Iluka Resources, Inc.



Hello!
This is my first year in the competition, and my team's second. I'm the programmer, and am pretty handy with QBASIC. However, I took one look at this code and am totally boggled. I've been trying to tech myself how it works but have had no luck. I need to program several things, including two limit switches for our forklift, a compressor automatic shutoff, and more. None of these do I have the slightest clue how to wire to the digital input ports. Or program, for that matter.

But my most pressing need is this: we're using a two joystick drive system. This gives me four buttons to work with, because I don't really know how to wire additional toggle switches to the Op Interface ports (what pins do I put them on and how do I read the pin states?)...
anyway, I want the front trigger of my first joystick to control Relay 1 (click it once and it stays on, click it again and it stays off). I want the top trigger to control Relay 2 the same way, the front button on my 2nd joystick to control relay 3, and the top button oon it to control relay 4. How do I go about programming this?

Infinite Thanks in Advance!!!
*********
(t8r on)
*********


__________________
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.
  #2   Spotlight this post!  
Unread 06-23-2002, 11:59 PM
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
toggle on -- toggle off example code

Posted by Joe Johnson at 2/16/2001 10:20 PM EST


Engineer on team #47, Chief Delphi, from Pontiac Central High School and Delphi Automotive Systems.


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



Try this

Onflag var bit

p1_sw_trig_old var bit
.
.
.
p1_sw_trig_old = 1
Onflag = 0
.
.
.
MainLoop:
.
.
.
if p1_sw_trig_old = 0 and p1_sw_trig = 1 and OnFlag = 1
then TurnOff
if p1_sw_trig_old = 0 and p1_sw_trig = 1 and OnFlag = 0
then TurnOn

goto SetRelays

Turnon:
OnFlag = 1
goto SetRelays

TurnOff:
Onflag = 0

SetRelays:
relay1_fwd = Onflag
.
.
.
goto MainLoop


Good Luck.

Joe J.

P.S. I wrote this from memory on the spot. It may
have bugs, but the
concept seems right to me.


__________________
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.
  #3   Spotlight this post!  
Unread 06-23-2002, 11:59 PM
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
Re: Assigning Joystick buttons....

Posted by Elliot Johnson at 2/17/2001 1:34 AM EST


Student on team #218, HP Robotics Team, from Highland Park High School and Double-E Inc..


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



:what pins do I put them on and how do I read the pin :states?...

Check the control system manual at www.innovationfirst.com
It provides lists of which pins do what on the four joystick ports. To add more switches, you solder the wires to correct pins on one of the 15 pin connectors in the kit. The pinout lists also identify which variable to use to read the switches.

later,
Elliot


__________________
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.
  #4   Spotlight this post!  
Unread 06-23-2002, 11:59 PM
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.
  #5   Spotlight this post!  
Unread 06-23-2002, 11:59 PM
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
Actually...

Posted by Nate Smith at 2/18/2001 3:25 PM EST


Other on team #66, Frostbite, from Willow Run High School and GM Powertrain.


In Reply to: Wiring Additional Switches on the OI
Posted by Michael Bloomfield on 2/17/2001 9:00 AM EST:



: * = 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.

Actually, all 16 are available between ports 2 and 4...ports 1 and 3 have the LED drivers...unless they changed that on the 2001 controller and nobody told me there was a new control system manual out...

Nate

__________________
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.
  #6   Spotlight this post!  
Unread 06-23-2002, 11:59 PM
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
Re: Actually...

Posted by Michael Bloomfield at 2/19/2001 4:35 PM EST


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


In Reply to: Actually...
Posted by Nate Smith on 2/18/2001 3:25 PM EST:



My mistake...you are correct. Port 2 & 4 can access all the Inputs and 1 & 3 control the LED Drivers. My bad...Mike.


__________________
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.
 


Thread Tools
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Fried program slots? Jeff Waegelin Programming 18 03-19-2003 05:08 PM
question about one joystick drive programing james700 Programming 13 01-29-2003 01:49 PM
robot goes haywire with the one joystick default code Miles Programming 7 01-24-2003 01:58 PM
joystick problem archiver 2000 12 06-23-2002 10:08 PM
switching joystick axis????? team222badbrad Technical Discussion 9 01-16-2002 10:07 PM


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

The Chief Delphi Forums are sponsored by Innovation First International, Inc.


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