In the previous tutorials we've gone over the basics of the Java language and the documentation provided out of the box through the Javadocs, but we haven't even skimmed the surface yet. In this tutorial we go over the basics of getting started using Java to program for the FIRST Robotics Competition. This is the "Hello World" of FRC Java robot projects!
This tutorial starts off with a review of the materials we've covered so far, introduces the development environment and documentation, and gets into the default program templates provided in the SunSPOT Java SDK for FRC. By the end of the presentation we've introduced some of the most fundamental inputs and outputs: Joysticks and Motors respectively. We learn how to use the classes provided for these items in a new Eclipse project, setup a simple teleoperated mode, and deploy our code onto the cRIO to see the fruits of our labor. Think of it as Hello World for FRC Java bots!
Sample Java project: (zip)
Note, the code we have written is set up to read the axis off of a Logitech F310 Gamepad. You may need to modify the specific axis channels to get it to work with your hardware setup.