Getting Started
Connext your Robot to Robot C
Open sample program and upload to Robot
The Structure of Robot C Program
► #pragma
This area defines the robot system
► Includes
References to external Library code
► Global Variables
Variable available to all functions
►User-defined Functions
Variables defined inside a function are scoped as local and only visible to the function of origin
► task main() { // the nuts and bolts }
► conditions, Variables , Constants Statements and Functions
→ Conditions
→ Variables Consist of Three Parts
Data Type Assigned to Value
int x=0;
→ Constant
const float pi=3.14159265
/ *********************************************/→ Functions
void myFunction(){ // has no return vale or inpit
Statements
..
..
}
/ *********************************************/
int myFunction2(){ // has no return vale or inpit
Statements
float pi=3.14159265;
..
..
return pi;
}
/ *********************************************/
►Math
► Control Structures
Resources:
Sample Code
http://www.robotc.net/wikiarchive/General
http://www.robotc.net/support/webhelpfiles/
http://help.robotc.net/WebHelpVEX/index.htm