Add New Commands
These capabilities can be used as the foundation for more complex programs. Begin by selecting the Make a Block button under the Data&Blocks section of the Scripts tab.
Enter Turn_On as the name of the new block. (Note that the two words are connected with an underscore.) Under Options add a number input named Number.
A new block, Define Turn_On Number, will appear in the Scripts workspace. Place the MBot block Set LED Strip beneath the Define Turn_On Number block. The two blocks should snap together.
Drag the purple oval labeled Number from the Define Turn_On Number block into the corresponding space in the Set LED Strip below, as shown in Figure below.
Once the new block has been defined, the new command can be used to create a program. Drag the new Turn_On Number block into the workspace and snap it to the mBot Program block.
Then send the program to the Arduino. LED 15 should turn on.
The new program appears to do the same thing as the initial test program. However, it will serve as the foundation for creation of more sophisticated programs that follow.