AI-Assisted Development
| XIAO Robot Kit | XIAO Robot Board |
|---|---|
![]() | ![]() |
You type a sentence. A coding agent edits the firmware, flashes the board and reads the serial log back to you.
Overview
Two examples, easiest first. Both are the same three moves: you describe the change, the agent types it and flashes the board, and you read the log it reports back.
- Example 1: Your Network, Then a Button — two lines of config and one button. About ten minutes.
- Example 2: A Path-Drawing Remote — a page where you draw a path in centimetres and the car drives it segment by segment. Longer, and the agent does most of the work.
Both work in the example repository. Pins, wiring and power are in Getting Started and Hardware Experiments.
The rover that runs on the Honor Robot Phone is a finished project on this base — see Example 5 in Getting Started.
An agent here is a tool that acts on its own: Claude Code, Codex, Cursor or any other AI coding agent. It reads the project folder, runs the compiler and the uploader, and keeps the serial port open. You decide what should change; it types it, flashes it and tells you what came back.

What You Need
- A XIAO Robot Kit with a charged battery on the battery connector — the motors pull more than a USB port can give
- The esp32 core 3.x in the Arduino IDE — Getting Started walks through it. If it is missing, just say so: the agent sets it up for you, and asks before installing anything
- The example code: XIAO-Robot-Kit — you do not have to clone it yourself; both prompts below ask the agent to check for the repository and clone it when it is missing
- One AI coding tool, installed and signed in with your own account — Claude Code or Codex, terminal agents, or Cursor, an editor with a chat panel next to the files
Install whichever one you pick from the vendor's own page — everything below starts once it is running. Start it in any folder you can write to, not necessarily the repository. Say test first: an answer means the tool is running.
Every example runs on the same car body. If you want to print it yourself, the 3D files are in the Resources section of Getting Started, under Mechanical Design.
Examples 1 and 2 let the agent flash the board and read its serial port. To upload by hand instead, follow the Arduino IDE steps in Getting Started.
1. Your Network, Then a Button
Example 1 is one prompt with two jobs. First the agent puts your Wi-Fi into the example, flashes it and reads the address the board prints. Then it adds a button that prints hello world.
The first job is two strings in one header file, so it rides along with the second instead of taking a section of its own.
The Prompt
Plug the battery in, connect the USB cable, and paste this:
First check where you are: run git remote -v and look for github.com/Seeed-Projects/XIAO-Robot-Kit.
If that remote is not there, clone https://github.com/Seeed-Projects/XIAO-Robot-Kit.git and do
everything below inside it.
The repository holds three example projects: examples/xiao_robot_kit_web_remote (Arduino,
a Wi-Fi remote control), examples/xiao_robot_kit_ble_control (ESP-IDF, BLE commands) and
examples/xiao_robot_kit_ble_skill (the BLE firmware plus a phone agent skill).
Work on the Wi-Fi remote one.
Step 1, the network: put my home network into it — name MyHome-2.4G, password 12345678.
Tell me which file and which lines you changed. Then flash the board, keep watching its
serial port until it joins the network, and tell me the address it printed — both the IP
and the name it answers to.
Step 2, the button: still in examples/xiao_robot_kit_web_remote, add a button to the web
page. Pressing it prints hello world in the serial log. Leave the motors and the driving
page alone. Then flash again, open the page, press the new button, and keep reading the
serial port until hello world appears. Tell me which files you touched and whether the
test passed.
Swap the two values for your own network before you paste. The board joins only when the name and the password both match your router.
What Comes Back
- The files and lines it touched, and the address the board printed after joining.
- Where to check: those two values sit at the top of
examples/xiao_robot_kit_web_remote/src/app/car_config.h, inWIFI_SSIDandWIFI_PASS— and nothing else should change. - The address is one board on one network, so yours will differ and changes with the network.
xiaorobot.localis the mDNS name: try it first, fall back to the IP when your network drops it.
The board joins 2.4 GHz networks only. If the name and the password are right and it still will not connect, your router is probably publishing one name for both bands — give the 2.4 GHz band its own SSID.

Press the new button yourself and hello world shows up in the serial monitor. If it compiles and nothing appears, paste the serial output back into the chat.

