Go to Post Ok guys. What is this? Make Brandon work day? - Brandon Martus [more]
Home
Go Back   Chief Delphi > Technical > Programming > C/C++
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
  #1   Spotlight this post!  
Unread 19-02-2012, 13:29
DavisC DavisC is offline
Registered User
FRC #0539 (Titans)
Team Role: College Student
 
Join Date: Jul 2011
Rookie Year: 2010
Location: Virginia
Posts: 200
DavisC is just really niceDavisC is just really niceDavisC is just really niceDavisC is just really nice
Dividing Speed on Robot Drive

I am trying to divide the speed of the motors...
by 1/2 when Button 1 of Stick 1 is pressed;
by 3/4 when Button 1 of Stick 2 is pressed; and
by 1/4 when Button 1 of Both sticks are pressed.

Where is the best place to add the divide function.

Code:
			// Drive
			if(J_stick1.GetRawButton(1) == true)
				R_myRobot.TankDrive(J_stick1, J_stick2);
			else
				if(J_stick2.GetRawButton(1) == true)	
					R_myRobot.TankDrive(J_stick1, J_stick2)*3/4;
				else
					if(J_stick1.GetRawButton(1) == true && J_stick2.GetRawButton(2) == true)
						R_myRobot.TankDrive(J_stick1, J_stick2)/4;
					else	
						R_myRobot.TankDrive(J_stick1, J_stick2);
__________________
FRC Team 539
Student Member: 2010 Breakaway - 2014 Aerial Assist
Mentor: 2015 Recycle Rush - present
Reply With Quote
 


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


All times are GMT -5. The time now is 17:36.

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