Go to Post Reading the directions is as important as reading the manual. - the man [more]
Home
Go Back   Chief Delphi > Technical > Electrical
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-2006, 18:48
douglass1371 douglass1371 is offline
Registered User
FRC #1371
 
Join Date: Feb 2006
Location: Atlanta
Posts: 5
douglass1371 is an unknown quantity at this point
Victors Controlled By Joystick Buttons

*topic

Any help would be greatly appreciated
  #2   Spotlight this post!  
Unread 16-02-2006, 19:49
Joel J's Avatar
Joel J Joel J is offline
do you..
no team
 
Join Date: May 2001
Rookie Year: 2000
Location: San Jose, CA
Posts: 1,445
Joel J has a reputation beyond reputeJoel J has a reputation beyond reputeJoel J has a reputation beyond reputeJoel J has a reputation beyond reputeJoel J has a reputation beyond reputeJoel J has a reputation beyond reputeJoel J has a reputation beyond reputeJoel J has a reputation beyond reputeJoel J has a reputation beyond reputeJoel J has a reputation beyond reputeJoel J has a reputation beyond repute
Re: Victors Controlled By Joystick Buttons

if you want the victor to go full forward when the button is held down, then you can do something like:

pwm05 == the pwm channel the victor is connected to
p1_sw_trig == joystick button that activates victor

if (p1_sw_trig)
{
pwm05 = 254;
}
else
{
pwm05 = 127;
}

The if statement executes faster than a multiply or some other way of mapping.

You may also need to debounce the joystick button, but since you say you are connecting it to a victor and not a pneumatic of some kind it may not matter.
__________________
Joel Johnson

Division By Zero (229) Alumni, 2003-2007
RAGE (173) Alumni, 1999-2003
  #3   Spotlight this post!  
Unread 17-02-2006, 01:57
Mike AA's Avatar
Mike AA Mike AA is offline
Programmer and Mentor
AKA: Mike Aalderink
FRC #3458 (Code Blue)
Team Role: Programmer
 
Join Date: Jan 2003
Rookie Year: 1999
Location: Holland, Mi
Posts: 698
Mike AA is a splendid one to beholdMike AA is a splendid one to beholdMike AA is a splendid one to beholdMike AA is a splendid one to beholdMike AA is a splendid one to beholdMike AA is a splendid one to beholdMike AA is a splendid one to beholdMike AA is a splendid one to behold
Send a message via MSN to Mike AA
Re: Victors Controlled By Joystick Buttons

You can also, using Joel's code, change the 254 to something else smaller to change the speed of the item you are looking to control. Just keep in mind 127 is center less than is one direction, more than is the other direction.

ie

Quote:
pwm05 == the pwm channel the victor is connected to
p1_sw_trig == joystick button that activates victor

if (p1_sw_trig)
{
pwm05 = 75;
}
else
{
pwm05 = 127;
}
-Mike
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
Free programming help Cuog Programming 24 24-01-2006 16:43
Programming motors with joystick buttons TMHStitans Programming 5 21-03-2005 21:07
Victors controlled with joystick Buttons JamesBrown Programming 2 18-02-2005 23:39
Using the extra buttons on the joystick. Code\\Pilot Programming 7 04-12-2004 19:30
problem with joystick buttons (top left one) Richomundo Programming 5 15-02-2004 17:16


All times are GMT -5. The time now is 04:33.

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