1 机械部件与功能 #
WeDo2.0所有机械部件主要分为:建构组件-用于结合模型;连接组件-用于连接小的零部件;移动组件-用于动力传输、移动。
![](https://dashima.net/wp-content/uploads/2022/10/1666337209-45300-element-survey-1024x728.jpg)
![](https://dashima.net/wp-content/uploads/2022/10/1666337563-toolbox-zh-cn-v1_页面_32-1024x656.jpg)
![](https://dashima.net/wp-content/uploads/2022/10/1666337596-toolbox-zh-cn-v1_页面_33-1024x678.jpg)
![](https://dashima.net/wp-content/uploads/2022/10/1666337631-toolbox-zh-cn-v1_页面_34-1024x643.jpg)
![](https://dashima.net/wp-content/uploads/2022/10/1666337669-toolbox-zh-cn-v1_页面_35-1024x678.jpg)
2 电子部件 #
电子部件包括:智能集线器、充电电池、中型马达、倾斜/运动传感器等。
![](https://dashima.net/wp-content/uploads/2022/10/1666337821-image.png)
智能集线器
智能集线器的重要特点:
两个连接传感器或马达的连接口; 一个 LED 灯;一个 开关。
智能集线器通过不同颜色的灯,发出不同的信号:
• 闪烁白灯:等待连接蓝牙。
• 蓝灯:蓝牙连接完毕。
• 闪烁橘色灯:提供给马达的动力达到极限。
![](https://dashima.net/wp-content/uploads/2022/10/1666338016-image.png)
智能集线器充电电池
• 首先必须完全充满电池。
• 充电模式没有特殊要求。
• 请将电池置于阴凉的地方。
• 如果 1-2 个月没有使用电池,请重新充电后再使用。
• 电池充电请不要过长,充电完毕后,及时切断电源。
![](https://dashima.net/wp-content/uploads/2022/10/1666338103-image.png)
中型马达
马达可以使物体运动。
中型马达通过电力进行轴心旋转。
马达可以向两个方向旋转,可以停止,可以设定在特定的时间(精确到秒)内运行,也可以调节不同的速度档。
![](https://dashima.net/wp-content/uploads/2022/10/1666338164-image.png)
倾斜传感器
需要倾斜传感器探测相应的位置,选择正确的程序块是首要条件。它可以感应来自不同方向的倾斜。探测出 6 个不同的位置变化:
• 向此侧倾斜 • 向彼侧倾斜
• 向上倾斜 • 向下倾斜
• 没有倾斜 • 震动
![](https://dashima.net/wp-content/uploads/2022/10/1666338282-image.png)
运动传感器
传感器在一定的距离内可以通过三种方法探测物体的运动变化:
• 物体接近
• 物体远离
• 物体改变位置
运动传感器探测相应的物体,选择正确的程序块是首要条件。
3 编程模块 #
3.1 流程模块 #
![](https://dashima.net/wp-content/uploads/2022/10/1666338864-image.png)
启动块
使用时,应始终放在程序链的开头。按下启动块将启动编写的程序链。
![](https://dashima.net/wp-content/uploads/2022/10/1666338595-image.png)
发送信息
向程序条发送一条信息。将启动所有具有相同信息的信息启动块。信息格式可以是文本或数字。
![](https://dashima.net/wp-content/uploads/2022/10/1666338635-image.png)
信息块
应始终放在程序链的开头。它将等到接收正确的
信息后再启动编写的程序链。
![](https://dashima.net/wp-content/uploads/2022/10/1666338683-image.png)
等待
可使用此程序块告诉程序等待特定事件发生。这样可以使程序在等待设定时长或传感器输入特定信息后再执行。此程序块需要输入才能正常运作。
![](https://dashima.net/wp-content/uploads/2022/10/1666338753-image.png)
重复块
使用此程序块重复操作。放在重复块内的程序块将循环执行。也称为“循环块”。循环可以无限重复、在一段时间内重复或在发生特定事件后停止。
![](https://dashima.net/wp-content/uploads/2022/10/1666338806-image.png)
按键块
使用时,应始终放在程序链的开头。按下此程序块,或在键盘上按下正确的字母启动编写的程序链。与此同时,具有相同字母的所有程序链也将启动。要更改启动字母,可长按程序块进入键盘。
3.2 输出马达块 #
![](https://dashima.net/wp-content/uploads/2022/10/1666338951-image.png)
马达右转块
设置马达按所示方向转动轮轴,启动马达。
点击程序块可快速更改旋转方向。
![](https://dashima.net/wp-content/uploads/2022/10/1666338984-image.png)
马达功率块
设置在马达功率到达一定水平时启动马达。
可以输入 0 到 10 的数值来设置功率水平。
![](https://dashima.net/wp-content/uploads/2022/10/1666339046-image.png)
马达左转块
设置马达按所示方向转动轮轴,启动马达。
点击程序块可快速更改旋转方向。
![](https://dashima.net/wp-content/uploads/2022/10/1666339092-image.png)
马达运行块
设置马达运行指定时长(以秒为单位)。可以
通过输入数值来设置时长,可以使用整数或
小数。
![](https://dashima.net/wp-content/uploads/2022/10/1666339135-image.png)
马达停止块
停止马达的任何移动。
3.3 光程序和声音程序块 #
![](https://dashima.net/wp-content/uploads/2022/10/1666339439-image.png)
闪灯块
以特定颜色点亮智能集线器上的 LED 灯。
可以通过输入数字 0 到 10 来改变颜色。
![](https://dashima.net/wp-content/uploads/2022/10/1666340437-image.png)
音乐块
播放声音。可以从软件内提供的列表中选择
声音。可通过输入数字来选择声音。选择声音
0 可以播放您自己录制的声音。
3.4 输出显示块 #
![](https://dashima.net/wp-content/uploads/2022/10/1666340533-image.png)
显示背景
可使用此程序块显示从软件列表中选择的图像。可以通过输入数字来设置图像。
![](https://dashima.net/wp-content/uploads/2022/10/1666340625-image.png)
加法显示块
在显示器当前显示的数字上加上指定数值。
输入要添加的数值。点击程序块可更改数学运算。
![](https://dashima.net/wp-content/uploads/2022/10/1666340697-image.png)
显示块
可使用此程序块打开软件界面上的显示区域。
显示区域将会显示数字或文本。
![](https://dashima.net/wp-content/uploads/2022/10/1666340734-image.png)
减法显示块
从显示器当前显示的数字中减去指定数值。
输入要减去的数值。点击程序块可更改数学运算。
![](https://dashima.net/wp-content/uploads/2022/10/1666340781-image.png)
乘法显示块
将显示器当前显示的数字乘以指定数值。输入要乘以的数值。点击程序块可更改数学运算。
![](https://dashima.net/wp-content/uploads/2022/10/1666340840-image.png)
除法显示块
将显示器当前显示的数字除以另一个数。输入要除以的数值。点击程序块可更改数学运算。
![](https://dashima.net/wp-content/uploads/2022/10/1666340913-image.png)
关闭显示
可使用此程序块关闭软件界面上的显示区域。
![](https://dashima.net/wp-content/uploads/2022/10/1666340916-image.png)
全屏显示
可使用此程序块将显示区域设置为全屏大小。点击程序块更改大小。
![](https://dashima.net/wp-content/uploads/2022/10/1666341025-image.png)
显示小屏幕
可使用此程序块将显示区域设置为中等大小。
3.5 传感器变化输入 #
![](https://dashima.net/wp-content/uploads/2022/10/1666341995-image.png)
任何距离
向程序块输入运动传感器模式—“任何距离变化”。
![](https://dashima.net/wp-content/uploads/2022/10/1666342123-image.png)
近距离
向程序块输入运动传感器模式—“传感器和物体之间的距离变近”
![](https://dashima.net/wp-content/uploads/2022/10/1666342170-image.png)
远距离
向程序块输入运动传感器模式—“传感器和物体之间的距离变远”。
![](https://dashima.net/wp-content/uploads/2022/10/1666342045-image.png)
向下倾斜
向程序块输入倾斜传感器模式—“向下倾斜”。
![](https://dashima.net/wp-content/uploads/2022/10/1666342257-image.png)
震动
向程序块输入倾斜传感器模式—“震动“。
![](https://dashima.net/wp-content/uploads/2022/10/1666342334-image.png)
向上倾斜
向程序块输入倾斜传感器模式—“向上倾斜”。
![](https://dashima.net/wp-content/uploads/2022/10/1666342360-image.png)
向彼侧倾斜
向程序块输入倾斜传感器模式—“向彼侧倾斜”。
![](https://dashima.net/wp-content/uploads/2022/10/1666342427-image.png)
向此侧倾斜
向程序块输入倾斜传感器模式—“向此侧倾斜”。
![](https://dashima.net/wp-content/uploads/2022/10/1666342465-image.png)
倾斜传感器不倾斜
向程序块输入倾斜传感器模式—“不倾斜”(或水平位置)。
![](https://dashima.net/wp-content/uploads/2022/10/1666342509-image.png)
音量
(由设备)向程序块输入声音传感器模式—“音量变化”。
3.6 数字和文本输入 #
![](https://dashima.net/wp-content/uploads/2022/10/1666342624-image.png)
倾斜传感器输入
向程序块输入倾斜传感器检测到的数值(0、3、5、7 或 9)。
![](https://dashima.net/wp-content/uploads/2022/10/1666342678-image.png)
运动传感器输入
向程序块输入运动传感器检测到的值(0 到 10)。
![](https://dashima.net/wp-content/uploads/2022/10/1666342724-image.png)
插入声音
向程序块输入声音传感器检测到的值(0 到 10)。
![](https://dashima.net/wp-content/uploads/2022/10/1666342773-image.png)
输入数字
向程序块输入数值。
![](https://dashima.net/wp-content/uploads/2022/10/1666342829-image.png)
输入文字
向程序块输入文字。
![](https://dashima.net/wp-content/uploads/2022/10/1666342862-image.png)
输入显示数值
向程序块输入显示区域显示的数值。
![](https://dashima.net/wp-content/uploads/2022/10/1666342909-image.png)
随机输入
向程序块输入随机值。数字范围由所附加的程序块确定。
文字框
(由设备)向程序块输入声音传感器模式—“音量变化”。
3.7 文本框 #
![](https://dashima.net/wp-content/uploads/2022/10/1666342947-image.png)
文字框
可使用注解框在程序中添加注释。
这不是程序块。
4 程序链介绍 #
4.1启动块 #
点击“启动块”,可以在 WeDo 2.0 中执行程序链。“执行程序”:启动一连串程序块,直到程序结束为止。
![](https://dashima.net/wp-content/uploads/2022/10/1666343291-image.png)
4.2 程序块 #
可视化程序块用于 WeDo 2.0 软件程序链中。使用这些带有符号的程序块来取代文本代码。
![](https://dashima.net/wp-content/uploads/2022/10/1666343263-image.png)
4.3 程序链 #
程序链将程序块连接在一起,程序块按次序执行。程序链的最后一个程序块标志着程序结束。
- 线性序列
在线性序列中,程序块按线性顺序逐个放置。乐高® 教育 WeDo 2.0 软件将按照程序
块的放置顺序依次执行操作。 - 并行序列
当学生希望同时执行两个或更多操作时,应使用并行序列。这种情况下,应将程序块
放在不同的程序链上,并使用 WeDo 2.0 中的不同技术同时执行。
![](https://dashima.net/wp-content/uploads/2022/10/1666343311-image.png)