Quote:
Originally Posted by Gondorf5
Sorry it took so long to respond I've been all over the place.
Our motors are wired to a Jaguar, thank you rbmj (will the code you've provided set the extra motors to run on certain buttons? that would be very helpful to know and could you elaborate on what the constructor line of code is for? I'd like to know if the code you've provided will stand on its own or if it's algebraic, if you know what I mean).
|
No, it won't run on its own. You need to plug it in with your own control logic. You'll need to declare Joystick objects to control the robots. Your control logic will go in the TeleopContinuous function if you're using IterativeRobot or the OperatorControl function if you're using SimpleRobot. The documentation is your friend. You'll also need to look at the RobotDrive class to handle arcade/tank drive. Use Joystick::GetRawButton() and if statements to control your code.
Quote:
I'll do my best to make light of the code and links you've generously provided, but in case I can't find what I'm looking for, I need to set up the three extra motors to activate when a button is pressed and deactivate when the button is released.
I'm probably leaving something important out, I KNOW IT, but I'm suffering from a major brain fart, so thanks again for your valuable assistance!
--Gondorf5--
Restoration at: -10% :-(
|
Something like this?
Code:
//put this inside your while(IsOperatorControl()) {} loop in SimpleRobot
//or your TeleopContinuous function in IterativeRobot:
drive.ArcadeDrive(my_joystick);
if (my_joystick.GetRawButton(1)) {
my_jag.Set(1.0);
}
else {
my_jag.Set(0.0);
}