

So let’s start out with a stub to our method: void moveForward ( float inches ) Note: There are lots of synonyms for function, including method and subroutine. The first thing we need to do is get our robot close to the cube, we even said “Move Forward”, so that sounds like a good method to make. So, let’s get started, one small step at a time. HINT: Working in small steps and checking each step as you go is so much easier than trying to do everything all at once. Not only does it make it easier to discuss your Idea with your teammates but it also makes it easier for Judges to understand what you’re trying to do. It helps to lay out your steps in short phrases that anyone should be able to understand.


Program the robot to pick up each cube, and place them in the goal.

Motor a specified number of degrees FORWARD or BACKWARDĮxample Programs #include "Library2013.c" ĭescription: Makes the robot run around the block.If you look at the Training Table selection screen in Robot Virtual Worlds you’ll see that the description for Basic Movement 1 is: Motor to specified degree at specified power level. If no degree is specified, then motor will Optional Parameters such as degrees and power level. The "stop" or "until" functions to stop the robot.įunctions are used within a loop and are then followed by some other action.Ĭertain distance in inches has been travelledĪccessoryUp (20,55) accessoryDown (20,55) The level of power for the global variable called " powerLevel" The RobotC Functions for the Fall 2015 season For an explanation of common error messages, click here. If you end up with an error message when you press the F5 or F7 key, read the message to try to understand what it is telling you.
#ROBOTC DOWNLOAD#
If you wish to download the Library2015.c file, right click on the following link and choose to save it to your computer: download here. If you are curious about what the Library2015.c "include" file looks like, click here. This is why each of the examples at the bottom of this page include a reference to "#include Library2015.c". The Natural Language statements below are interpreted (compiled) by RobotC through the use of a library of functions stored in a single "include" file. For some statements, a parameter (such as distance, power level, degrees, or side) is required which gives further instructions to the robot. All Natural Language statements below require a set of parentheses followed by a semi-colon. The Natural Language used here is an extension of the RobotC language. Our goal when developing pseudocode will be to identify and organize the simple behaviors a robot needs to complete its mission. It lets you address the important details of your program without having to worry about the less relevant parts getting in your way. Natural Language is a sort of halfway language between English and computer code. RobotC The Natural Language for the Fall 2015 season is as follows:
