Go to Post I think there is much to be learned from working in teams, and team projects, but even more when you go out on your own some time for something you are truly passionate about. - paul_v [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 16-02-2004, 00:20
Robert Hafner's Avatar
Robert Hafner Robert Hafner is offline
FIRST Alumni
no team
 
Join Date: Mar 2003
Rookie Year: 2000
Location: Springfield. MA
Posts: 34
Robert Hafner is on a distinguished road
Send a message via AIM to Robert Hafner Send a message via MSN to Robert Hafner Send a message via Yahoo to Robert Hafner
Re: Programming joysticks

Because the last bits are unreliable (from what i've read), how will this affect the program? Should I stick with a general area? example:

Code:
if (p1_wheel >= 42 && p1_wheel <= 46)
    // I am neutral
if (p1_wheel >= 250 && p1_wheel <= 254)
     // I am upperleft;
  #2   Spotlight this post!  
Unread 11-02-2004, 18:27
Astronouth7303's Avatar
Astronouth7303 Astronouth7303 is offline
Why did I come back?
AKA: Jamie Bliss
FRC #4967 (That ONE Team)
Team Role: Mentor
 
Join Date: Jan 2004
Rookie Year: 2004
Location: Grand Rapids, MI
Posts: 2,071
Astronouth7303 has much to be proud ofAstronouth7303 has much to be proud ofAstronouth7303 has much to be proud ofAstronouth7303 has much to be proud ofAstronouth7303 has much to be proud ofAstronouth7303 has much to be proud ofAstronouth7303 has much to be proud ofAstronouth7303 has much to be proud ofAstronouth7303 has much to be proud ofAstronouth7303 has much to be proud of
Re: Programming joysticks

Quote:
Originally Posted by Joe_Ross
Why not #define them, instead of taking up memory?
I don't like using #define for constants. Besides, we've got memory to kill.
  #3   Spotlight this post!  
Unread 11-02-2004, 21:19
deltacoder1020's Avatar
deltacoder1020 deltacoder1020 is offline
Computer Guy
AKA: Dav
#1020 (The Indiana Prank Monkeys)
Team Role: Programmer
 
Join Date: Jan 2004
Location: Muncie, Indiana
Posts: 340
deltacoder1020 has a spectacular aura aboutdeltacoder1020 has a spectacular aura about
Send a message via AIM to deltacoder1020
Re: Programming joysticks

Quote:
Originally Posted by Astronouth7303
I don't like using #define for constants. Besides, we've got memory to kill.
hmm... apparently the forum system managed to place a reply in a different thread... right.
__________________
Team 1020, the Indiana Prank Monkeys (www.team1020.org)
  #4   Spotlight this post!  
Unread 12-02-2004, 17:54
Tridelvior Tridelvior is offline
Windbringer
#0348
Team Role: Programmer
 
Join Date: Jan 2004
Location: Norwell, Massachusetts
Posts: 13
Tridelvior is an unknown quantity at this point
Question Re: Programming joysticks

Do you know the non-binary values of the pX_wheel in their up- and down positions?

I am trying to use their values with a pwm and do not know what to use.

Quote:
temp = p1_wheel;

if (temp==WHAT VALUE?[UP]){
pwm02=200;
}
else[DOWN]{
pwm02=55;
}
__________________
Team 348 Programmer/Animator/Slacker

Minion #341
  #5   Spotlight this post!  
Unread 02-02-2004, 11:11
Ryan M. Ryan M. is offline
Programming User
FRC #1317 (Digital Fusion)
Team Role: Programmer
 
Join Date: Jan 2004
Rookie Year: 2004
Location: Ohio
Posts: 1,508
Ryan M. has much to be proud ofRyan M. has much to be proud ofRyan M. has much to be proud ofRyan M. has much to be proud ofRyan M. has much to be proud ofRyan M. has much to be proud ofRyan M. has much to be proud ofRyan M. has much to be proud ofRyan M. has much to be proud of
Re: Programming joysticks

Quote:
Originally Posted by FotoPlasma
Basically, if you can understand binary, you can take advantage of the POV hat for controlling your robot.
You also have to good at bit manipulation in C!
__________________

  #6   Spotlight this post!  
Unread 11-02-2004, 16:15
Erico Erico is offline
Registered User
AKA: yoshi
#0618 (E.A.R.T.H squad)
Team Role: Engineer
 
Join Date: Jan 2004
Location: philadelphia
Posts: 1
Erico is an unknown quantity at this point
Re: Programming joysticks

If u can make me a favor, can u teach me how to program the joysticks. I will appreciated. thank u

GOOD LUCK THIS YEAR
  #7   Spotlight this post!  
Unread 11-02-2004, 17:02
deltacoder1020's Avatar
deltacoder1020 deltacoder1020 is offline
Computer Guy
AKA: Dav
#1020 (The Indiana Prank Monkeys)
Team Role: Programmer
 
Join Date: Jan 2004
Location: Muncie, Indiana
Posts: 340
deltacoder1020 has a spectacular aura aboutdeltacoder1020 has a spectacular aura about
Send a message via AIM to deltacoder1020
Re: Programming joysticks

the inputs from the joysticks are held in a range of variables (actually aliases), set up in ifi_aliases.h:

for instance, the x-axis of joystick one is p1_x

if you want direct joystick-to-pwm control, just use something like the following line:

pwm01 = p1_x;
__________________
Team 1020, the Indiana Prank Monkeys (www.team1020.org)
  #8   Spotlight this post!  
Unread 11-02-2004, 17:15
Ryan M. Ryan M. is offline
Programming User
FRC #1317 (Digital Fusion)
Team Role: Programmer
 
Join Date: Jan 2004
Rookie Year: 2004
Location: Ohio
Posts: 1,508
Ryan M. has much to be proud ofRyan M. has much to be proud ofRyan M. has much to be proud ofRyan M. has much to be proud ofRyan M. has much to be proud ofRyan M. has much to be proud ofRyan M. has much to be proud ofRyan M. has much to be proud ofRyan M. has much to be proud of
Re: Programming joysticks

Quote:
Originally Posted by Erico
If u can make me a favor, can u teach me how to program the joysticks. I will appreciated. thank u

GOOD LUCK THIS YEAR
Just to expanded on what DeltaCoder said, the joysticks are refered to by pX_x and pX_y, where X is the port number the joystick is attched to. For example to access the x and y axises of the port one joystick you would use p1_x and p1_y.

The value that comes in on these pins is between 0 and 255 (an unsigned char). 0 is full to one side, 127 is center, and 255 is full to the other side. For instance, if you have the joystick all the way forward, p1_x would be 255 and p1_y would be 127. If you had it all the way to the right, p1_y would be 127 and p1_y would be 255.

You could also have a combination of the two, of course. For instance, if you where in the forward, right corner, you would get p1_x and p1_y both reading 255.

You can use these values in any way in your program. Just don't try to change their value in code; it won't work!

Hope that helps. Good luck.
__________________

  #9   Spotlight this post!  
Unread 24-02-2004, 20:26
iamjarret iamjarret is offline
Registered User
#1257
 
Join Date: Feb 2004
Location: New Jersey
Posts: 1
iamjarret is an unknown quantity at this point
Re: Programming joysticks

hey, i have a question
we plugged a motor to the pwn port that corresponds to p1_wheel(the wheel)
and teh operator interface shows that when we move the wheel, the values are changing (input), but it is not moving the motor. It is correctly mapped (pwm09 = p1_wheel

how can i get it to work



also, i would like to make code the made a pwm got to speen 255 when p4_sw_trig (trigger) is pushed(equal to 1).

my code so far is
if (p4_sw_trig == 1)
{
pwm12 = 255; (for this i commented out pwm12 = p4_wheel

i also tried p4_wheel = 255;

and i tried p4_wheel = 0xFC;


}

lastly, the y axis dose'nt work on ports 3 and 4 on any joystick i try



please help me fix my code, wheels, and y-axes

thanx
  #10   Spotlight this post!  
Unread 27-01-2004, 18:12
Smrtman5's Avatar
Smrtman5 Smrtman5 is offline
Dr. Bridgeport
AKA: Jon H
FRC #0041 (Robo-wariors)
Team Role: College Student
 
Join Date: Nov 2003
Rookie Year: 2003
Location: Warren
Posts: 63
Smrtman5 is on a distinguished road
Send a message via AIM to Smrtman5
Re: Programming joysticks

I have two basic questions. First, can those old robot interfaces be programed for C or are they strictly the old stuff?

Second, does anyone have an old program with just the two joystick controls? All we want to do is hook up an old interface to a mock control board so we can make sure the trannys work.

(Note: Im the fabricator, the only thing i know about computers is how to break one)
Hopefully i can relay this answer to one of our more knowledgeable people. Thanks
__________________
Art is just an excuse for poor craftsmanship.

- Jon H
Team 41
Rowan University '10 Mechanical Engineering
  #11   Spotlight this post!  
Unread 27-01-2004, 20:31
Ryan M. Ryan M. is offline
Programming User
FRC #1317 (Digital Fusion)
Team Role: Programmer
 
Join Date: Jan 2004
Rookie Year: 2004
Location: Ohio
Posts: 1,508
Ryan M. has much to be proud ofRyan M. has much to be proud ofRyan M. has much to be proud ofRyan M. has much to be proud ofRyan M. has much to be proud ofRyan M. has much to be proud ofRyan M. has much to be proud ofRyan M. has much to be proud ofRyan M. has much to be proud of
Re: Programming joysticks

Quote:
Originally Posted by Smrtman5
I have two basic questions. First, can those old robot interfaces be programed for C or are they strictly the old stuff?
Do you mean the old robot controllers? If so, they can only do the old PBASIC stuff.
__________________

  #12   Spotlight this post!  
Unread 28-01-2004, 05:51
FotoPlasma FotoPlasma is offline
\: |
no team
 
Join Date: Jul 2001
Rookie Year: 2001
Location: San Jose
Posts: 1,900
FotoPlasma has a reputation beyond reputeFotoPlasma has a reputation beyond reputeFotoPlasma has a reputation beyond reputeFotoPlasma has a reputation beyond reputeFotoPlasma has a reputation beyond reputeFotoPlasma has a reputation beyond reputeFotoPlasma has a reputation beyond reputeFotoPlasma has a reputation beyond reputeFotoPlasma has a reputation beyond reputeFotoPlasma has a reputation beyond reputeFotoPlasma has a reputation beyond repute
Send a message via AIM to FotoPlasma
Re: Programming joysticks

Quote:
Originally Posted by Smrtman5
Second, does anyone have an old program with just the two joystick controls? All we want to do is hook up an old interface to a mock control board so we can make sure the trannys work.
InnovationFirst has "Legacy Documentation" on their website. They have default code, written in PBASIC (for previous years' control systems), for both single and dual joystick driving. Here's a link to download those programs. They're listed under "PBASIC Code", but you will also need a copy of Parallax's computer program, in order to program your controller. Links are listed on that same website under "Programming Tools".

If you need any more assistance, feel free to ask.
__________________
I played hacky sack with Andy Baker.

2001-2004: Team 258, The Sea Dawgs
2005: Team 1693, The Robo Lobos
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
Programming Compatition Angela06 Programming 30 08-04-2005 23:12
Could use some help with joysticks . . . archiver 2001 5 23-06-2002 23:36
Pneumatics electrical wiring and programming archiver 2001 1 23-06-2002 23:10
Calibrating speed controllers and joysticks thedillybar Technical Discussion 4 11-02-2002 13:24
pbasic programming punarhero Programming 4 21-01-2002 23:32


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