Thread: Will this work?
View Single Post
  #3   Spotlight this post!  
Unread 13-01-2017, 17:07
bob.wolff68's Avatar
bob.wolff68 bob.wolff68 is offline
Da' Mentor Man
FRC #1967
Team Role: Mentor
 
Join Date: Jan 2012
Rookie Year: 2007
Location: United States
Posts: 158
bob.wolff68 is just really nicebob.wolff68 is just really nicebob.wolff68 is just really nicebob.wolff68 is just really nicebob.wolff68 is just really nice
Re: Will this work?

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
__________________
~~~~~~~~~~~~~~~~~~~
Bob Wolff - Software from the old-school
Mentor / C / C++ guy
Team 1967 - The Janksters - San Jose, CA
Reply With Quote