Chapter 3. Data

Introduction

At the end of Chapter 2 we described data wires and how to use them for sending data from one block to another. Handling data is what programming is all about, so let's take a closer look at how data wires work.

There are three kinds of data wires for conveying the three types of data:

  • Numeric Integers (whole numbers), including negatives, for example 50, 6, −261.
  • Logic Have one of two possible values, False or True.
  • Text A string of alphanumeric characters, for example Hello, turn right, 471, D34r7.

One type of data that NXT-G does not have is floating point data; that is, numeric data with a decimal fraction. Examples are 3.4, 124.778, 72.9 (more precise than 73), and 0.0053. It is not often that we need to ...

Get Programming Lego Mindstorms NXT now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.