Go to Post We believe that the message of FIRST should be spreadable, just like butter - Karibou [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 23-02-2007, 12:07
gabrielse's Avatar
gabrielse gabrielse is offline
Registered User
FRC #1748 (Lab Rats)
Team Role: Teacher
 
Join Date: Jun 2005
Rookie Year: 2004
Location: Baltimore
Posts: 55
gabrielse is a splendid one to beholdgabrielse is a splendid one to beholdgabrielse is a splendid one to beholdgabrielse is a splendid one to beholdgabrielse is a splendid one to beholdgabrielse is a splendid one to beholdgabrielse is a splendid one to behold
Inverting a joystick axis in arcade mode

Is there any easy way to invert one joystick axis in arcade mode?

We just got a USB-Chicklet and a Logitech Dual Action Gamepad. Our code uses arcade mode and works perfectly with the joystick from the kit of parts. Unfortunately, the chicklet inverts the x-axis of the gamepad's joystick.

We do not want to change the direction the robot drives.

The only way I know how to work around this problem is to rewrite the arcade function (using the default MPLab 1-joystick drive code as a model). Our rookie programmer won't have time to do that.
  #2   Spotlight this post!  
Unread 23-02-2007, 12:35
kaszeta's Avatar
kaszeta kaszeta is offline
Registered User
FRC #0095 (Grasshoppers)
Team Role: Mentor
 
Join Date: Feb 2004
Rookie Year: 2002
Location: Lebanon, NH
Posts: 334
kaszeta is a glorious beacon of lightkaszeta is a glorious beacon of lightkaszeta is a glorious beacon of lightkaszeta is a glorious beacon of lightkaszeta is a glorious beacon of light
Re: Inverting a joystick axis in arcade mode

Quote:
Originally Posted by gabrielse View Post
The only way I know how to work around this problem is to rewrite the arcade function (using the default MPLab 1-joystick drive code as a model). Our rookie programmer won't have time to do that.
Not quite. None of the modes for the Chicklet use the "aux" analog input for a real axis, they use them for encoding buttons. So, if no buttons are pressed p1_aux (or whatever port you're using) should be larger than 127 all the time if you are using the chicklet. So do a check for that, and if p1_aux is significantly greater than 127, switch the X axis.

I've considered something similar to make sure nothing goes weird if our chicklet is malfunctioning.

Not that unless you're in your fix-it window, you shouldn't be coding right now, however.
  #3   Spotlight this post!  
Unread 23-02-2007, 13:38
Kingofl337's Avatar
Kingofl337 Kingofl337 is offline
You didn't see anything....
AKA: Adam
FRC #0501 (Power Knights)
Team Role: Mentor
 
Join Date: Feb 2005
Rookie Year: 1998
Location: Manchester, NH
Posts: 861
Kingofl337 has a reputation beyond reputeKingofl337 has a reputation beyond reputeKingofl337 has a reputation beyond reputeKingofl337 has a reputation beyond reputeKingofl337 has a reputation beyond reputeKingofl337 has a reputation beyond reputeKingofl337 has a reputation beyond reputeKingofl337 has a reputation beyond reputeKingofl337 has a reputation beyond reputeKingofl337 has a reputation beyond reputeKingofl337 has a reputation beyond repute
Send a message via Yahoo to Kingofl337
Re: Inverting a joystick axis in arcade mode

You can also invert all four motors and that should effectivly invert the axis.
__________________
FIRST Team 501 PowerKnights - Mentor
FIRST Team 40 Checkmate - Mentor Alum
FIRST Team 146 Blue Lightning - Alumni
  #4   Spotlight this post!  
Unread 23-02-2007, 13:46
Dad1279 Dad1279 is offline
Registered User
FRC #1279 (Cold Fusion)
Team Role: Mentor
 
Join Date: Jan 2005
Rookie Year: 2004
Location: NJ
Posts: 511
Dad1279 has much to be proud ofDad1279 has much to be proud ofDad1279 has much to be proud ofDad1279 has much to be proud ofDad1279 has much to be proud ofDad1279 has much to be proud ofDad1279 has much to be proud ofDad1279 has much to be proud ofDad1279 has much to be proud of
Re: Inverting a joystick axis in arcade mode

You can do it in hardware by swapping the pwms on the robot. You may then need to reverse the Red & Black leads from the motor to the Victors.

Or in software just swap the Arcade PWMs for rightmotor/leftmotor. You may also need to check the 'Invert Direction' boxes.
  #5   Spotlight this post!  
Unread 05-03-2007, 10:16
gabrielse's Avatar
gabrielse gabrielse is offline
Registered User
FRC #1748 (Lab Rats)
Team Role: Teacher
 
Join Date: Jun 2005
Rookie Year: 2004
Location: Baltimore
Posts: 55
gabrielse is a splendid one to beholdgabrielse is a splendid one to beholdgabrielse is a splendid one to beholdgabrielse is a splendid one to beholdgabrielse is a splendid one to beholdgabrielse is a splendid one to beholdgabrielse is a splendid one to behold
Re: Inverting a joystick axis in arcade mode

Our programmer switched the left and right motors in the Arcade block and solved the problem. Unfortunately, we have to reprogram if we want to use the KOP joystick. Thanks for all your help.
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
Inverting x-axis jkjohnson Control System 8 22-02-2007 02:24
Arcade Mode (12) does NOT work jakk Programming 2 10-07-2006 19:27
pwm outputs vs. joystick y-axis stephenthe1 Programming 4 01-12-2004 17:29
Inverting Y axis on joystick FormatteD_C Programming 7 24-02-2004 16:56
switching joystick axis????? team222badbrad Technical Discussion 9 16-01-2002 23:07


All times are GMT -5. The time now is 00:30.

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