Go to Post ...Well also I'm just hooked on FIRST. (I swear, I can quit whenever I want!) - CENTURION [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 09-02-2005, 19:22
JBotAlan's Avatar
JBotAlan JBotAlan is offline
Forever chasing the 'bot around
AKA: Jacob Rau
FRC #5263
Team Role: Mentor
 
Join Date: Sep 2004
Rookie Year: 2004
Location: Riverview, MI
Posts: 723
JBotAlan has a reputation beyond reputeJBotAlan has a reputation beyond reputeJBotAlan has a reputation beyond reputeJBotAlan has a reputation beyond reputeJBotAlan has a reputation beyond reputeJBotAlan has a reputation beyond reputeJBotAlan has a reputation beyond reputeJBotAlan has a reputation beyond reputeJBotAlan has a reputation beyond reputeJBotAlan has a reputation beyond reputeJBotAlan has a reputation beyond repute
Send a message via AIM to JBotAlan Send a message via Yahoo to JBotAlan
Reversing the joystick axis

Sorry if I didn't search well enough, but how does one go about reversing the joystick value? I tried a negative, but I realized the pwm value is an unsigned val, what is the math I need to do on the joystick value to make it so foreward is backward and backward is foreward?
__________________
Aren't signatures a bit outdated?
  #2   Spotlight this post!  
Unread 09-02-2005, 19:34
Tristan Lall's Avatar
Tristan Lall Tristan Lall is offline
Registered User
FRC #0188 (Woburn Robotics)
 
Join Date: Aug 2001
Rookie Year: 1999
Location: Toronto, ON
Posts: 2,484
Tristan Lall has a reputation beyond reputeTristan Lall has a reputation beyond reputeTristan Lall has a reputation beyond reputeTristan Lall has a reputation beyond reputeTristan Lall has a reputation beyond reputeTristan Lall has a reputation beyond reputeTristan Lall has a reputation beyond reputeTristan Lall has a reputation beyond reputeTristan Lall has a reputation beyond reputeTristan Lall has a reputation beyond reputeTristan Lall has a reputation beyond repute
Re: Reversing the joystick axis

Code:
#DEFINE PWM_MAX 254
...
pwm01 = PWM_MAX - p1_y //Your joystick 1 y-value is reversed
  #3   Spotlight this post!  
Unread 09-02-2005, 19:34
jgannon's Avatar
jgannon jgannon is offline
I ᐸ3 Robots
AKA: Joey Gannon
no team
 
Join Date: Feb 2004
Rookie Year: 2004
Location: Pittsburgh, PA
Posts: 1,467
jgannon has a reputation beyond reputejgannon has a reputation beyond reputejgannon has a reputation beyond reputejgannon has a reputation beyond reputejgannon has a reputation beyond reputejgannon has a reputation beyond reputejgannon has a reputation beyond reputejgannon has a reputation beyond reputejgannon has a reputation beyond reputejgannon has a reputation beyond reputejgannon has a reputation beyond repute
Re: Reversing the joystick axis

Quote:
Originally Posted by JBotAlan
Sorry if I didn't search well enough, but how does one go about reversing the joystick value? I tried a negative, but I realized the pwm value is an unsigned val, what is the math I need to do on the joystick value to make it so foreward is backward and backward is foreward?
Instead of:
Code:
pwm01=p1_x;
do:
Code:
pwm01=255-p1_x;
Good luck.
__________________
Team 1743 - The Short Circuits
2010 Pittsburgh Excellence in Design & Team Spirit Awards
2009 Pittsburgh Regional Champions (thanks to 222 and 1218)
2007 Pittsburgh Website Award
2006 Pittsburgh Regional Champions (thanks to 395 and 1038)
2006 Pittsburgh Rookie Inspiration & Highest Rookie Seed

Team 1388 - Eagle Robotics
2005 Sacramento Engineering Inspiration
2004 Curie Division Champions (thanks to 1038 and 175)
2004 Sacramento Rookie All-Star

_
  #4   Spotlight this post!  
Unread 09-02-2005, 19:47
pakrat pakrat is offline
Rich Ross
no team (The Rat Pack)
Team Role: Alumni
 
Join Date: May 2004
Rookie Year: 2003
Location: Ann Arbor
Posts: 328
pakrat is just really nicepakrat is just really nicepakrat is just really nicepakrat is just really nicepakrat is just really nice
Send a message via AIM to pakrat
Re: Reversing the joystick axis

Quote:
Originally Posted by jgannon
Instead of:
Code:
pwm01=p1_x;
do:
Code:
pwm01=255-p1_x;
Good luck.

Yeah, this worked for us
__________________
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
Tri-axis Analog Joystick KVermilion Control System 5 19-01-2005 00:24
Inverting Y axis on joystick FormatteD_C Programming 7 24-02-2004 16:56
Changing 1 joystick code to 2 (rookie team) Brawler006 Programming 5 20-02-2004 17:00
robot goes haywire with the one joystick default code Miles Programming 7 24-01-2003 14:58
switching joystick axis????? team222badbrad Technical Discussion 9 16-01-2002 23:07


All times are GMT -5. The time now is 23:56.

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