From cf9a1c11ae648a5b6b950d618c62c98c8d55dd16 Mon Sep 17 00:00:00 2001 From: Asklv Date: Sat, 7 Mar 2026 16:15:41 +0800 Subject: [PATCH] feat: add built-in gpio-control skill for switch confirmation --- spiffs_data/skills/gpio-control.md | 37 ++++++++++++++++++++++++++++++ 1 file changed, 37 insertions(+) create mode 100644 spiffs_data/skills/gpio-control.md diff --git a/spiffs_data/skills/gpio-control.md b/spiffs_data/skills/gpio-control.md new file mode 100644 index 0000000..9b29336 --- /dev/null +++ b/spiffs_data/skills/gpio-control.md @@ -0,0 +1,37 @@ +# GPIO Control + +Control and monitor GPIO pins on the ESP32-S3 for digital I/O. + +## When to use +When the user asks to: +- Turn on/off LEDs, relays, or other outputs +- Check switch states, button presses, or sensor readings +- Confirm digital I/O status (switch confirmation) +- Get an overview of all GPIO pin states + +## How to use +1. To **read a switch/sensor**: use gpio_read with the pin number + - Returns HIGH (1) or LOW (0) + - HIGH typically means switch is ON / circuit closed + - LOW typically means switch is OFF / circuit open +2. To **set an output**: use gpio_write with pin and state (1=HIGH, 0=LOW) +3. To **scan all pins**: use gpio_read_all for a full status overview +4. For **switch confirmation**: read the pin, report state, optionally toggle and re-read to verify + +## Pin safety +- Only pins within the allowed range can be accessed +- ESP32 flash pins (6-11) are always blocked +- If a pin is rejected, suggest an alternative within the allowed range + +## Example +User: "Check if the switch on pin 4 is on" +→ gpio_read {"pin": 4} +→ "Pin 4 = HIGH" +→ "The switch on pin 4 is currently ON (HIGH)." + +User: "Turn on the relay on pin 5" +→ gpio_write {"pin": 5, "state": 1} +→ "Pin 5 set to HIGH" +→ gpio_read {"pin": 5} +→ "Pin 5 = HIGH" +→ "Relay on pin 5 is now ON. Confirmed HIGH."