Go to Post I had so much to say but I dont know how to get it accross -- but to all of you that we were involved with this weekend, thankyou for everything -- we're changing lives, and we truly are moving mountains, in more ways than one. - Jacqui Sutton [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 02-02-2008, 13:38
OMAR_567 OMAR_567 is offline
Registered User
FRC #2595
 
Join Date: Jan 2008
Location: Los Angeles
Posts: 4
OMAR_567 is an unknown quantity at this point
Programming Help- 2 Motor 2 joystick Drive System

Can someone help us use change the default code from a one joystick operation to a two joystick two motor drive system?

We will be using a tank drive system. We would like to see some sample code.
  #2   Spotlight this post!  
Unread 02-02-2008, 14:01
bronxbomber92 bronxbomber92 is offline
Registered User
FRC #1551 (Grapes of Wrath)
Team Role: Programmer
 
Join Date: Jan 2007
Rookie Year: 2007
Location: Naples
Posts: 75
bronxbomber92 is an unknown quantity at this point
Re: Programming Help- 2 Motor 2 joystick Drive System

Team 166 just posted some of there code, and it included two-joystick drive. May be worth checking out!
  #3   Spotlight this post!  
Unread 02-02-2008, 14:08
jacobhurwitz jacobhurwitz is offline
Registered User
FRC #0449 (Blair Robot Project)
Team Role: Programmer
 
Join Date: Jan 2008
Rookie Year: 2007
Location: Maryland
Posts: 45
jacobhurwitz has a spectacular aura aboutjacobhurwitz has a spectacular aura aboutjacobhurwitz has a spectacular aura about
Re: Programming Help- 2 Motor 2 joystick Drive System

Quote:
Originally Posted by OMAR_567 View Post
Can someone help us use change the default code from a one joystick operation to a two joystick two motor drive system?

We will be using a tank drive system. We would like to see some sample code.
If you're using a tank drive, it's simple. Pretend the left motor is pwm01 and the right motor is pwm02. Call the left joystick p1_y and the right joystick p2_y (because y is the forwards-backwards direction). Then the code is simply:

Code:
pwm01 = p1_y;
pwm02 = p2_y;
Note: you may need 255-p1_y if the left motor moves backwards. Same goes for the right motor: 255-p2_y.

When both joysticks are forwards, both motors are forward and the robot goes forward. When both are back, the robot goes backwards. When one is forward and one is backwards, the motors move in opposite directions and the robot twists clockwise or counterclockwise.
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
Direct Drive Four Motor System Collin Fultz Technical Discussion 42 02-11-2006 12:03
1 Joystick Drive or yaniv Programming 3 19-01-2005 14:18
Drive System Animation Project help is needed Brian Lesser Technical Discussion 4 12-10-2004 17:09
Control System, Joystick mod? Jordan A. Technical Discussion 16 13-02-2002 02:29
Quick Start Guide - Drive System Help for Rookies Nuts4FIRST Technical Discussion 5 31-10-2001 14:42


All times are GMT -5. The time now is 19:07.

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