Go to Post * FIOTWOD -pronounced "FI ot wood", the first two syllables rhyme with "riot" -stands for: FIRST-is-the-only-topic-worthy-of-discussion - Joe Johnson [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 10-02-2003, 12:56
ronnie_82 ronnie_82 is offline
Registered User
#1158 (corps bots)
 
Join Date: Dec 2002
Location: Collbran,CO Job Corps
Posts: 35
ronnie_82 is an unknown quantity at this point
Send a message via Yahoo to ronnie_82
programming help

Could someone help us with some p-basic language that would give us some programming in our joystick that would allow one wheel to turn at normal speed and one wheel to turn same direction but slower
__________________
"So what..you ain't tellin me nothin"
  #2   Spotlight this post!  
Unread 10-02-2003, 13:05
Skabana159's Avatar
Skabana159 Skabana159 is offline
Robotics and Field Hockey
AKA: Jesse C. Owens
#0159 (Alpine Robotics)
Team Role: Mentor
 
Join Date: Mar 2002
Rookie Year: 2000
Location: Ft. Collins, CO
Posts: 92
Skabana159 is on a distinguished road
Send a message via AIM to Skabana159
Well, if you wanted your first wheel to go directly with the joystick, and you wanted your second wheel to go at about half that speed, you could do this:

pwm1 = p1_y
if p1_y > 127 then pwm2 = (127 + (abs(127 - p1_y)/2))
if p1_y < 127 then pwm2 = (127 - (abs(127 - p1_y)/2))

That was just off the top of my head, but I think it will work. You can use any scaling factor, but if you want it to be faster than half speed, you will have to multiply by a fraction, rather than divide. Let's say you wanted it to be 3/4 speed. You would have to multiply by (3/4) instead of dividing by .75, because PBasic cannot do numbers less than 1. I suggest using constants if you're not sure what ratio you want it to be.
__________________
"What most people do not understand is that the Buddha, the Godhead, resides just as comfortably in gears and circuits as in hills and trees. To believe otherwise is to dilute the Godhead."
-Robert Pirsig, Zen and the Art of Motorcycle Maintenance

Last edited by Skabana159 : 10-02-2003 at 13:20.
  #3   Spotlight this post!  
Unread 10-02-2003, 13:50
ronnie_82 ronnie_82 is offline
Registered User
#1158 (corps bots)
 
Join Date: Dec 2002
Location: Collbran,CO Job Corps
Posts: 35
ronnie_82 is an unknown quantity at this point
Send a message via Yahoo to ronnie_82
thanks

thank you for the information i will give it to the engineer
__________________
"So what..you ain't tellin me nothin"
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
multi-bank programming problem GregC Programming 3 14-02-2003 16:13
Pneumatics electrical wiring and programming archiver 2001 1 23-06-2002 23:10
Error found in programming for the pump and pressure switch sjharobotics Programming 4 06-02-2002 17:46
pbasic programming punarhero Programming 4 21-01-2002 23:32


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

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