Go to Post The game is leaking? That can only mean... - GeeTwo [more]
Home
Go Back   Chief Delphi > Technical > Programming
CD-Media   CD-Spy  
portal register members calendar search Today's Posts Mark Forums Read FAQ rules

 
Closed Thread
 
Thread Tools Rate Thread Display Modes
  #1   Spotlight this post!  
Unread 26-06-2003, 00:24
Jmoo Jmoo is offline
Registered User
AKA: Jay Meldrum
None #0067
Team Role: Engineer
 
Join Date: Jun 2003
Rookie Year: 2012
Location: Michigan
Posts: 16
Jmoo is an unknown quantity at this point
Question More than one joystick from one port

Ok... I'm really new to pbasic so please bare with me. I have a control system that has 3 joysticks rigged together and from that only one cable that goes into a port on the operator interface. How do I get the readings from all 3 joysticks outta one port??? Do I need to know how it was wired? and get the info off of each pin? If so how do I do that? Is there a program to automatically get the variables from my OI???

I know this joystick works cause it worked before but I don't have the code for it. And I can't get it at the moment. It's to control our old kiwi drivetrain. Maybe u've seen it... if not check out the pictures section on our site, under season 2002.

Link to site in my sig
  #2   Spotlight this post!  
Unread 26-06-2003, 00:53
Mike Soukup's Avatar
Mike Soukup Mike Soukup is offline
Software guy
FRC #0111 (Wildstang)
Team Role: Engineer
 
Join Date: May 2001
Rookie Year: 1996
Location: Schaumburg, IL
Posts: 797
Mike Soukup has a reputation beyond reputeMike Soukup has a reputation beyond reputeMike Soukup has a reputation beyond reputeMike Soukup has a reputation beyond reputeMike Soukup has a reputation beyond reputeMike Soukup has a reputation beyond reputeMike Soukup has a reputation beyond reputeMike Soukup has a reputation beyond reputeMike Soukup has a reputation beyond reputeMike Soukup has a reputation beyond reputeMike Soukup has a reputation beyond repute
You can either take the cable apart and trace the OI port pins back to the joystick pins, or you can put some debug statements in your code.

Each OI port has 4 analog inputs and 4 digital inputs, so you can run two joysticks off the same port and use the x & y axis and both buttons on both joysticks, or (if I recall correctly) you can do what your team did and only use one axis of each joystick.

Since you're new to pbasic (and I'm assuming you're new to the IFI control system) you should read the IFI documents. Start with the overview & Quick Start guides, then read the OI & RC Reference guides. The OI reference guide will give you the mapping between OI port and pbasic variable.

After you understand how the pins map to the pbasic variables, you can use them in code. Make sure you properly read in the analog inputs in your SERIN command. Now debug the p1_x, p1_y, p1_wheel, and p1_aux variables (if you're using a port other than 1, change the 1 to the correct number).

If you still have questions, post them and someone will help you out.
  #3   Spotlight this post!  
Unread 26-06-2003, 03:01
JasonStern JasonStern is offline
Mentor
FRC #1123 (AIM Robotics)
Team Role: Mentor
 
Join Date: Jan 2003
Rookie Year: 2003
Location: Arlington, VA
Posts: 65
JasonStern is on a distinguished road
You could also use the dashboard program to figure out which joystick controls each analog input on the port. Just a plug a computer into the dashboard port of the OI, load up the program from IFI, turn on your robot, and move each joystick one at a time. I believe that the names of the inputs your joysticks' control are the y axis, the x axis, and the auxillary axis, but I may be wrong. BTW, you don't need to have working code in your robot to use the dashboard, the OI and the RC just need to have a valid link. Hope this helps and good luck!
__________________
Que será será
  #4   Spotlight this post!  
Unread 26-06-2003, 18:01
Jmoo Jmoo is offline
Registered User
AKA: Jay Meldrum
None #0067
Team Role: Engineer
 
Join Date: Jun 2003
Rookie Year: 2012
Location: Michigan
Posts: 16
Jmoo is an unknown quantity at this point
Thanks a bunch!
Figured it out with the help from both of ya.
Closed Thread


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 On
HTML code is Off
Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Fried program slots? Jeff Waegelin Programming 18 19-03-2003 18:08
robot goes haywire with the one joystick default code Miles Programming 7 24-01-2003 14:58
Change to Initializing Inputs and Outputs Jferrante Programming 4 07-01-2003 11:36
joystick problem archiver 2000 12 23-06-2002 23:08
switching joystick axis????? team222badbrad Technical Discussion 9 16-01-2002 23:07


All times are GMT -5. The time now is 22:58.

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


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