跳到正文
Skillpedia
部署与云(DevOps)30k · #9356

hardware

它能做什么

这项技能让你的智能体与接在 Sipeed 开发板上的传感器、显示屏和其他硬件通信。内容包括扫描设备、读取数值,以及通过 I2C 和 SPI 发送命令。

适用场景

  • ✓当你想读取 Sipeed 开发板上的温度或湿度传感器时。
  • ✓当你想扫描开发板的 I2C 或 SPI 总线上连接了哪些设备时。
  • ✓当你想控制连接在开发板上的显示屏或其他外设时。

技能链接

https://github.com/sipeed/picoclaw/blob/main/workspace/skills/hardware/SKILL.md

复制后粘贴给你的 AI(Claude、ChatGPT 或 Cursor),让它按照说明操作。

使用方法

最简单的方法:复制下面的消息,粘贴给你的 AI。它会读取这个技能并按说明操作。

可直接粘贴的消息

请用这个技能帮我:https://github.com/sipeed/picoclaw/blob/main/workspace/skills/hardware/SKILL.md 阅读该链接中的 SKILL.md 文件,并在我的任务中按照它的说明来做。
想让你的 AI 自己找到这样的技能吗?安装免费的 Skillpedia MCP:只需一行,每次任务前它都会在 15,000+ 个技能中搜索。1 分钟完成安装 →

可以这样问 AI

“请扫描我的 LicheeRV 开发板上的 I2C 总线,并读取所连接传感器的温度。”

每周 5 个新技能,1 分钟读完。

工作原理

智能体会列出可用的总线,扫描已连接的设备,并从你指定的传感器中读取寄存器。写入操作需要先获得你的确认,地址和传输大小也会按照限制进行检查。

技术内容(原始 SKILL.md)

作者在 GitHub 上的英文原文。

Hardware (I2C / SPI)

Use the i2c and spi tools to interact with sensors, displays, and other peripherals connected to the board.

Quick Start

# 1. Find available buses
i2c detect

# 2. Scan for connected devices
i2c scan  (bus: "1")

# 3. Read from a sensor (e.g. AHT20 temperature/humidity)
i2c read  (bus: "1", address: 0x38, register: 0xAC, length: 6)

# 4. SPI devices
spi list
spi read  (device: "2.0", length: 4)

Before You Start — Pinmux Setup

Most I2C/SPI pins are shared with WiFi on Sipeed boards. You must configure pinmux before use.

See references/board-pinout.md for board-specific commands.

Common steps:

  1. Stop WiFi if using shared pins: /etc/init.d/S30wifi stop
  2. Load i2c-dev module: modprobe i2c-dev
  3. Configure pinmux with devmem (board-specific)
  4. Verify with i2c detect and i2c scan

Safety

  • Write operations require confirm: true — always confirm with the user first
  • I2C addresses are validated to 7-bit range (0x03-0x77)
  • SPI modes are validated (0-3 only)
  • Maximum per-transaction: 256 bytes (I2C), 4096 bytes (SPI)

Common Devices

See references/common-devices.md for register maps and usage of popular sensors: AHT20, BME280, SSD1306 OLED, MPU6050 IMU, DS3231 RTC, INA219 power monitor, PCA9685 PWM, and more.

Troubleshooting

Problem Solution
No I2C buses found modprobe i2c-dev and check device tree
Permission denied Run as root or add user to i2c group
No devices on scan Check wiring, pull-up resistors (4.7k typical), and pinmux
Bus number changed I2C adapter numbers can shift between boots; use i2c detect to find current assignment
WiFi stopped working I2C-1/SPI-2 share pins with WiFi SDIO; can't use both simultaneously
devmem not found Download separately or use busybox devmem
SPI transfer returns all zeros Check MISO wiring and device power
SPI transfer returns all 0xFF Device not responding; check CS pin and clock polarity (mode)
常见问题

它会不经询问就更改设备设置吗?

不会。任何写入操作都需要你先明确确认。

我需要先设置引脚吗?

通常需要。很多引脚与 WiFi 共用,因此技能包含了使用前配置这些引脚的步骤。

它支持哪些开发板?

它是为 Sipeed 开发板编写的,例如 LicheeRV Nano、MaixCAM 和 NanoKVM。

详情

作者的原始描述

Read and control I2C and SPI peripherals on Sipeed boards (LicheeRV Nano, MaixCAM, NanoKVM).

repo: sipeed/picoclaw

热度

GitHub 星标
30k
排名
#9356
许可证
MIT
更新时间
2026/10/30

这个技能有用吗?

0

登录 后即可投票。

评论

  • …

同一仓库的更多技能

相似技能