top of page

小火车实验室 2:红外传感器激活

小火车实验室2

客观的


通过安装红外传感器不断提高编程能力。对小火车进行编程,使其通过手势启动。

活动


  • 首先,学生将红外传感器连接并连接到小火车上

  • 了解编程时红外传感器的工作原理

  • 成功编程小火车,通过手势启动

评估


  • 学生将学习传感器功能的基础知识

  • 学习基本的电路和中级编码技能

在我们的小火车项目的下一阶段,参与者将通过引入传感器来增强他们的编码能力。参与者将连接并按照示意图将红外传感器连接到他们的微控制器,并在指导下对他们的小火车进行编程以检测附近的物体并做出反应。

实验室总结:

所需材料:

Photo
Material
Purpose
Recommended Quantity

Little Train Kit

Assembly kit which fosters hands-on skills and familiarizes participants with parts.

1 Per Participant

USB-C Cable

Provides direct upload connection between computer and C2G microcontroller.

1 Per Participant

C2G Mini Microcontroller

Acts as the control center where code instructions are received and electrical signals are sent to various hardware components to execute actions.

1 Per Participant

IR Sensor Kit

Contains 2 IR senors and 2 sets of female-to-female wire sensors to the microcontroller.

1 Per Participant

Step 1

Natural Light Portrait

按照以下步骤或按照以下视频连接并连接小火车的红外传感器:


  1. 获得指定的红外传感器套件、电线 + 尼龙搭扣

  2. 小心地将红外传感器连接到你的小火车上

  3. 首先连接 VCC、GND 和 OUT 引脚

  4. 将另一端连接到 C2G-Mini 的 3V3、GND 和 GP5

  5. 有了这个,你就可以进入第 2 步了

Step 1

Step 2

Natural Light Portrait

对小火车进行编程以通过红外传感器启动:


  1. 使用 Code2Grow 编码工作区,单击库按钮并选择 IR 传感器

  2. 一旦选择,单击“添加到工作区”,这将创建用于编码红外传感器的基础程序。

  3. 根据连接的 GP 引脚,本例中为:GP5。确保分配的引脚匹配。

  4. 将 USB-C 电缆插入 C2G-Mini,确保微控制器已打开

  5. 对你的小火车进行编程并通过手部动作享受它的激活!

bottom of page