# MU摄像头模块

## 功能简介

Petoi 智能视觉传感器可以识别多种物体，内置深度学习算法。 例如，它可以检测色块、球、人体和卡片。 其检测结果可通过UART或I2C接口传输。 MU体积小巧，功耗低，所有算法本地处理，可广泛应用于智能玩具、AI+STEAM课程、创客作品等产品或领域。

<figure><img src="/files/TkmasNQvQ67Vez0iGa2i" alt=""><figcaption></figcaption></figure>

## 软件设置

{% hint style="info" %}
目前桌面应用程序只支持产品**Bittle**，软件版本**2.0**，模式请选择“**摄像头**”。
{% endhint %}

* 您可以使用 Petoi 桌面应用程序中的[固件上载](https://docs.petoi.com/v/chinese/zhuo-mian-ying-yong/gu-jian-shang-zai)完成配置并上传主功能程序。如下图所示：

![](/files/MdhRpsvJjdQ8r9dWtKZS)

* 您也可以使用 [Arduino IDE](https://www.arduino.cc/en/software) 自由地上传程序和修改代码。

1. 下载 [MU Vision Sensor库](https://github.com/mu-opensource/MuVisionSensor3) 并将其安装到您的 Arduino IDE 中。

   <figure><img src="/files/SGhlLy5tpRwHRcUw5bmn" alt=""><figcaption></figcaption></figure>

   <figure><img src="/files/st3SZlBFLBetWjCgoQFJ" alt=""><figcaption></figcaption></figure>

2\. 使用最新的 OpenCat 代码完成设置后并上传程序。

![](/files/2ioqxciFNIFYacgtnTRK)

如果您已经上传了最新的 OpenCat 程序可以让 Bittle 行走，您只需要删除 OpenCat.ino 中 **#define CAMERA** 前面的代码注释符号（//）, 如上图所示，然后上传程序即可。

如果您不确定，您需要按照[标准上传程序流程](https://docs.petoi.com/v/chinese/arduino-ide/wei-nyboard-shang-chuan-cheng-xu)上传一遍程序以确保一切配置正确，然后再按照上述步骤上传程序。

## 硬件设置

上传完成后，切换 MU Vision Sensor 上的拨码开关，并使用电线连接到 NyBoard，如下图所示：

![](/files/e0SjKd1LDVX0ckDr7qjT)

{% hint style="info" %}
注意左右拨码开关位置（左：下上；右：下下），一定要拨到图示位置。
{% endhint %}

具体使用时将连接摄像头的一端固定在机器人的头部（含在Bittle的嘴中）。

如果摄像头模块程序正确上传，Bittle基本保持蹲坐姿势，您可以在 Arduino IDE 的[串口监视器](https://docs.petoi.com/v/chinese/arduino-ide/chuan-kou-jian-shi-qi)中看到相关打印信息（如下图所示）。 当 MU 视觉传感器识别到目标时，两个 LED 将变为蓝色，Bittle 头部可以追随目标左右摆动。如果未能找到任何目标对象，演示代码将自动在黄色网球和人体之间切换目标。

![](/files/wdNvFMO0XwJR8MZ0JLqZ)

{% hint style="info" %}
如果 MU 视觉传感器无法识别目标物体，请先按下MU 视觉传感器上的重置按钮，然后再按下主板上的重置按钮。
{% endhint %}

更多细节，可以参考[技术支持文档](https://morpx-docs.readthedocs.io/zh_CN/latest/MUVS3/introduction.html)。

功能演示视频如下：

{% embed url="<https://www.bilibili.com/video/BV1hN411Q7TX?share_source=copy_web&vd_source=5b53358e3ed9e3e64243f5234203f423>" %}


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.petoi.com/chinese/kuo-zhan-mo-kuai/mu-she-xiang-tou-mo-kuai.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
