AI 支援開発
あなたが 1 文入力すると、コーディングエージェントがファームウェアを編集し、ボードに書き込み、シリアルログを読み取って返してくれます。
概要
簡単な方から 2 つの例です。どちらも同じ 3 ステップ:あなたが変更内容を説明し、エージェントがそれを入力してボードに書き込み、報告されたログをあなたが読みます。
- 例 1:あなたのネットワークとボタン — 設定 2 行とボタン 1 つ。所要時間は約 10 分です。
- 例 2:経路描画リモコン — センチメートル単位で経路を描くページで、車がその経路を区間ごとに走行します。より長い例で、作業の大半はエージェントが行います。
どちらの例も example repository で動作します。ピン配置、配線、電源については Getting Started と Hardware Experiments を参照してください。
Honor Robot Phone 上で動くローバーは、このベースの完成プロジェクトです — Getting Started の Example 5 を参照してください。
ここでいう エージェント とは、自律的に動作するツールのことです:Claude Code、Codex、Cursor などの AI コーディングエージェントです。プロジェクトフォルダを読み、コンパイラとアップローダーを実行し、シリアルポートを開いたままにします。何を変えるかを決めるのはあなたで、エージェントがそれを入力し、書き込み、戻ってきた内容を伝えます。

必要なもの
- XIAO Robot Kit 一式と、バッテリーコネクタ に接続された充電済みバッテリー — モーターは USB ポートが供給できる以上の電流を消費します
- Arduino IDE に esp32 core 3.x — Getting Started で手順を説明しています。もし見つからなくても問題ありません:その旨を伝えれば、エージェントがセットアップし、何かをインストールする前には必ず確認してきます
- サンプルコード: XIAO-Robot-Kit — 自分でクローンする必要はありません。以下の両方のプロンプトで、エージェントにリポジトリの有無を確認させ、なければクローンさせます
- AI コーディングツールを 1 つ、自分のアカウントでインストールしてサインインしておく — Claude Code や Codex のようなターミナルエージェント、またはファイルの横にチャットパネルを持つエディタ Cursor
選んだツールはベンダー自身のページからインストールしてください — 以下の内容は、ツールが動作してから始まります。リポジトリである必要はなく、書き込み権限のある任意のフォルダで起動してください。最初に test と送ってみてください:応答があればツールは動作しています。
すべての例は同じ車体で動作します。自分で 3D プリントしたい場合は、3D ファイルが Getting Started の Resources セクション内、Mechanical Design にあります。
例 1 と 2 では、エージェントにボードへの書き込みとシリアルポートの読み取りを任せます。代わりに手動で書き込みたい場合は、Getting Started にある Arduino IDE の手順に従ってください。
1. あなたのネットワークとボタン
例 1 は 1 つのプロンプトで 2 つの作業を行います。まずエージェントがあなたの Wi‑Fi 情報をサンプルに組み込み、書き込みを行い、ボードが出力したアドレスを読み取ります。次に hello world を出力するボタンを追加します。
最初の作業は 1 つのヘッダーファイル内の 2 つの文字列だけなので、独立したセクションにはせず、2 つ目の作業にまとめて行います。
プロンプト
バッテリーを接続し、USB ケーブルをつないでから、次を貼り付けてください:
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.
貼り付ける前に、2 つの値を自分のネットワーク用に置き換えてください。ボードが参加できるのは、名前とパスワードの両方がルーターと一致している場合だけです。
戻ってくるもの
- 変更されたファイルと行、そしてボードが参加後に出力したアドレス。
- 確認場所:その 2 つの値は
examples/xiao_robot_kit_web_remote/src/app/car_config.hの先頭にあるWIFI_SSIDとWIFI_PASSに入っており — それ以外は何も変わっていないはずです。 - アドレス は 1 つのネットワーク上の 1 枚のボードに固有なので、あなたの環境では異なりますし、ネットワークが変わればアドレスも変わります。
xiaorobot.localは mDNS 名です:まずはこちらを試し、ネットワーク側で解決できない場合は IP アドレスに切り替えてください。
ボードが参加できるのは 2.4 GHz のネットワークだけです。名前とパスワードが正しいのに接続できない場合、ルーターが 2 つのバンドに同じ名前を使っている可能性があります — 2.4 GHz バンドに専用の SSID を設定してください。

