Working with data is one important step if you want to take your robot programming to the next level. In EV3 programming language there are 3 data types - numeric, text, logic. In the following tutorial we will cover some basic facts about them.
- 24 Sep 2018
How is data represented in computers?
As you may have heard everything in modern computers is represented with 1s and 0s. To be more precise those 0s and 1s are combined in groups by 8 called bytes. Those bytes can represent numbers between 0 and 255. So if we want to represent numbers in computers its easy, we just write them in binary. Here comes the part where the type of the data is important. Lets say we have a byte that is 01000011. If that byte represents a number it will be 67, but if that byte represents a text it will be the character C. So as you can see it is quite important for the computer to know if that byte is a number or character.
How data is handled within the EV3 Software?
As you may have noticed every block may have several input and output parameters. Each parameter should be either number, text or logic. Data is passed betweet the blocks through data wires. Those wires can be pulled from output parameters and insterted in input parameters as shown:
The wires may be in three different colors. If the data wire is yellow, then it "caries" numeric data type.
If the data wire is orange it "caries" text
and if it is green it "caries" logic.
It is important not to mismatch data types, that is why it is useful to know which color represents which data type.
Courses and lessons with this Tutorial
This Tutorial is used in the following courses and lessons