Skip to content

Commit 9f2eb24

Browse files
committed
add img
1 parent 30d1a72 commit 9f2eb24

File tree

4 files changed

+29
-19
lines changed

4 files changed

+29
-19
lines changed
385 KB
Loading
259 KB
Loading

content/hardware/08.edu/solution-and-kits/alvik/tutorials/getting-started-mblock/getting-started-mblock.md

Lines changed: 29 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
---
2-
title: "Start with Alvik and block-based language"
2+
title: "Start with Alvik and Block-based Language"
33
difficulty: beginner
44
description: "Take your first steps with Arduino® Alvik and mBlock."
55
tags:
@@ -9,7 +9,7 @@ author: "Gaia Castronovo"
99

1010
![Alvik's Robot](assets/getting-started.jpg)
1111

12-
Welcome to your first experience with Alvik, your companion for exploring robotics and programming. In this guide, we'll walk you through setting up your Alvik and starting your journey into block based.
12+
Welcome to your first steps with Alvik, your companion for exploring robotics and programming. In this guide, we'll walk you through setting up your Alvik and starting your journey with block based language.
1313

1414
## What’s Included in the Box
1515

@@ -20,7 +20,7 @@ When unboxing Alvik, you should find the following items:
2020

2121
## Preparing Your Environment
2222

23-
During the installation process, you may **need to install additional drivers**, which requires access to the **administrator login password** to your OS.
23+
During the installation process, you may **need to install additional drivers**, that require access to the **administrator login password** to your OS.
2424

2525
### Supported Systems
2626

@@ -70,8 +70,6 @@ Sometimes, the driver installation window may open in the background. Look for t
7070

7171
If you encounter an installation error, try clicking "UNINSTALL" and then "INSTALL" again. Once the driver installation is complete, close the driver window manually by clicking the "X" button. After installing the drivers, finish the mBlock installation.
7272

73-
Find mBlock on your computer (it has a Panda icon) and open it.
74-
7573
### MacOS
7674

7775
To install mBlock on macOS:
@@ -87,12 +85,10 @@ To install mBlock on macOS:
8785

8886
If you're using a **Chromebook** ([read the full guide here](https://support.makeblock.com/hc/en-us/articles/19412317319191-Device-Connection-Guide-for-Chromebook-Latest-Version)) or a **Linux** machine, the installation process is different because there is no installable version of the software available. Instead, you'll use the online version of mBlock, which requires a special driver to connect to the robot.
8987

90-
1. Scroll down to find the "mLink - mBlock web version driver" and download the appropriate file for your operating system.
88+
To find the "mLink - mBlock web version driver" and download the appropriate file for your operating system.
9189

9290
![download mlink](assets/mlink.png)
9391

94-
2. Go to your Downloads folder and install the driver. The installation steps may vary depending on your operating system.
95-
9692
## Update Firmware
9793

9894

@@ -105,17 +101,17 @@ To program Alvik, start by opening the mBlock software if you haven’t already.
105101

106102
**1.** Locate the robot's **on/off switch** and slide it to the **OFF** position.
107103

108-
***To ensure a proper connection and protect the robot's battery, always turn off the robot before connecting it to your computer; it may not appear if left on***
104+
***To ensure a proper connection and protect the robot's battery, always turn off the robot before connecting it to your computer; it may not appear if left on.***
109105

110-
![Alvik switch slide on or off](/block-based-coding-robotics/_assets/projects/00/robot-off.png)
106+
![Alvik switch slide on or off](assets/robot-off.png)
111107

112108
**2.** <a href="https://ide.mblock.cc">Open mBlock</a>. In the `Device` section, add Alvik as a programmable board by clicking the `+ Add` button, then selecting Alvik from the robot list.
113109

114110
![add device in mblock](assets/add-device.gif)
115111

116-
**3.** **Connect the programming cable** to your computer and the Arduino Nano ESP32, the brain of the robot.
112+
**3.** **Connect the programming cable** to your computer and the Arduino Nano ESP32.
117113

118-
![Connecting Alvik to the PC](assets/connecting-final.gif)
114+
![Connecting Alvik to the PC](assets/connecting_alvik.gif)
119115

120116
**4.** Locate the robot's **on/off switch** and slide it to the **ON** position.
121117

@@ -127,7 +123,7 @@ To program Alvik, start by opening the mBlock software if you haven’t already.
127123

128124
**6.** Click the **Connect** button in the pop-up window.
129125

130-
In the connect window, select the **Serial Port**, which is the interface the computer uses to communicate with the robot. On Windows, you might see something like COM4 (or another number), while on other operating systems, it could be something like `/dev/tty.[yourSerialPortName]`. mBlock typically detects the correct port automatically, but if you encounter any issues, make sure the selected port is the right one.
126+
In the connect window, select the **Serial Port**, in Windows you might see something like COM4 (or another number), while on other operating systems, it could be something like `/dev/tty.[yourSerialPortName]`. mBlock typically detects the correct port automatically, but if you encounter any issues, make sure the selected port is the right one.
131127

132128
![mblock connect button](assets/COM-port.png)
133129

@@ -137,8 +133,20 @@ In the connect window, select the **Serial Port**, which is the interface the co
137133

138134
Explore mBlock to start programming Alvik. You'll find a list of visual blocks in the center of the interface. Each block represents a command Alvik can execute, divided into **different colored folders by action kind**.
139135

140-
![command list](assets/command-list-horiz.png)When you're creating a sequence of commands for Alvik you **always need to start by stating the initial event**:
141-
Find an `Event` command that starts when a button is pressed.
136+
![command list](assets/actions.png)When you're creating a sequence of commands for Alvik you **always need to start by stating the initial event** either:
137+
138+
![event in the action menu](assets/events.png)
139+
140+
* `When Alvik starts` - the code will be executed the moment you turn ON Alvik.
141+
* `When button [] is pressed` - the code will be executed the moment you press the designated button.
142+
143+
### Blocks Parameters
144+
145+
Every parameter inside the **rectangle area**, for example the number `5` or the `cancel ▼` element in the dropdown menu can be edited, to give Alvik a different behavior.
146+
147+
![yellow-blink](assets/yellow-blink.png)
148+
149+
Some blocks, for example in `Control` section, have an angular tile `` parameter, where you can drag and drop in an entire block, allowing you to nest commands like`if < > then { }`.
142150

143151
## Blink
144152

@@ -156,16 +164,18 @@ The goal of our first program is to make the LEDs flash when you press a button
156164

157165
2. Next, go to the `LEDs` folder and drag `set [left] LED color to [RED] for (1) seconds` into the coding area, connecting it to the previous command.
158166

159-
3. You need to upload the code to the robot. **Remember to turn ON the robot before uploading the code.** Transfer the program from the PC to the board by clicking the blue `Upload Code` button in the left side of the interface, and wait for the file transfer. You are now ready to test the code: let's press the `` button on the Alvik!
167+
3. You need to upload the code to the robot. **Remember to turn ON the robot when you are transferring the code.** Click the `Upload Code` button in the left side of the interface, and wait for the file transfer.
160168

161169
Now you’ve created your first program: Alvik will turn on the left LED for one second when the OK `` button is pressed.
162170

163171
![Blink](assets/blink.gif)
164172

165-
Every parameter inside the white area (for example the number `1` or the `` element in the dropdown menu) may be edited, to give Alvik a different behavior. Let's try to edit the program to make the robot turn on *yellow* both LEDs, for *5 seconds*, when button `cancel` is pressed.
166-
167-
![yellow-blink](/block-based-coding-robotics/_assets/projects/00/yellow-blink.png)
173+
### ToF Sensor Example
168174

175+
use the command `if < > then { } else { }`
176+
177+
Alvik needs time to read the distance sensor, and if you keep looping too fast, it might get overwhelmed. To fix this, add a **small delay** (about 0.1 seconds). This won’t change much in behavior but will give Alvik **enough time to read the sensor**.
178+
169179
### Next Steps
170180

171181
* If you want to learn more about how Alvik is built or which functions you can use to program it, visit the documentation in the [Docs space for Alvik](https://docs.arduino.cc/hardware/alvik/) and follow the respective [Alvik's User Manual](https://docs.arduino.cc/hardware/alvik/user-manual) to know more about how to build incredible projects with your robot!

0 commit comments

Comments
 (0)