gitmyhub

antigravity-task-led

TypeScript ★ 22 updated 25d ago

**Antigravity Task LED** 是一套极客专属的桌面物理联动系统。它能够实时捕捉 Antigravity IDE(或者 VS Code)中 AI 助手的生成状态,通过轻量级 HTTP API 推送到巴法云物联网平台,进而通过 MQTT 协议广播给摆在您桌面上的 **ESP8266 物理主控芯片**,实时驱动红色与绿色 LED 切换 19 种极其炫酷的非阻塞创意灯语。

An IoT project that connects an AI coding assistant in your editor to two physical LEDs on your desk, showing 19 lighting patterns for generating, success, and error states via ESP8266 and a cloud MQTT relay.

TypeScriptArduinoC++ESP8266MQTTsetup: hardcomplexity 3/5

Antigravity Task LED is an IoT project that turns the activity state of an AI coding assistant into physical light signals on your desk. When the AI in Antigravity IDE or VS Code is generating code, finishes successfully, or hits an error, a small circuit with two LEDs, one red and one green, reacts with different lighting patterns in real time.

The system works in three stages. An editor plugin monitors the AI's current state. When the state changes, it sends a lightweight HTTP request to a Chinese cloud IoT platform called Bemfa. Bemfa forwards the message over MQTT to an ESP8266 microcontroller, which is a small, inexpensive WiFi-capable chip that drives the two LEDs directly.

The project includes 19 different LED patterns, each with its own character. A few examples: alternating breathing, where the two LEDs fade in and out opposite each other; a Tai-Chi S-curve pattern using a third-power sine wave for an unusually smooth crossfade; an ECG simulation that mirrors the shape of a real electrocardiogram; an SOS Morse code sequence; and a radar scan pattern where a slow green sweep transitions into a rapid red lock signal. All patterns are implemented without blocking delays, using a milliseconds-based state machine so the microcontroller stays responsive to new MQTT messages at all times.

The hardware requires an ESP8266 development board (such as a NodeMCU), two LEDs with 220-ohm resistors, and a Bemfa account for the cloud relay. Credentials are stored in a separate secrets file excluded from the repository. Setup involves flashing the Arduino firmware to the board, then installing the editor plugin as a .vsix package in your IDE.

The project includes complete source code for both the Arduino firmware (580 lines) and the TypeScript editor extension. The README is written in both Chinese and English.

Where it fits