| Name | aitoolkit-esp32 JSON |
| Version |
1.0.0
JSON |
| download |
| home_page | https://github.com/dianx12/aitoolkit-esp32 |
| Summary | Arduino风格的ESP32控制库 - 通过串口控制ESP32,提供完整的Arduino API |
| upload_time | 2025-10-19 03:34:10 |
| maintainer | None |
| docs_url | None |
| author | Haitao Wang |
| requires_python | >=3.8 |
| license | MIT License
Copyright (c) 2025 aitoolkit_esp32 Contributors
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
|
| keywords |
esp32
arduino
serial
embedded
iot
gpio
hardware
|
| VCS |
 |
| bugtrack_url |
|
| requirements |
No requirements were recorded.
|
| Travis-CI |
No Travis.
|
| coveralls test coverage |
No coveralls.
|
# aitoolkit_esp32
**Arduino 风格的 ESP32 控制库** - 通过串口控制 ESP32,提供完整的 Arduino API
[](https://www.python.org/downloads/)
[](LICENSE)
## 特性
- ✅ **完整的 Arduino 风格 API** - pinMode, digitalWrite, analogRead 等熟悉的函数
- ✅ **简单易用** - 3 行代码即可开始
- ✅ **自动设备检测** - 自动查找并连接 ESP32
- ✅ **FastAPI 集成** - 提供 REST API 和 WebSocket 支持
- ✅ **Jupyter 友好** - 专为交互式编程设计
- ✅ **固件烧录工具** - 一键烧录 ESP32 固件
- ✅ **教学友好** - 与 Arduino 编程无缝衔接
## 安装
```bash
pip install aitoolkit-esp32
```
或者从源码安装:
```bash
cd aitoolkit_esp32
pip install -e .
```
## 快速开始
### 1. 基本使用 - LED 闪烁
```python
from aitoolkit_esp32 import Arduino
# 连接 ESP32
board = Arduino(port="/dev/ttyUSB0", baudrate=115200)
# Arduino 风格的 API
board.pinMode(13, board.OUTPUT)
while True:
board.digitalWrite(13, board.HIGH)
board.delay(1000)
board.digitalWrite(13, board.LOW)
board.delay(1000)
```
### 2. 自动检测设备
```python
from aitoolkit_esp32 import Arduino
# 自动查找 ESP32 设备
board = Arduino.auto()
board.pinMode(2, board.OUTPUT)
board.digitalWrite(2, board.HIGH)
```
### 3. 使用上下文管理器
```python
from aitoolkit_esp32 import Arduino
with Arduino(port="/dev/ttyUSB0") as board:
board.pinMode(13, board.OUTPUT)
board.digitalWrite(13, board.HIGH)
board.delay(1000)
board.digitalWrite(13, board.LOW)
```
### 4. 读取按钮和传感器
```python
from aitoolkit_esp32 import Arduino
board = Arduino.auto()
# 读取数字输入
board.pinMode(12, board.INPUT_PULLUP)
button_state = board.digitalRead(12)
print(f"Button: {button_state}")
# 读取模拟输入
board.pinMode(34, board.INPUT)
sensor_value = board.analogRead(34) # 0-4095
print(f"Sensor: {sensor_value}")
```
### 5. PWM 控制(LED 调光)
```python
from aitoolkit_esp32 import Arduino
board = Arduino.auto()
board.pinMode(25, board.OUTPUT)
# 逐渐变亮
for brightness in range(0, 256):
board.analogWrite(25, brightness)
board.delay(10)
# 逐渐变暗
for brightness in range(255, -1, -1):
board.analogWrite(25, brightness)
board.delay(10)
```
## 完整 API 参考
### Digital I/O
```python
# 设置引脚模式
board.pinMode(pin, mode) # mode: OUTPUT, INPUT, INPUT_PULLUP, INPUT_PULLDOWN
# 数字写入
board.digitalWrite(pin, value) # value: HIGH (1) or LOW (0)
# 数字读取
value = board.digitalRead(pin) # 返回 0 或 1
```
### Analog I/O
```python
# 模拟读取 (ADC)
value = board.analogRead(pin) # 返回 0-4095
# 模拟写入 (PWM)
board.analogWrite(pin, value) # value: 0-255
```
### 高级功能
```python
# 生成方波
board.tone(pin, frequency) # 在引脚上生成指定频率的方波
board.noTone(pin) # 停止方波
# 脉冲测量
duration = board.pulseIn(pin, value) # 测量脉冲宽度(微秒)
# 中断(回调在 Python 端执行)
def callback():
print("Interrupt triggered!")
board.attachInterrupt(pin, callback, mode) # mode: RISING, FALLING, CHANGE
board.detachInterrupt(pin)
```
### 时间函数
```python
# 延时
board.delay(ms) # 毫秒延时
board.delayMicroseconds(us) # 微秒延时
# 获取运行时间
ms = board.millis() # 返回启动后的毫秒数
```
### 串口通信
```python
# 配置 ESP32 的硬件串口
board.Serial.begin(baudrate)
# 发送数据
board.Serial.write(data)
board.Serial.println(text)
# 读取数据
data = board.Serial.read()
line = board.Serial.readLine()
```
## 固件烧录
### 自动烧录固件
```python
from aitoolkit_esp32 import flash_firmware
# 烧录标准固件
flash_firmware(port="/dev/ttyUSB0")
```
### 命令行烧录
```bash
python -m aitoolkit_esp32.firmware_flasher --port /dev/ttyUSB0
```
## FastAPI 集成
```python
from fastapi import FastAPI
from aitoolkit_esp32 import add_esp32_routes
app = FastAPI()
# 添加 ESP32 控制路由
add_esp32_routes(app, port="/dev/ttyUSB0", prefix="/esp32")
# 启动服务器
# uvicorn main:app --host 0.0.0.0 --port 8000
```
**可用的 API 端点:**
- `GET /esp32/status` - 获取设备状态
- `POST /esp32/digital/write` - 数字写入
- `GET /esp32/digital/read/{pin}` - 数字读取
- `GET /esp32/analog/read/{pin}` - 模拟读取
- `POST /esp32/pwm/write` - PWM 输出
- `WS /esp32/stream` - WebSocket 实时数据流
## 设备检测
```python
from aitoolkit_esp32 import list_esp32_devices, find_esp32_device
# 列出所有串口设备
devices = list_esp32_devices()
for device in devices:
print(f"{device['port']}: {device['description']}")
# 自动查找 ESP32 设备
port = find_esp32_device()
print(f"Found ESP32 at: {port}")
```
## 配置管理
```python
from aitoolkit_esp32 import get_config, set_config, save_config
# 获取配置
baudrate = get_config("serial.baudrate")
# 设置配置
set_config("serial.baudrate", 115200)
set_config("protocol.response_timeout", 2.0)
# 保存配置到文件
save_config() # 保存到 ~/.aitoolkit_esp32/config.json
```
## 示例项目
查看 `examples/` 目录获取更多示例:
- `blink.py` - LED 闪烁
- `button.py` - 按钮读取
- `pwm_led.py` - PWM 调光
- `sensor_reading.py` - 传感器读取
- `interrupt_demo.py` - 中断使用
- `web_control.py` - Web 控制界面
## 支持的 ESP32 开发板
- ESP32 DevKit
- ESP32-WROOM-32
- ESP32-WROVER
- ESP32-S2
- ESP32-S3
- ESP32-C3
## 常见问题
### 如何找到串口号?
**Linux/Mac:**
```bash
ls /dev/tty* | grep -i usb
# 通常是 /dev/ttyUSB0 或 /dev/ttyACM0
```
**Windows:**
- 打开设备管理器
- 查看"端口(COM和LPT)"
- 找到 "USB Serial Port (COMx)"
### 权限问题(Linux)
```bash
# 将用户添加到 dialout 组
sudo usermod -a -G dialout $USER
# 重新登录后生效
```
### 连接失败
1. 检查 USB 线是否支持数据传输(不是只充电线)
2. 确认驱动已安装(CP2102/CH340)
3. 检查端口号是否正确
4. 确认固件已烧录
## 通信协议
ESP32 固件使用简单的文本协议通过串口通信:
```
命令格式: <CMD><PIN><VALUE>\n
响应格式: <STATUS><DATA>\n
示例:
Python -> ESP32: "M13O\n" (pinMode 13, OUTPUT)
ESP32 -> Python: "OK\n"
Python -> ESP32: "W13H\n" (digitalWrite 13, HIGH)
ESP32 -> Python: "OK\n"
Python -> ESP32: "R12\n" (digitalRead 12)
ESP32 -> Python: "OK1\n" (返回值: 1)
```
详细协议文档见 [PROTOCOL.md](PROTOCOL.md)
## 开发
### 克隆仓库
```bash
git clone https://github.com/yourusername/aitoolkit-esp32.git
cd aitoolkit-esp32
```
### 安装开发依赖
```bash
pip install -e ".[dev,web,jupyter]"
```
### 运行测试
```bash
pytest tests/
```
### 构建固件
```bash
cd firmware/esp32_arduino
# 使用 Arduino IDE 或 PlatformIO 编译
```
## 贡献
欢迎提交 Issue 和 Pull Request!
## 许可证
MIT License - 详见 [LICENSE](LICENSE) 文件
## 致谢
- 灵感来源于 [pyfirmata](https://github.com/tino/pyFirmata) 和 [Arduino](https://www.arduino.cc/)
- 感谢所有贡献者
## 相关项目
- [aitoolkit_cam](https://github.com/dianx12/aitoolkit-cam) - 摄像头工具包
- [aitoolkit_base](https://github.com/dianx12/aitoolkit-base) - 基础工具包
---
**Made with ❤️ for makers, educators, and developers**
Raw data
{
"_id": null,
"home_page": "https://github.com/dianx12/aitoolkit-esp32",
"name": "aitoolkit-esp32",
"maintainer": null,
"docs_url": null,
"requires_python": ">=3.8",
"maintainer_email": null,
"keywords": "esp32, arduino, serial, embedded, iot, gpio, hardware",
"author": "Haitao Wang",
"author_email": "Haitao Wang <dianx12@163.com>",
"download_url": "https://files.pythonhosted.org/packages/71/f9/8b580d4f27464ecaee374c661afb6740f8edc2ad6801e7f22a33ad7b422d/aitoolkit_esp32-1.0.0.tar.gz",
"platform": null,
"description": "# aitoolkit_esp32\n\n**Arduino \u98ce\u683c\u7684 ESP32 \u63a7\u5236\u5e93** - \u901a\u8fc7\u4e32\u53e3\u63a7\u5236 ESP32\uff0c\u63d0\u4f9b\u5b8c\u6574\u7684 Arduino API\n\n[](https://www.python.org/downloads/)\n[](LICENSE)\n\n## \u7279\u6027\n\n- \u2705 **\u5b8c\u6574\u7684 Arduino \u98ce\u683c API** - pinMode, digitalWrite, analogRead \u7b49\u719f\u6089\u7684\u51fd\u6570\n- \u2705 **\u7b80\u5355\u6613\u7528** - 3 \u884c\u4ee3\u7801\u5373\u53ef\u5f00\u59cb\n- \u2705 **\u81ea\u52a8\u8bbe\u5907\u68c0\u6d4b** - \u81ea\u52a8\u67e5\u627e\u5e76\u8fde\u63a5 ESP32\n- \u2705 **FastAPI \u96c6\u6210** - \u63d0\u4f9b REST API \u548c WebSocket \u652f\u6301\n- \u2705 **Jupyter \u53cb\u597d** - \u4e13\u4e3a\u4ea4\u4e92\u5f0f\u7f16\u7a0b\u8bbe\u8ba1\n- \u2705 **\u56fa\u4ef6\u70e7\u5f55\u5de5\u5177** - \u4e00\u952e\u70e7\u5f55 ESP32 \u56fa\u4ef6\n- \u2705 **\u6559\u5b66\u53cb\u597d** - \u4e0e Arduino \u7f16\u7a0b\u65e0\u7f1d\u8854\u63a5\n\n## \u5b89\u88c5\n\n```bash\npip install aitoolkit-esp32\n```\n\n\u6216\u8005\u4ece\u6e90\u7801\u5b89\u88c5\uff1a\n\n```bash\ncd aitoolkit_esp32\npip install -e .\n```\n\n## \u5feb\u901f\u5f00\u59cb\n\n### 1. \u57fa\u672c\u4f7f\u7528 - LED \u95ea\u70c1\n\n```python\nfrom aitoolkit_esp32 import Arduino\n\n# \u8fde\u63a5 ESP32\nboard = Arduino(port=\"/dev/ttyUSB0\", baudrate=115200)\n\n# Arduino \u98ce\u683c\u7684 API\nboard.pinMode(13, board.OUTPUT)\n\nwhile True:\n board.digitalWrite(13, board.HIGH)\n board.delay(1000)\n board.digitalWrite(13, board.LOW)\n board.delay(1000)\n```\n\n### 2. \u81ea\u52a8\u68c0\u6d4b\u8bbe\u5907\n\n```python\nfrom aitoolkit_esp32 import Arduino\n\n# \u81ea\u52a8\u67e5\u627e ESP32 \u8bbe\u5907\nboard = Arduino.auto()\n\nboard.pinMode(2, board.OUTPUT)\nboard.digitalWrite(2, board.HIGH)\n```\n\n### 3. \u4f7f\u7528\u4e0a\u4e0b\u6587\u7ba1\u7406\u5668\n\n```python\nfrom aitoolkit_esp32 import Arduino\n\nwith Arduino(port=\"/dev/ttyUSB0\") as board:\n board.pinMode(13, board.OUTPUT)\n board.digitalWrite(13, board.HIGH)\n board.delay(1000)\n board.digitalWrite(13, board.LOW)\n```\n\n### 4. \u8bfb\u53d6\u6309\u94ae\u548c\u4f20\u611f\u5668\n\n```python\nfrom aitoolkit_esp32 import Arduino\n\nboard = Arduino.auto()\n\n# \u8bfb\u53d6\u6570\u5b57\u8f93\u5165\nboard.pinMode(12, board.INPUT_PULLUP)\nbutton_state = board.digitalRead(12)\nprint(f\"Button: {button_state}\")\n\n# \u8bfb\u53d6\u6a21\u62df\u8f93\u5165\nboard.pinMode(34, board.INPUT)\nsensor_value = board.analogRead(34) # 0-4095\nprint(f\"Sensor: {sensor_value}\")\n```\n\n### 5. PWM \u63a7\u5236\uff08LED \u8c03\u5149\uff09\n\n```python\nfrom aitoolkit_esp32 import Arduino\n\nboard = Arduino.auto()\n\nboard.pinMode(25, board.OUTPUT)\n\n# \u9010\u6e10\u53d8\u4eae\nfor brightness in range(0, 256):\n board.analogWrite(25, brightness)\n board.delay(10)\n\n# \u9010\u6e10\u53d8\u6697\nfor brightness in range(255, -1, -1):\n board.analogWrite(25, brightness)\n board.delay(10)\n```\n\n## \u5b8c\u6574 API \u53c2\u8003\n\n### Digital I/O\n\n```python\n# \u8bbe\u7f6e\u5f15\u811a\u6a21\u5f0f\nboard.pinMode(pin, mode) # mode: OUTPUT, INPUT, INPUT_PULLUP, INPUT_PULLDOWN\n\n# \u6570\u5b57\u5199\u5165\nboard.digitalWrite(pin, value) # value: HIGH (1) or LOW (0)\n\n# \u6570\u5b57\u8bfb\u53d6\nvalue = board.digitalRead(pin) # \u8fd4\u56de 0 \u6216 1\n```\n\n### Analog I/O\n\n```python\n# \u6a21\u62df\u8bfb\u53d6 (ADC)\nvalue = board.analogRead(pin) # \u8fd4\u56de 0-4095\n\n# \u6a21\u62df\u5199\u5165 (PWM)\nboard.analogWrite(pin, value) # value: 0-255\n```\n\n### \u9ad8\u7ea7\u529f\u80fd\n\n```python\n# \u751f\u6210\u65b9\u6ce2\nboard.tone(pin, frequency) # \u5728\u5f15\u811a\u4e0a\u751f\u6210\u6307\u5b9a\u9891\u7387\u7684\u65b9\u6ce2\nboard.noTone(pin) # \u505c\u6b62\u65b9\u6ce2\n\n# \u8109\u51b2\u6d4b\u91cf\nduration = board.pulseIn(pin, value) # \u6d4b\u91cf\u8109\u51b2\u5bbd\u5ea6\uff08\u5fae\u79d2\uff09\n\n# \u4e2d\u65ad\uff08\u56de\u8c03\u5728 Python \u7aef\u6267\u884c\uff09\ndef callback():\n print(\"Interrupt triggered!\")\n\nboard.attachInterrupt(pin, callback, mode) # mode: RISING, FALLING, CHANGE\nboard.detachInterrupt(pin)\n```\n\n### \u65f6\u95f4\u51fd\u6570\n\n```python\n# \u5ef6\u65f6\nboard.delay(ms) # \u6beb\u79d2\u5ef6\u65f6\nboard.delayMicroseconds(us) # \u5fae\u79d2\u5ef6\u65f6\n\n# \u83b7\u53d6\u8fd0\u884c\u65f6\u95f4\nms = board.millis() # \u8fd4\u56de\u542f\u52a8\u540e\u7684\u6beb\u79d2\u6570\n```\n\n### \u4e32\u53e3\u901a\u4fe1\n\n```python\n# \u914d\u7f6e ESP32 \u7684\u786c\u4ef6\u4e32\u53e3\nboard.Serial.begin(baudrate)\n\n# \u53d1\u9001\u6570\u636e\nboard.Serial.write(data)\nboard.Serial.println(text)\n\n# \u8bfb\u53d6\u6570\u636e\ndata = board.Serial.read()\nline = board.Serial.readLine()\n```\n\n## \u56fa\u4ef6\u70e7\u5f55\n\n### \u81ea\u52a8\u70e7\u5f55\u56fa\u4ef6\n\n```python\nfrom aitoolkit_esp32 import flash_firmware\n\n# \u70e7\u5f55\u6807\u51c6\u56fa\u4ef6\nflash_firmware(port=\"/dev/ttyUSB0\")\n```\n\n### \u547d\u4ee4\u884c\u70e7\u5f55\n\n```bash\npython -m aitoolkit_esp32.firmware_flasher --port /dev/ttyUSB0\n```\n\n## FastAPI \u96c6\u6210\n\n```python\nfrom fastapi import FastAPI\nfrom aitoolkit_esp32 import add_esp32_routes\n\napp = FastAPI()\n\n# \u6dfb\u52a0 ESP32 \u63a7\u5236\u8def\u7531\nadd_esp32_routes(app, port=\"/dev/ttyUSB0\", prefix=\"/esp32\")\n\n# \u542f\u52a8\u670d\u52a1\u5668\n# uvicorn main:app --host 0.0.0.0 --port 8000\n```\n\n**\u53ef\u7528\u7684 API \u7aef\u70b9\uff1a**\n\n- `GET /esp32/status` - \u83b7\u53d6\u8bbe\u5907\u72b6\u6001\n- `POST /esp32/digital/write` - \u6570\u5b57\u5199\u5165\n- `GET /esp32/digital/read/{pin}` - \u6570\u5b57\u8bfb\u53d6\n- `GET /esp32/analog/read/{pin}` - \u6a21\u62df\u8bfb\u53d6\n- `POST /esp32/pwm/write` - PWM \u8f93\u51fa\n- `WS /esp32/stream` - WebSocket \u5b9e\u65f6\u6570\u636e\u6d41\n\n## \u8bbe\u5907\u68c0\u6d4b\n\n```python\nfrom aitoolkit_esp32 import list_esp32_devices, find_esp32_device\n\n# \u5217\u51fa\u6240\u6709\u4e32\u53e3\u8bbe\u5907\ndevices = list_esp32_devices()\nfor device in devices:\n print(f\"{device['port']}: {device['description']}\")\n\n# \u81ea\u52a8\u67e5\u627e ESP32 \u8bbe\u5907\nport = find_esp32_device()\nprint(f\"Found ESP32 at: {port}\")\n```\n\n## \u914d\u7f6e\u7ba1\u7406\n\n```python\nfrom aitoolkit_esp32 import get_config, set_config, save_config\n\n# \u83b7\u53d6\u914d\u7f6e\nbaudrate = get_config(\"serial.baudrate\")\n\n# \u8bbe\u7f6e\u914d\u7f6e\nset_config(\"serial.baudrate\", 115200)\nset_config(\"protocol.response_timeout\", 2.0)\n\n# \u4fdd\u5b58\u914d\u7f6e\u5230\u6587\u4ef6\nsave_config() # \u4fdd\u5b58\u5230 ~/.aitoolkit_esp32/config.json\n```\n\n## \u793a\u4f8b\u9879\u76ee\n\n\u67e5\u770b `examples/` \u76ee\u5f55\u83b7\u53d6\u66f4\u591a\u793a\u4f8b\uff1a\n\n- `blink.py` - LED \u95ea\u70c1\n- `button.py` - \u6309\u94ae\u8bfb\u53d6\n- `pwm_led.py` - PWM \u8c03\u5149\n- `sensor_reading.py` - \u4f20\u611f\u5668\u8bfb\u53d6\n- `interrupt_demo.py` - \u4e2d\u65ad\u4f7f\u7528\n- `web_control.py` - Web \u63a7\u5236\u754c\u9762\n\n## \u652f\u6301\u7684 ESP32 \u5f00\u53d1\u677f\n\n- ESP32 DevKit\n- ESP32-WROOM-32\n- ESP32-WROVER\n- ESP32-S2\n- ESP32-S3\n- ESP32-C3\n\n## \u5e38\u89c1\u95ee\u9898\n\n### \u5982\u4f55\u627e\u5230\u4e32\u53e3\u53f7\uff1f\n\n**Linux/Mac:**\n```bash\nls /dev/tty* | grep -i usb\n# \u901a\u5e38\u662f /dev/ttyUSB0 \u6216 /dev/ttyACM0\n```\n\n**Windows:**\n- \u6253\u5f00\u8bbe\u5907\u7ba1\u7406\u5668\n- \u67e5\u770b\"\u7aef\u53e3(COM\u548cLPT)\"\n- \u627e\u5230 \"USB Serial Port (COMx)\"\n\n### \u6743\u9650\u95ee\u9898\uff08Linux\uff09\n\n```bash\n# \u5c06\u7528\u6237\u6dfb\u52a0\u5230 dialout \u7ec4\nsudo usermod -a -G dialout $USER\n\n# \u91cd\u65b0\u767b\u5f55\u540e\u751f\u6548\n```\n\n### \u8fde\u63a5\u5931\u8d25\n\n1. \u68c0\u67e5 USB \u7ebf\u662f\u5426\u652f\u6301\u6570\u636e\u4f20\u8f93\uff08\u4e0d\u662f\u53ea\u5145\u7535\u7ebf\uff09\n2. \u786e\u8ba4\u9a71\u52a8\u5df2\u5b89\u88c5\uff08CP2102/CH340\uff09\n3. \u68c0\u67e5\u7aef\u53e3\u53f7\u662f\u5426\u6b63\u786e\n4. \u786e\u8ba4\u56fa\u4ef6\u5df2\u70e7\u5f55\n\n## \u901a\u4fe1\u534f\u8bae\n\nESP32 \u56fa\u4ef6\u4f7f\u7528\u7b80\u5355\u7684\u6587\u672c\u534f\u8bae\u901a\u8fc7\u4e32\u53e3\u901a\u4fe1\uff1a\n\n```\n\u547d\u4ee4\u683c\u5f0f: <CMD><PIN><VALUE>\\n\n\u54cd\u5e94\u683c\u5f0f: <STATUS><DATA>\\n\n\n\u793a\u4f8b:\nPython -> ESP32: \"M13O\\n\" (pinMode 13, OUTPUT)\nESP32 -> Python: \"OK\\n\"\n\nPython -> ESP32: \"W13H\\n\" (digitalWrite 13, HIGH)\nESP32 -> Python: \"OK\\n\"\n\nPython -> ESP32: \"R12\\n\" (digitalRead 12)\nESP32 -> Python: \"OK1\\n\" (\u8fd4\u56de\u503c: 1)\n```\n\n\u8be6\u7ec6\u534f\u8bae\u6587\u6863\u89c1 [PROTOCOL.md](PROTOCOL.md)\n\n## \u5f00\u53d1\n\n### \u514b\u9686\u4ed3\u5e93\n\n```bash\ngit clone https://github.com/yourusername/aitoolkit-esp32.git\ncd aitoolkit-esp32\n```\n\n### \u5b89\u88c5\u5f00\u53d1\u4f9d\u8d56\n\n```bash\npip install -e \".[dev,web,jupyter]\"\n```\n\n### \u8fd0\u884c\u6d4b\u8bd5\n\n```bash\npytest tests/\n```\n\n### \u6784\u5efa\u56fa\u4ef6\n\n```bash\ncd firmware/esp32_arduino\n# \u4f7f\u7528 Arduino IDE \u6216 PlatformIO \u7f16\u8bd1\n```\n\n## \u8d21\u732e\n\n\u6b22\u8fce\u63d0\u4ea4 Issue \u548c Pull Request\uff01\n\n## \u8bb8\u53ef\u8bc1\n\nMIT License - \u8be6\u89c1 [LICENSE](LICENSE) \u6587\u4ef6\n\n## \u81f4\u8c22\n\n- \u7075\u611f\u6765\u6e90\u4e8e [pyfirmata](https://github.com/tino/pyFirmata) \u548c [Arduino](https://www.arduino.cc/)\n- \u611f\u8c22\u6240\u6709\u8d21\u732e\u8005\n\n## \u76f8\u5173\u9879\u76ee\n\n- [aitoolkit_cam](https://github.com/dianx12/aitoolkit-cam) - \u6444\u50cf\u5934\u5de5\u5177\u5305\n- [aitoolkit_base](https://github.com/dianx12/aitoolkit-base) - \u57fa\u7840\u5de5\u5177\u5305\n\n---\n\n**Made with \u2764\ufe0f for makers, educators, and developers**\n",
"bugtrack_url": null,
"license": "MIT License\n \n Copyright (c) 2025 aitoolkit_esp32 Contributors\n \n Permission is hereby granted, free of charge, to any person obtaining a copy\n of this software and associated documentation files (the \"Software\"), to deal\n in the Software without restriction, including without limitation the rights\n to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n copies of the Software, and to permit persons to whom the Software is\n furnished to do so, subject to the following conditions:\n \n The above copyright notice and this permission notice shall be included in all\n copies or substantial portions of the Software.\n \n THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\n SOFTWARE.\n ",
"summary": "Arduino\u98ce\u683c\u7684ESP32\u63a7\u5236\u5e93 - \u901a\u8fc7\u4e32\u53e3\u63a7\u5236ESP32\uff0c\u63d0\u4f9b\u5b8c\u6574\u7684Arduino API",
"version": "1.0.0",
"project_urls": {
"Bug Reports": "https://github.com/dianx12/aitoolkit-esp32/issues",
"Documentation": "https://github.com/dianx12/aitoolkit-esp32/blob/main/README.md",
"Homepage": "https://github.com/dianx12/aitoolkit-esp32",
"Repository": "https://github.com/dianx12/aitoolkit-esp32"
},
"split_keywords": [
"esp32",
" arduino",
" serial",
" embedded",
" iot",
" gpio",
" hardware"
],
"urls": [
{
"comment_text": null,
"digests": {
"blake2b_256": "9d6217fb11d4f39d992ec58e37e100748d1b49fc366027ba3673c4828dadf836",
"md5": "28aa20b8aad1ce4e9ba7977d50e07950",
"sha256": "734a14f1c08eaae90c019e0469c0543b6db71c1cd47d7d578fde4c8b8589b1e2"
},
"downloads": -1,
"filename": "aitoolkit_esp32-1.0.0-py3-none-any.whl",
"has_sig": false,
"md5_digest": "28aa20b8aad1ce4e9ba7977d50e07950",
"packagetype": "bdist_wheel",
"python_version": "py3",
"requires_python": ">=3.8",
"size": 27419,
"upload_time": "2025-10-19T03:34:08",
"upload_time_iso_8601": "2025-10-19T03:34:08.343915Z",
"url": "https://files.pythonhosted.org/packages/9d/62/17fb11d4f39d992ec58e37e100748d1b49fc366027ba3673c4828dadf836/aitoolkit_esp32-1.0.0-py3-none-any.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": null,
"digests": {
"blake2b_256": "71f98b580d4f27464ecaee374c661afb6740f8edc2ad6801e7f22a33ad7b422d",
"md5": "8a7fee73f1fb9f8909d678065a5f9182",
"sha256": "2292115810275743cbbd77f65fe1de4d0cfd992ed252b06866da30bac609c360"
},
"downloads": -1,
"filename": "aitoolkit_esp32-1.0.0.tar.gz",
"has_sig": false,
"md5_digest": "8a7fee73f1fb9f8909d678065a5f9182",
"packagetype": "sdist",
"python_version": "source",
"requires_python": ">=3.8",
"size": 35329,
"upload_time": "2025-10-19T03:34:10",
"upload_time_iso_8601": "2025-10-19T03:34:10.219561Z",
"url": "https://files.pythonhosted.org/packages/71/f9/8b580d4f27464ecaee374c661afb6740f8edc2ad6801e7f22a33ad7b422d/aitoolkit_esp32-1.0.0.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2025-10-19 03:34:10",
"github": true,
"gitlab": false,
"bitbucket": false,
"codeberg": false,
"github_user": "dianx12",
"github_project": "aitoolkit-esp32",
"github_not_found": true,
"lcname": "aitoolkit-esp32"
}