This block works for both EV3 Robot and Ruby Robot!
The Set Variable block allows you to change the value of a variable that you have already declared. The initial value of the variable is first set by the Declare Variable block.
The set variable block is found in the Variables section of the block library.
To apply the block to a program:
- Add a Set Variable block to the program from the block library.
- From the block's drop-down menu, select the desired (previously declared) variable.
- Add a value (data block) to the Set Variable block.
Example Program
In this program, the Set Variable block causes the power of the Drive block to increase by 1 each second (for each iteration of the loop).
Configuration
Parameter | Description | Compatible Blocks | Range |
Set |
Select a previously declared variable. |
N/A |
N/A |
to |
Changes the value of a variable |
All data blocks |
-∞ to ∞ |
See also:
Comments
Please sign in to leave a comment.