Unihiker expansion motor control

From espressif/esp-claw-skills-lab · View interactive version

Unihiker expansion motor control is an AI agent skill from the GitHub repository espressif/esp-claw-skills-lab. Use this skill to control motors on a DFRobot UNIHIKER Expansion board (SKU: DFR1216). Chinese name is 行空板扩展板.

How to use this skill

Skill file

UNIHIKER Expansion Motor Control

Use this skill to control motors on a DFRobot UNIHIKER Expansion board (SKU: DFR1216). Chinese name is 行空板扩展板.

Run exactly one script with lua_run_script.

If lua_run_script returns an error, report that error directly to the user.

Do not retry with changed arguments in the same turn unless the user explicitly asks.

Tool Call Inputs

Stop all motors:

{"path":"{CUR_SKILL_DIR}/scripts/set_motor.lua","args":{"stop_all":true}}

Drive motor1 forward:

{"path":"{CUR_SKILL_DIR}/scripts/set_motor.lua","args":{"period_12":255,"duty":{"m1_a":255,"m1_b":0}}}

Drive motor1 reverse:

{"path":"{CUR_SKILL_DIR}/scripts/set_motor.lua","args":{"period_12":255,"duty":{"m1_a":0,"m1_b":255}}}

Drive four motors with mixed duty values:

{"path":"{CUR_SKILL_DIR}/scripts/set_motor.lua","args":{"period_12":255,"period_34":255,"duty":{"m1_a":255,"m1_b":0,"m2_a":0,"m2_b":255,"m3_a":50,"m3_b":0,"m4_a":0,"m4_b":50}}}

Drive motor1 forward for 2 seconds, then auto stop:

{"path":"{CUR_SKILL_DIR}/scripts/set_motor.lua","args":{"period_12":255,"auto_stop_ms":2000,"duty":{"m1_a":255,"m1_b":0}}}

Notes:

Recommended Flow

  1. Confirm the expansion board is connected to an available I2C bus.
  2. Use the script defaults unless the user explicitly provides custom I2C settings.
  3. Run {CUR_SKILL_DIR}/scripts/set_motor.lua with desired period_12, period_34, and duty.
  4. If immediate emergency stop is needed, run the script with stop_all: true.
  5. Report script output directly to the user, including any error.
Use this skill with your AI agent: Open on Skill Issue to copy, download, or add to your library. Works with Claude, ChatGPT, Gemini, Cursor, Windsurf and more.