新しいボタンを自分で押すと、シリアルモニタに hello world が表示されます。コンパイルは通るのに何も表示されない場合は、シリアル出力をチャットに貼り付けてください。

実際に表示される画面は異なるかもしれません — ボタンがどこに配置されるかは、あなたのエージェントの判断次第なので、ここに示したものは 1 つの例として見てください。必ず満たすべきなのはメッセージの方です:ボタンを押すと、シリアルモニタに hello world が表示されることです。
2. 経路描画リモコン
例 1 では 2 行を変更し、ボタンを 1 つ追加しました。ここからは、もっと大きなもの — 描いた経路に沿って走る車 — を作ります。
あなたが仕様を説明し、エージェントがそれを構築して書き込み、自分の作業をテストしてから引き渡します — そのため、以下のプロンプトは少し長くなっています。プロンプトを書くのを省略しても構いません:アイデアをエージェントと会話しながら詰めていき、プロンプトの作成と実行を任せることもできます。
プロジェクトに必要なもの
- キャンバス — マウスまたは指で描画し、単位はセンチメートル、スケールには実際的な意味があること。
- デバッグビュー — ファームウェアのシリアル出力とプロトコルイベントを表示するログウィンドウ。
- ボタン類 — キャリブレーション、実行、非常停止(e-stop)、クリア、進捗表示。既存のリモコンも引き続き動作すること。
- 受け入れ基準 — 何をもって完了とみなすかを、コードを書く前に決めておくこと。
下の図はあくまでイメージです — 実際に得られるものは、あなたのプロンプトと使用する AI によって異なります。

プロンプト
このプロンプトには COM59 と HelloWorld が含まれています — 作成したマシンのポートとネットワーク名です。貼り付ける前に両方を変更し、パスワードは 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.
返ってくるもの
返ってきた使用ガイドを開き、そのページを開いて実際に試してみましょう。

うまく動かないとき
最初の実行ではバグが出ると思ってください。LLM が複雑なプロジェクトを一度で正しく仕上げることはほとんどありません。対話を続けて、何がうまくいかなかったかを伝え、難しいケースでは直近のログを貼り付けてください。
<the symptom, in one sentence — for example: the path turns left but the car turns right>
<the recent log output, pasted>
エージェント自身がテストとログ出力行を書いているので、自分の出力を読み取り、それを修正できます。プロンプト内の 5 つのブラックボックステストも、まず疑うべき対象です:描画、スケーリング、送信、非常停止(e-stop)、リンクロス。
よくある質問(FAQ)
Q1: 編集したと報告されるが、何も変わっていない
A: Arduino はビルドをキャッシュします。compile --clean を実行してから、もう一度アップロードしてください。
Q2: エージェントは書き込み完了と言うが、ページが開かない
A: 書き込みステップのシリアルログを読み、記憶しているアドレスではなく、そこで表示されたアドレスを使用してください。アドレスが表示されない場合、ボードはネットワークに参加できていません — 名前とパスワードを確認し、そのうえで上記の 2.4 GHz に関する注意を確認してください。
Q3: ボードが COM ポートとしてまったく認識されない
A: ブートローダーモードに戻してください:XIAO 上の BOOT を押しながら USB-C ケーブルを接続し、その後ボタンを離してから、再度フラッシュします。
技術サポート & 製品ディスカッション
弊社製品をお選びいただきありがとうございます。私たちは、製品をできるだけスムーズにご利用いただけるよう、さまざまなサポートを提供しています。お好みやニーズに合わせて選べる、複数のコミュニケーションチャネルをご用意しています。

