Getting Started Writing Robot Code

Hi, I’m a new programmer for team 4732 and I’ve gotten to the point where our robot can have programs loaded onto it however I’m having trouble getting started writing them. If anyone can point me in the right direction (links, sample code, etc) it would be greatly appreciated.

**Read this while you are waiting for responses:

For the 2020 season software documentation has been moved to https://docs.wpilib.org. Documentation for KOP items can still be found here. | FRC KOP Documentation**

To get started with programming the robot, I suggest the following:

  • Read everything in the link Ether posted if you haven’t already.
  • Look at the sample robot code provided by FIRST. You can see it by making a new robot project, selecting the type of robot (i.e. Command-based or Iterative), and choosing the example code option.
  • Check other team’s source code out. I don’t have any links readily available, but some teams put their past year’s source code in public repositories. Reading a completed robot’s source can greatly help you learn how to write robot code yourself, but keep in mind; it’s there to teach you how to write your own code, not to copy-paste from.

If you have any questions, feel free to post them here and we’ll try to help! :slight_smile:

Thanks. I’ll check it out.

Also, consider looking at the videos here:

http://wp.wpi.edu/wpilib/robotics-videos/

And look down the page for the WPILib with RobotBuilder videos. You don’t have to use RobotBuilder, but it makes it easier.

It turns out that the videos, which were made last year, have some useful tips for this years game - using an elevator to pick up and manipulate objects.

Your in luck! I have a few examples of code on this years code!

Note: I have all the combinations of drive trains available because my team is indecisive and It is easier to do this instead of writing it every time it changes. Allows me to be lazier and do the things I want such as vision and sensors!
To Be Named Robot

last years robot ported over to this years code!
Lady Guenavere