# 案例02-追光的XGO ## 目的 --- 让 XGO 实现根据光线照在micro:bit上的强弱而前进或者趴下。 ## 使用材料 --- 1 × micro:bit XGO Robot Kit 套件 ## 硬件连接 --- 使用数据线将电脑与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-02.png) 请参考程序链接:[Chasing Dog](https://makecode.microbit.org/_YVJe8eefmbqo) 同时,可以直接下载下方程序;
## 相关问题 --- 如果 XGO 没有行走,可以适当调整光源亮度 ## 思考 --- 能否让 XGO 根据光照强度做出更多的动作?