View Single Post
  #3   Spotlight this post!  
Unread 02-02-2017, 16:27
GreyingJay GreyingJay is offline
Robonut
AKA: Mr. Lam
FRC #2706 (Merge Robotics)
Team Role: Mentor
 
Join Date: Mar 2015
Rookie Year: 2015
Location: Ottawa, Canada
Posts: 786
GreyingJay has a reputation beyond reputeGreyingJay has a reputation beyond reputeGreyingJay has a reputation beyond reputeGreyingJay has a reputation beyond reputeGreyingJay has a reputation beyond reputeGreyingJay has a reputation beyond reputeGreyingJay has a reputation beyond reputeGreyingJay has a reputation beyond reputeGreyingJay has a reputation beyond reputeGreyingJay has a reputation beyond reputeGreyingJay has a reputation beyond repute
Re: Code works well, but robot will not drive

If you're using C++ or Java, the wpilib plugins in Eclipse are really great for learning how to use the code. You can create a simple example program to do, say, tank drive, or play with pneumatics, etc. by just going to "File", "New", and selecting WPILib Example Project. There's a whole list of samples you can play with.

In the case of a basic tank drive program, if your robot isn't moving, the first step is to go to the hardware and determine where exactly the drive motors are wired.

If they're connected to the RoboRio via PWM connections, note which ports.

If they're Talon SRX's connected over CAN, note what their CAN ID's are. If you're not sure, or if you haven't given them each unique CAN ID's, then that's your next step.

I'm assuming you've also done basic checks on the hardware like making sure the motors themselves are wired correctly, that the motor controllers are powered on, there's a breaker in the PDP, etc.

Once you know what the PWM ports or CAN ID's are, then double check that your code is setting the correct values when you create the instance of the motor controller(s).

Good luck!
__________________
"If I'm going to mentor someone, I'm going to be involved in their life as a positive force." -Mechvet
Reply With Quote