Lego Robot Inventor Kit - Blast: on His Own
Introduction: Lego Robot Inventor Kit - Blast: on His Own
The purpose of this Instructable is threefold: 1) to begin a series of Instructables that explain and expand on the capabilities of the 2020 Lego Mindstorm Robot Inventor Kit, 2) to provide an autonomous amnd non-violent (many of the examples included with the kit for the Blast model involve striking, wrecking, shooting, punching, battling) example, and 3) to provide instruction on using the Word (block) coding included with the kit.
Word code (the name Lego gives to their Block Code which is built on Scratch) examples are included with the kit; however, detailed explanations and nuances on how to use the app and each code line (block) are not provided. The Code is organized under several categories including motors, movement, light, sound, events, control, sensors, operators, remote control, variables, my blocks (blocks created by the user), and model blocks (blocks created specifically for the samples included in the kit). Within the various categories there are several types of blocks: hat (used to start a program), stack blocks (main commands), C blocks (establishes the beginning and end of a loop), reporter blocks (hold values), boolean blocks (conditions that can either be true or false - typically used in conjunction with C blocks), and cap blocks (used to end scripts).
This Instructable will provide detailed instruction for controlling motors, movement, and the distance sensor along with some control, events, and operator programing. Future Instructables will focus on the other sensors, sound, and additional blocks.
Supplies
Mindstorm Robot Inventor Kit (Lego 51515)
Step 1: Modified Blast: Construction
1. Build the Blast Robot included in the Lego 51515 kit.
2. Remove Distance Sensor from left arm.
3. Remove front hatch (see image 1).
4. Attach Distance Sensor to front of body (see image 1) thread wire through the body to the body's back side (see image 2).
5. Attach two panels; one (5x11) above the Distance Sensor and one (3x11) below the Distance Sensor.
Step 2: Modified Blast: Wiring
The wiring from the motors (see image 1) and sensors to the hub (see image 2) stays the same:
Port A: Right leg motor.
Port B: Color Sensor (not used in this example).
Port C: Left leg motor.
Port D: Arms and head motor.
Port E: Right forearm/wrist motor (not used in this example).
Port F: Distance sensor.
Tip: The letters labeling the ports are difficult to read. Rotate the hub to more easily read the letters.
Step 3: Lego Mindstorm Inventor Kit: App
1. Download and open the Lego Mindstorms Inventor App (available for Macintosh, iOS, Windows).
2. Select File - Open.
3. Select Word Blocks and then Create.
Step 4: Write Word (Block) Code: Set Up Variables
Now we can start writing the code. This code will direct our modified Blast to roam around avoiding any obstacles.
1. 141
When starting a new project - the code line "When Program Starts" is automatically inserted.
2. Drag "Blast Calibrate" from the Model Blocks category. Insert it under the first line of code and allow it to attach (see image 1). This code resets Blast so that all motors are in a neutral position and all sensors are cleared.
This code will have one variable which keeps track of the number of times that our modified Blast changes directions.
1. Click on the Variables category and click on "Make a Variable" (see image 2).
2. In the dialog box that appears (see image 3) type the name of the variable "times" (see image 4) and click OK. Now the variable (see image 5) is available for use.
3. Prepare the variable by dragging "Set timer to" from the Variable category under the "Blast Calibrate" code line (see image 5). Type the value you wish to assign to the variable in the white circle. For this project, type "0" so that the variable can start from zero recording the number of turns. The "Set times to" and the "Change times by" code blocks appear under the Variables Category after you have created a variable.
Step 5: Write Code: Set Up Motors
In this step we prepare the motors and get them moving.
1. Drag "Set movement motors to" (see image 1) from the Movement Category. The Movement Category allows for the programming of two motors simultaneously. In our example, we want the left leg and right leg to work in coordination. 149