ble
免费Bluetooth context for the Megahub project. Use when working on BLE GATT server, Classic Bluetooth HID host, Web Bluetooth API integration, btremote library, connection handling, or any Bluetooth-related firmware code.
中文简介正在准备中。当前显示原文说明。
Documentation structure and maintenance rules for the Megahub project. Use whenever making user-facing changes — adding features, changing behavior, fixing hardware compatibility, or modifying configuration. Describes which files to update, the README structure, and writing style.
中文简介正在准备中。当前显示原文说明。
查看安装方法安装前可以查看交给 AI 代理的指令内容。
| File | Audience | Maintained by | Update trigger |
|---|---|---|---|
README.md | End users — builders, makers, beginners | AI (on every user-facing change) | Any change to features, hardware support, configuration, or user workflow |
BLOCKS.md | End users — visual programmers | Auto-generated (npm run generate-docs in frontend/) | Any Blockly block added, removed, or modified |
HUBAPI.md | Developers using WiFi/REST mode | Human or AI | Any REST endpoint added or changed in lib/hubwebserver/ |
LUMP.md | Protocol implementers | Human | LEGO UART protocol changes only |
CLAUDE.md | AI assistant | Human | Architecture changes, new conventions |
Never edit BLOCKS.md manually — it is fully auto-generated and will be overwritten.
The README is the primary user document. It must always contain these sections in this order:
1. Introduction (project overview, 2–3 sentences)
2. Key Features (bullet list — what the device can do)
3. Screenshots (visual overview — keep current)
4. Hardware Photos
5. Getting Started
5a. Prerequisites
5b. Building the Firmware
5c. Flashing the Board
5d. First Boot and Connection
6. Hardware Reference
6a. LEGO Device Ports (ports 0–3, connector type, LUMP protocol)
6b. GPIO Pins (FastLED pin options, SD card pins, I2C)
6c. Supported LEGO Devices
7. Using the IDE
7a. Connecting (BT mode — Web Bluetooth, supported browsers)
7b. Creating a Project
7c. Programming with Blockly
7d. Running and Stopping Programs
7e. Autostart
8. WiFi Mode
8a. Switching from BT to WiFi
8b. config.json format
8c. Accessing the Web UI
9. Gamepad Support
9a. Pairing a gamepad
9b. Supported gamepads (8BitDo M30 tested)
9c. Blockly blocks available
10. Hardware Features
10a. LEGO Powered Up support
10b. FastLED/NeoPixel addressable LEDs
10c. IMU (MPU6050) — yaw/pitch/roll, acceleration
10d. SD Card storage
11. Troubleshooting
11a. Bluetooth not connecting
11b. Device not found
11c. LEGO device not responding
11d. Serial monitor for debugging
12. Documentation (links to BLOCKS.md, HUBAPI.md, LUMP.md)
13. License / Contributing (if applicable)
Audience: Makers and robotics enthusiasts. Assume they know hardware basics but not necessarily ESP32 or Bluetooth internals.
lua_pcall(). Focus on what they can do, not how it works inside.LEGO ports: 4 ports (0–3), via SC16IS752 I2C-to-UART bridge. LEGO Powered Up UART protocol. Motor speed: -127 to +127.
FastLED GPIO options: 13, 16, 17, 25, 26, 27, 32, 33 (NeoPixel/WS2812B compatible)
SD card SPI pins: CLK=18, MOSI=23, MISO=19, CS=4
IMU outputs: YAW, PITCH, ROLL (degrees), ACCELERATION_X/Y/Z (m/s²). Update rate: 100ms.
Gamepad: Bluetooth Classic HID. 16 buttons, D-pad, 2 analog sticks (left/right X/Y, range -32768..32767). Tested: 8BitDo M30.
/config.json on SD card){
"bluetoothEnabled": true,
"wifiEnabled": false,
"ssid": "YourNetwork",
"pwd": "YourPassword"
}
WiFi web server runs on port 80. Default: BT mode.
/autostart.json on SD card){ "project": "your-project-id" }
Set via the IDE (project list → autostart toggle). Persists across reboots.
Chrome, Edge, Opera — desktop only. Firefox and Safari are not supported.
When making any code change, check:
npm run generate-docs in frontend/ to regenerate BLOCKS.md. Do not manually edit BLOCKS.md.HUBAPI.md with the endpoint signature, request/response format, and example.HUBAPI.md if it's exposed via API.When updating README:
还没有评价。欢迎分享你的使用感受。
无需登录即可发表。欢迎分享使用感受、提问,或说明在哪些环境下无法运行。
还没有评论。来写第一条吧。
Bluetooth context for the Megahub project. Use when working on BLE GATT server, Classic Bluetooth HID host, Web Bluetooth API integration, btremote library, connection handling, or any Bluetooth-related firmware code.
中文简介正在准备中。当前显示原文说明。
Blockly visual programming context for the Megahub project. Use when adding, modifying, or debugging custom Blockly blocks, the Lua code generator, the toolbox, block colors, or the BLOCKS.md documentation generation script.
中文简介正在准备中。当前显示原文说明。
Core firmware context for the Megahub ESP32 project. Use when working on PlatformIO configuration, build scripts, library structure, main.cpp, or general ESP32 firmware development. Covers build system, project structure, common pitfalls, and debugging.
中文简介正在准备中。当前显示原文说明。
Frontend development context for the Megahub project. Use when working on the web-based IDE, Vite build system, Blockly visual programming, Web Bluetooth API integration, JavaScript frontend code, CSS/styles, UI components, or anything in the /frontend/ directory.
中文简介正在准备中。当前显示原文说明。
LEGO Powered Up protocol context for the Megahub project. Use when working on LEGO device communication, lpfuart library, UART parsing, motor control, sensor modes, device initialization, or debugging UART noise/corruption issues.
中文简介正在准备中。当前显示原文说明。
Code formatting and linting context for the Megahub project. Use when writing or reviewing code in C++ or JavaScript, or when running format/lint checks. Describes tool commands, style conventions, and when to apply them.
中文简介正在准备中。当前显示原文说明。