|
|
|
![]() |
|
|||||||
|
||||||||
![]() |
|
|
Thread Tools | Rate Thread | Display Modes |
|
|
|
#1
|
||||
|
||||
|
Re: Motor Code Help
So this is what I have right now, we plugged the left motors into pwm 1 and the right ones into pwm 2 using pwm splitter, and still no luck
Code:
#include "WPILib.h"
class RobotDemo : public SimpleRobot
{
RobotDrive robotDrive;
Joystick stick1, stick2;
public:
RobotDemo(void):
robotDrive(1,2),
stick1(1), //Joystick 1 in slot 1
stick2(2) //Joystick 2 in slot 2
{
GetWatchdog().SetExpiration(0.1);
}
void Autonomous(void)
{
GetWatchdog().SetEnabled(false);
robotDrive.Drive(0.5, 0.0); // drive forwards half speed
Wait(2.0); // for 2 seconds
robotDrive.Drive(0.0, 0.0); // stop robot
}
void OperatorControl(void)
{
GetWatchdog().SetEnabled(true);
while (IsOperatorControl())
{
GetWatchdog().Feed();
robotDrive.TankDrive(stick1,stick2);
Wait(0.005); // wait for a motor update time
}
}
};
START_ROBOT_CLASS(RobotDemo);
|
|
#2
|
||||
|
||||
|
Re: Motor Code Help
are the joysticks configured correctly on the driverstation?
go to setup tab, and on the right side, drag the joysticks to 1 and 2 |
|
#3
|
||||
|
||||
|
Re: Motor Code Help
Got things working now, thanks for all the help guys!
|
|
#4
|
|||
|
|||
|
Re: Motor Code Help
might i suggest using an ancient technology of split PWM's the go from one port to 2 jaguars or victors. they are extremely helpful.
|
|
#5
|
||||
|
||||
|
Re: Motor Code Help
We may or may not have ended up doing this...
|
![]() |
| Thread Tools | |
| Display Modes | Rate This Thread |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| 4 motor Mecanum wheel code request | inventor1254 | NI LabVIEW | 17 | 23-02-2010 08:45 |
| ADC code effecting motor outs??? | Kyveck | Programming | 16 | 28-03-2006 15:12 |
| Adding a motor to code | sirbleedsalot | Programming | 1 | 27-01-2005 23:02 |
| hey need some help with writing a code please help me here | magical hands | Programming | 9 | 01-01-2004 21:46 |