Skip to content

Commit 04dccc6

Browse files
committed
add video
1 parent 99d283b commit 04dccc6

File tree

3 files changed

+15
-3
lines changed

3 files changed

+15
-3
lines changed

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

+15-3
Original file line numberDiff line numberDiff line change
@@ -156,7 +156,9 @@ Every parameter inside the **rectangle area**, for example the number `5` or the
156156

157157
Some blocks, for example in the`Control` section, have an **hexagonal** tile `` parameter, where you can drag and drop in an entire block, allowing you to nest commands like for `if < > then { }`.
158158

159-
## Blink
159+
![Nesting parameters inside a block](assets/angular-parameter.png)
160+
161+
## Blink Example
160162

161163
Alvik comes with two built-in **RGB LEDs**, located on top of the robot.
162164

@@ -180,9 +182,19 @@ Now you’ve created your first program: Alvik will turn on the left LED for one
180182

181183
### ToF Sensor Example
182184

183-
use the command `if < > then { } else { }`
185+
In this second example Alvik will try to keep a constant distance from an object, moving back and forward accordingly.
186+
187+
<video width="100%" loop autoplay>
188+
<source src="assets/tof-video.mp4" type="video/mp4" />
189+
</video>
190+
191+
Navigate to `Control` commands folder.
192+
193+
Inside a loop block called `forever` , use the command `if < > then { } else { }`
194+
195+
Alvik needs time to read the distance sensor therefore we need to avoid executing the loop block `forever` too fast. To fix this, add a **small delay** (about 0.1 seconds) with the block `wait ( )`. This won’t change much in behavior but will give Alvik **enough time to read the sensor**.
184196

185-
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**.
197+
We'll also use two other kind of blocks: `Motor` contains all actions to control Alvik's wheels and inside the folder `Distance Sensors` the blocks to control the Time of Flight sensor.
186198

187199
### Next Steps
188200

0 commit comments

Comments
 (0)