Since 2004, Robots in the FIRST Robotics Competitions have used the C programming language. C is well suited to access a microcontroller at the hardware level, allows powerful coding, and generates compact code. Higher level languages, such as C++ or Java require more support code or lack the ability to program at the hardware level. Students who know C++ or Java should find the transition to C straightforward. The greatest hurdle is creating a complex system to control motors and sensors in a short period of time. FIRST Robots use IFI Robotics' FRC Control system, that is composed of an operator interface for the joysticks and the robot-side controller. The two halves are linked by a two-way data radio modem. The robot-side controller contains two Microchip PIC18F8722 microcontrollers, in the roles of a Master and User controller. From the programmer's viewpoint, only the User controller is visible and provides access to all of the needed robot functions. The IFI Robotics' FRC Robot Controller has 128 Kilobytes of program memory, >3KB of variable space, 1024 bytes of EEPROM, and operation speed of 10MIPs. The C compiler must be written specifically for the microcontroller used in the robot controller, which in this case, is the Microchip PIC18F8722. Since the robot controller's instruction set differs from the instruction set of the CPU in a desktop computer, common C compilers such as MS Visual C cannot be used. Our team uses Microchip's free MPLab IDE in combination with Microchip's commercial MPLab C18 compiler. MPLab software operates on a M.S. Windows based computer, and the compiled code is then uploaded through a serial cable to the robot controller.
The primary code sources for FIRST Robot's are available through IFI Robotics' and Kevin Watson's (of NASA's Jet Propulsion Laboratory) websites. IFI Robotics provides default code for the current and prior years, while Kevin Watson's site contains the best collection of code for higher level control features, such as navigation, gyros, encoders, and camera's. Kevin Watson of NASA's Jet Propulsion Laboratory - Code for navigation, gyros, encoders, and camera's & links to Microchip documents. IFI Robotics - default code and code from prior years. Additionally, code from Lynbrook Robotics is available below.
MPLab IDE - free download from Microchip. Search for download in development tools area. The IDE (Integrated Development Environment) allows you to view and edit source code. However, to compile the code, you need the add-in "MPLab C18" 'C' compiler. MPLab C18 Compiler - commercial product provided at no cost to the team. Contact the team software group. IFI Loader - IFI Robotics; MS Windows based software used to upload the compiled code from the PC to the IFI FRC Robot Controller. Dashboard - IFI Robotics; Optional MS Windows based utility software used to display data sent from the robot to the operator interface. A dashboard viewer may be found here.