Code works well, but robot will not drive

Our lead programmer left last year so we are back to square 1. After hours of youtube videos, we made a new program. It is just a simple tank drive program with nothing else. We uploaded it to the robot and it gave us no errors, but the robot would not drive. We tried our program from last year and it worked. It may be an output problem for the motor id (port number) or something like that.

General programming help is also wanted. (we are currently using robot builder too)
We can also use raw code if anyone can help us with that.

Which language are you using?
If you post your code, we can be of more help.

In the future, posting to a forum specific to your language would increase responses too.

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!

Make sure you have your SpeedController object created and initialized for the right port, if its a Can device, you can get the can ID from the WebView (Plugin or Wirelessly Connect and then go to http://172.22.11.2/). If the speed controller is plugged into the PWM, then initialize the object with the port labelled. First try setting the motor values independent of drive to make sure they are connected and working. I can provide more specific information if you provide your coding language, speed controllers, and port mapping.