39 | | Use the WPILib icon to build your new program: W->Build Robot Code |
| 39 | * Use the WPILib icon to build your new program: W->Build Robot Code |
| 40 | * Connect to the Peanut WiFi Hotspot |
| 41 | * Use the WPILib icon to deploy your program to the robot: W->Deploy Robot Code |
| 42 | * Launch the FRC Driver Station on your laptop. Two windows should open: FRC Driver Station and FRC PC Dashboard. |
| 43 | * Plug in an x-box controller and make sure it is detected |
| 44 | * Make sure the Communications, Robot Code, and Joysticks LED icons are all green |
| 45 | * In the FRC PC Dashboard, select the Variables tab and scroll down to Smart Dashboard->Left Joystick X (that's the variable you created!) |
| 46 | * Move the left X-box joystick right and left and watch the value shown for Left Joystick X change! |
41 | | |
42 | | == Start with an example |
43 | | The best way to learn about robot programming a robot is to start with a simple example program, run it, study what it does, and incrementally expand its functionality. The WPILib software you installed includes example programs that you can compile and run on a RoboRIO. Review [https://wpilib.screenstepslive.com/s/currentCS/m/79833/l/941601-vs-code-basics-and-wpilib-in-vs-code how to use VSCode] and then try [https://wpilib.screenstepslive.com/s/currentCS/m/79833/l/932465-creating-a-new-wpilib-project-in-vs-code creating a new robot project]. |
| 48 | You can even debug your program on the robot using the VSCode debugger just as you did with Java programs running on your laptop: |
| 49 | * Set a breakpoint on the line: xbox = new XboxController(0); |
| 50 | * Use the WPILib icon to start debugging: W->Debug Robot Code |
| 51 | * The program will run until it gets to that line and then stop. Press the continue button to continue running. |
| 52 | * Even though the program is running on the robot, you can set breakpoints, step through code, examine and change variables, etc. from your laptop. |
| 53 | |
| 54 | == Study some examples |
| 55 | Learn more about robot programming by studying some simple example programs. Run them, study what they do, and incrementally expand their functionality. The WPILib software you installed includes example programs that you can compile and run on a RoboRIO. Review [https://wpilib.screenstepslive.com/s/currentCS/m/79833/l/941601-vs-code-basics-and-wpilib-in-vs-code how to use VSCode] and then try [https://wpilib.screenstepslive.com/s/currentCS/m/79833/l/932465-creating-a-new-wpilib-project-in-vs-code creating a new robot project]. |