O'Reilly logo

Programming Lego Mindstorms NXT by Owen Bishop

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

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 ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required