Loading presentation...

Present Remotely

Send the link below via email or IM

Copy

Present to your audience

Start remote presentation

  • Invited audience members will follow you as you navigate and present
  • People invited to a presentation do not need a Prezi account
  • This link expires 10 minutes after you close the presentation
  • A maximum of 30 users can follow your presentation
  • Learn more about this feature in our knowledge base article

Do you really want to delete this prezi?

Neither you, nor the coeditors you shared it with will be able to recover it again.

DeleteCancel

Introduction to RobotC

An introduction to the RobotC Programming Language and IDE
by

Sean Kelley

on 11 August 2015

Comments (0)

Please log in to add your comment.

Report abuse

Transcript of Introduction to RobotC

Intro to
What is RobotC
ROBOTC is a text-based programming language based on
the standard C programming language.
Debugging made EASY
IDE Features
Function Library
This portion of the interface allows user to see all the functions available in ROBOTC
Portions of code from the Function Library can be dragged into the Editor
Helpful Interface:
Syntax and Operands (+, -, *, {, <, [, etc.) in
ORANGE
Normal Text in BLACK
Comments in
GREEN
Reserved Words in
BLUE
Constants and Parameters in
RED
Displaying Errors
At compilation time, the ROBOTC compiler analyzes your code to identify syntax errors, capitalization and spelling mistakes, and code inefficiency, such as unused variables and redundant code.
ROBOTC generates three types of compiler messages:
Errors: Errors are denoted with a
Red X
Warnings: Warnings are denoted with a
Yellow X
Information: Information messages are denoted with a White X .
The Editor
Loops
Variables, Datatypes, and Arrays
Logic: If Statements
Language Basics
Motors
RobotC Specifics
Variable:
a data item that may take on more than one value during the runtime of a program
Datatype
: the type of data to be stored in a
variable
Array:
a variable that holds more than one value simultaneously
Variables
Datatypes
Arrays
Declaration:
Datatype
Name
Value
Reference:
Name
Value
Using the Value:
Most Important Datatypes:
string
int
long
float
bool
void
Declaration:
Datatype
Name
Indices
Reference:
Name
Index
Value
Using the Value:
swag
is equal to 5
values
array has 11 indices
indices start at 0
all indices are integers
the third index is set to 5
Structure:
Example:
if condition1 is true, this is run
if condition2 is true, this is run
if no conditions are true, this is run
turn left
turn right
go forward
Functions
Structure:
For Loop:
While Loop:
run the code in brackets 10 times
run the code in brackets until condition is false
Call:
Example:
argument1 = "cookies"
argument2 = 1337
Sensors
Functions
the
motor
array is a reserved
register motors in the
Motors
tab of the
Motors and Sensors Setup
window
reference motors by name in the
motor
array
motors take a 6 bit value which translates to range of 0 - 127
rightMotor
leftMotor
register sensors in either the
Analog
or
Digital
tab of the
Motors and Sensors Setup
window
Call the
SensorValue
function with the sensor name to get or set the value
wait
wait1Msec
wait10Msec
SensorValue
random
PlayTone
Extra Info
ROBOTC
Documentation:
http://help.robotc.net/WebHelpVEX/index.htm

VEX Forums:
http://www.vexforum.com/
Finito
Next:
Documentation Standards
Git VCS/SCM
How to Use the PA VEX Competition Template
Full transcript