Go to Post Maybe if we build a giant wooden badger. - GaryVoshol [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 14-02-2008, 19:40
programmr's Avatar
programmr programmr is offline
Registered User
AKA: Face
FRC #0522
Team Role: Programmer
 
Join Date: Jan 2008
Rookie Year: 2006
Location: Staten Island, NY
Posts: 83
programmr is a jewel in the roughprogrammr is a jewel in the roughprogrammr is a jewel in the rough
Send a message via AIM to programmr
Exclamation Help again with Servo Programming

Hello, this is what i came up with for shifting with a servo... It doesnt seem to work and was wondering if anyone knew how to do it. If p1_sw_top button is hit, it shifts pwm15 and pwm16 into high gear (255) if the p1_sw_trig is hit, it needs to shift into low gear (0). How can i make this work? PLEASE HELP!!!


if ((p1_sw_top == 1)) // If Top Button on Joystick 1 is hit
{ // Make the two servos.......
pwm15 = 255;
pwm16 = 255;
}
else
{
pwm15 = 255;
pwm16 = 255;
}
if ((p1_sw_trig == 1)) // If Trigger is pushed on Joystick 1
{ // Make the two servos.......
pwm15 = 0;
pwm16 = 0;
}
else
{
pwm15 = 0;
pwm16 = 0;
}
  #2   Spotlight this post!  
Unread 14-02-2008, 19:43
seanl's Avatar
seanl seanl is offline
"The Everything person"
FRC #0867 (Absolute Value)
Team Role: Leadership
 
Join Date: Jan 2007
Rookie Year: 2007
Location: Arcadia, CA
Posts: 267
seanl will become famous soon enoughseanl will become famous soon enough
Re: Help again with Servo Programming

you have a contradiction with your elses
__________________
, Sean

TEAM 867
-electrical
-pneumatics
-programming



2008 Autodesk Visualization Grand Prize Winner
  #3   Spotlight this post!  
Unread 14-02-2008, 19:45
psy_wombats's Avatar
psy_wombats psy_wombats is offline
Registered User
AKA: A. King
FRC #0467 (Duct Tape Bandits)
Team Role: Programmer
 
Join Date: Jan 2007
Rookie Year: 2007
Location: Shrewsbury MA
Posts: 95
psy_wombats has a spectacular aura aboutpsy_wombats has a spectacular aura aboutpsy_wombats has a spectacular aura about
Re: Help again with Servo Programming

Eliminate your ELSE cases and everything should work fine. They're negating the effect of the first IF and always set the PWMs to 0. You also may want to find the values at which the gear engages, but does not push the servo beyond its mechanical limit. Although I'm not sure it is needed.
  #4   Spotlight this post!  
Unread 14-02-2008, 19:56
programmr's Avatar
programmr programmr is offline
Registered User
AKA: Face
FRC #0522
Team Role: Programmer
 
Join Date: Jan 2008
Rookie Year: 2006
Location: Staten Island, NY
Posts: 83
programmr is a jewel in the roughprogrammr is a jewel in the roughprogrammr is a jewel in the rough
Send a message via AIM to programmr
Re: Help again with Servo Programming

hey thank you guys so much!
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
Servo Programming Again..... programmr Programming 1 14-02-2008 09:31
Help with programming Armando Programming 1 25-01-2007 18:41
Servo behavior question / advanced servo/PIC programming question DanL Electrical 12 18-10-2005 18:33
Help with Programming double_check Programming 11 19-08-2005 00:15
Help With Programming! KWalsh Programming 5 24-02-2004 11:42


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

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