# 案例05-触摸XGO ## 目的 --- 让 XGO 实现根据micro:bit的徽标是否被触摸做出转圈的动作和声音大小做出后退或者趴下的动作。 ## 使用材料 --- 1 × micro:bit XGO Robot Kit 套件 ***注意:*** 本案例适用于micro:bit(V2.0) ## 硬件连接 --- 使用数据线将电脑与micro:bit 相连。 ![](./images/microbit-xgo-robot-kit-22.png) ## 软件平台 --- [Makecode](https://makecode.microbit.org/#) ![](./images/microbit-xgo-robot-kit-10.png) ## 编程 --- 将 XGO 的扩展库添加到 makecode 中。 ![](./images/microbit-xgo-robot-kit-11.png) ![](./images/microbit-xgo-robot-kit-12.png) ![](./images/microbit-xgo-robot-kit-13.png) ![](./images/microbit-xgo-robot-kit-14.png) ## 程序 --- ### 示例程序 ![](./images/microbit-xgot-robot-kit-case01-out-of-the-square-05.png) 请参考程序链接:[Touch Dog](https://makecode.microbit.org/_DPCdXybUs7me) 同时,可以直接下载下方程序;
## 相关问题 --- 如果 XGO 没有行走,可以适当提高声音大小。 ## 思考 --- 能否让 XGO 根据声音大小做出更多的动作?