Go to Post As far as the GDC being that mean, at least three of them have the pure evil genius rating, and the rest are simply pure evil. - EricH [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

 
 
 
Thread Tools Rate Thread Display Modes
Prev Previous Post   Next Post Next
  #4   Spotlight this post!  
Unread 04-02-2003, 02:12
Jnadke Jnadke is offline
Go Badgers!
#0093
Team Role: Alumni
 
Join Date: Jan 2002
Location: Appleton, WI
Posts: 775
Jnadke is on a distinguished road
Send a message via ICQ to Jnadke Send a message via AIM to Jnadke Send a message via Yahoo to Jnadke
they easy way:

Code:
drive_L              var      byte
drive_R              var      byte
tempjoystick      var      byte


drive_R = (((2000 + p1_y + p1_x - 127) Min 2000 Max 2254) - 2000)
drive_L = (((2000 + p1_y - p1_x + 127) Min 2000 Max 2254) - 2000)
'single joystick drive code


if p4_sw_aux1 = 1 then
      tempdrive = drive_R
      drive_R = 254-drive_L
      drive_L = 254-tempjoystick
endif

Works like a charm. I used it last year on our robot.

Basically, you want to do the reverse code AFTER you figure out how fast you want each motor to go (assuming you're doing a 2 motor drivetrain, tank-style). It may not be pretty, or efficient, but it's guaranteed to work.

Not only do you have to reverse the drive speeds, but also you must remember to flip the left and right motor values, or you will find that the x-axis will be backwards.
__________________
The best moments of our lives fall in two categories: those that did happen and those that did not.

Last edited by Jnadke : 04-02-2003 at 02:14.
 


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
spike for pressure switch? Rob Colatutto Rules/Strategy 4 23-02-2003 15:42
Using a switch before autonomous operation KZos550 Programming 11 04-02-2003 19:12
NEED HELP with Delay loop for compressor relay switch archiver 2001 10 24-06-2002 02:11
1 or 2 phase switch archiver 2001 0 24-06-2002 00:48
Error found in programming for the pump and pressure switch sjharobotics Programming 4 06-02-2002 17:46


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

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