read_touch
GitHub用于读取电容式触摸传感器平滑值的技能。通过运行 Lua 脚本获取指定 GPIO 的触摸数据,使用前需验证硬件信息,确保引脚可用且未被占用。
Trigger Scenarios
Install
npx skills add espressif/esp-claw --skill read_touch -g -y
SKILL.md
Frontmatter
{
"name": "read_touch",
"metadata": {
"cap_groups": [
"cap_lua"
],
"manage_mode": "readonly"
},
"description": "Read smoothed capacitive touch sensor values from one or more input GPIO channels. Use when the user asks for touch smooth values, capacitive touch channel readings, or smoothed touch data. Requires explicit gpios and board_hardware_info before assigning GPIOs."
}
Read Touch
Use this skill only to read smooth values from capacitive touch input channels.
Run exactly one script with lua_run_script.
Read board_hardware_info before assigning GPIOs. Verify the requested GPIOs are touch-capable for the target chip and are not occupied by unrelated board hardware.
If lua_run_script returns an error, report that error directly to the user. Do not retry with changed GPIOs unless the user explicitly asks.
Script Args Schema
{
"type": "object",
"required": ["gpios"],
"properties": {
"gpios": {
"type": "array",
"items": {
"type": "integer",
"minimum": 0
},
"minItems": 1,
"description": "Touch-capable GPIO numbers to sample."
},
"samples": {
"type": "integer",
"default": 10,
"minimum": 1,
"maximum": 100
},
"interval_ms": {
"type": "integer",
"default": 200,
"minimum": 0,
"maximum": 10000
}
}
}
Tool Call Inputs
Read one sample from several touch GPIOs:
{"path":"{CUR_SKILL_DIR}/scripts/read_touch.lua","args":{"gpios":[2,3,4],"samples":1}}
Read repeated smooth values:
{"path":"{CUR_SKILL_DIR}/scripts/read_touch.lua","args":{"gpios":[2,3,4,5],"samples":20,"interval_ms":300}}
Recommended Flow
- Activate
board_hardware_infobefore operating touch hardware. - Use only explicit
gpiosfrom the user or from verified board hardware information. - Run
{CUR_SKILL_DIR}/scripts/read_touch.luawithgpios,samples, andinterval_ms. - Report the returned
smoothvalues by sample, GPIO, and touch channel.
Output Meaning
smooth: smoothed touch sensor data fromTOUCH_CHAN_DATA_TYPE_SMOOTH.gpio: input GPIO sampled by the touch driver.channel: touch sensor channel mapped from the GPIO.
Version History
- 06eb576 Current 2026-07-24 19:54


