Waddle Bot Unit 1 Lesson 1

Functions Without Parameters

-- eraseDisplay --
  • Function Syntax: eraseDisplay()

Function Libraries

Some functions require more than one parameter. The way you can how many parameters is needed is by looking at the documentation. The first source of information is the Function Library within RobotC. This will generate when you compile a program. RobotC will also hide some of the more advanced functions from this list. To see them you need to change your menu level.

Elements of a Function

Primitive Data Types


At the most general level, everything in a program can be separated into two general groups: Commands and Data. The main difference between these groups is the ability to store information. Commands can only perform actions while data is information that can be acted upon.

The main data types that we will work with are:

Comments and White Space


RobotC is a free-form programming language. This means that when you write a program, multiple spaces, tabs, and line returns are ignored by the NXT. This allows us to use these ignored structures to format our program and make it easier to read. If wanted, we could put all of our commands on one line. Here is what the above example program would look like if we did:

Task [string]label { } Introduction

When you open a new RobotC program, you start with a blank slate, with no instructions. The NXT/RobotC was designed with a number of rules that force us to write or programs in a certain way. Our first rule of RobotC is:

1. NXT actions shall reside within tasks.

Waddle Bot Unit 0

Waddle Bot Unit 0 Lesson 1

concept lesson test 2