LEGO 【MINDSTORMS】EV3
Variable Block
Variable Block - Overview -
The Variable block lets you read or write a Variable in your program. You can also create a new Variable and name it.
A Variable is a location in the memory of the EV3 Brick that can store a data value. You can write to a Variable to store a data value.
Later in the program, you can read from the Variable to access the stored value.
Each variable has a Type and a Name. The different Types are Numeric, Logic, Text, Numeric Array, and Logic Array.
You can choose the Name of the variable, which is used to identify the variable.
The value of a variable can be changed while a program is running.
Each time you write to a variable, any previous value is erased and replaced with the new value.
For example, you could use a variable named “Max Light” to keep track of the highest light intensity that your robot has measured from the Color Sensor so far.
Each time the robot detects a higher value, it could write the new value into the “Max Light” variable.