What you get may look different — the button lands wherever your agent decided to put it, so treat this as one possible result. What has to be true is the message: press the button, hello world shows up in the serial monitor.
2. A Path-Drawing Remote
Example 1 changed two lines and added a button. Now for something bigger: a car that drives a path you draw.
You describe it, the agent builds it and flashes it, then tests its own work before handing it over — which is why the prompt below is a little longer. You can also skip writing it: talk the idea through with the agent and let it write its own prompt and run it.
What the Project Should Have
- A canvas — draw with a mouse or a finger, measure in centimetres, and the scale has to mean something.
- A debug view — a log window carrying the firmware serial output and the protocol events.
- The buttons — calibrate, run, e-stop, clear, and progress. The old remote keeps working too.
- Acceptance criteria — what counts as done, fixed before any code is written.
The picture below is for illustration — what you actually get will differ with your prompt and with the AI you use.

The Prompt
The prompt carries COM59 and HelloWorld — the port and the network of the machine it was written on. Change both before you paste, and keep the password out of git.
First locate the repo: run `git remote -v` and check for `github.com/Seeed-Projects/XIAO-Robot-Kit`. If that remote
is not there, `git clone https://github.com/Seeed-Projects/XIAO-Robot-Kit.git` and do everything below inside it.
Inside the repo use relative paths only — no absolute paths.
You are a senior embedded firmware + web engineer and an autonomous lead. Own the whole feature end to end — do not
ask for step-by-step details.
**Task.** Build a "path-drawing remote" web page for the XIAO Robot Kit (ESP32-S3, Arduino):
- Draw a path on a canvas (mouse + touch); scale in **cm** with a grid ruler (changing scale changes real distance).
- The page converts the path to motion commands and drives the car segment-by-segment over WebSocket.
- Controls: **zero/calibrate**, **start/run**, **e-stop**, clear — plus live progress (done/remaining cm, current
segment).
- Built-in **log window** (mirrors firmware serial + protocol events), so I can send you "log + symptom" for a
round-2 iteration.
**Reference & hardware reuse.** `examples/xiao_robot_kit_web_remote` — reuse its hardware layer (pins, motors,
encoders, IMU) and its drive / encoder-odometry / heading-hold algorithm directly; implement in a **new standalone
folder**, don't modify the example's original files. The new feature **must also keep the example's original remote
control** working: directional keys / joystick, e-stop, calibrate, etc.
**Environment.** Board is **suspended for debug — no real motion**; verify via logs / protocol acks, not movement.
Serial `COM59`. The car joins the same Wi-Fi as this PC: SSID `HelloWorld`, password `HelloWorld` (in your own config
header; don't commit credentials).
**Deliverable.** Flash the final firmware to the board **yourself** (via COM59). Then provide me with: (1) the
**URL / IP address** where the web page is served (e.g., `http://<device-ip>/`) , obtained from the serial log after
the device joins Wi-Fi, and (2) a concise **usage guide** explaining how to open the page, draw a path, set the scale,
calibrate, run, and e-stop — so I can open the page and use it directly. Mark clearly anything not hardware-verified.
**How to work.** Interpret the requirements → write a full spec (architecture, protocol, units, task split) →
dispatch sub-agents per sub-task (firmware closed-loop drive, canvas, scale, send-down state machine, integration) →
each sub-task leaves evidence (real commands + output) → **create your own test agent to run black-box tests**
(drawing, scaling, send-down, e-stop, link-loss, etc.), **and only release after black-box tests pass** → **flash
the final firmware yourself** → then **report the URL and device IP** along with usage instructions.
**Hard requirements.** UI in cm, firmware in mm/deg; waypoint execution = turn angle + straight segment; implement
an encoder-odometry closed-loop "drive N mm"; confirm each segment before sending the next; auto-stop on link loss /
timeout.
What Comes Back
Take the usage guide it hands back, open the page and start playing.

If It Misbehaves
Expect bugs on the first pass. LLMs rarely get a complex project right in one go. Keep talking to it: say what went wrong, and for the harder ones paste in the recent log.
<the symptom, in one sentence — for example: the path turns left but the car turns right>
<the recent log output, pasted>
The agent wrote the tests and the log lines, so it can read its own output and patch it. The five black-box tests in the prompt are also the first things to suspect: drawing, scaling, send-down, e-stop, link loss.
FAQs
Q1: It reports the edit, but nothing changed
A: Arduino caches builds. Ask for compile --clean, then upload again.
Q2: The agent says it flashed, but the page does not open
A: Read the serial log from the flashing step and use the address printed there, not a remembered one. If no address appears, the board never joined the network — check the name and the password, then the 2.4 GHz note above.
Q3: The board never shows up as a COM port
A: Put it back into the bootloader: hold BOOT on the XIAO, plug the USB-C cable in, release, then flash again.
Tech Support & Product Discussion
Thank you for choosing our products! We are here to provide you with different support to ensure that your experience with our products is as smooth as possible. We offer several communication channels to cater to different preferences and needs.

