Thread: Will this work?
View Single Post
  #4   Spotlight this post!  
Unread 14-01-2017, 02:50
GavinL GavinL is offline
intensely stares at program
FRC #5726 (RhumBotz)
Team Role: Programmer
 
Join Date: Jan 2016
Rookie Year: 2016
Location: San Antonio, Texas
Posts: 42
GavinL is a splendid one to beholdGavinL is a splendid one to beholdGavinL is a splendid one to beholdGavinL is a splendid one to beholdGavinL is a splendid one to beholdGavinL is a splendid one to beholdGavinL is a splendid one to behold
Re: Will this work?

Quote:
Originally Posted by bob.wolff68 View Post
Gavin,
First ... feel free to use the "["CODE"]" and "["/CODE"]" markers (without the double-quotes) around anything that you want NOT formatted (smiles etc) - works like a champ.
Code:
int i=25;
Now for TankDrive, this is the drive mechanism where you (usually) want two joysticks - one is all about the left wheels and the other is all about the right wheels. Right? If that's indeed what you're looking for, then only the Y-Axis would be looked at for each of the joysticks. As such, TankDrive() would have inputs from two different sticks like:

BTW - I'm not familiar with your Robot:: class so I'm going to use my own 'Joystick' instances - if you have your own already, feel free to substitute...

Found somewhere like RobotInit()...
Code:
JoyStick leftStick(0);
JoyStick rightStick(1);
Code:
TankDrive(leftStick.GetY(), rightStick.GetY());
This is the gist of it. Does that make sense? Let me know if not.

roboBob
Yes it makes sense. Its just that we are using a logitech f310 so I have to use one port. Also last year we had it set up with the if statement, worked pretty well. Just didn't know if we should keep doing that or go to the TankDrive().
Reply With Quote