Skip to main content

LED

The LED API enables real-time control of the RGB LEDs located at the back of the displays, providing visual notifications and status indicators within the costume. This API supports priority-based control and color management for both left and right LEDs.

Brightness Configuration

You can change LED brightness by following this guide.


Protocol Buffer Definition

syntax = "proto3";
import "google/protobuf/empty.proto";

service LedService {
// Streams LED color settings with priority control
rpc StreamLedSettings (stream LedSettings) returns (google.protobuf.Empty);
}

// LED color and priority configuration
message LedSettings {
Color left_led = 1; // Left LED color (RGB)
Color right_led = 2; // Right LED color (RGB)
int32 priority_level = 3; // Control priority (0-100)
optional bool is_active = 4; // Active control when true, and release control when false
}

// RGB color definition (0-255)
message Color {
int32 r = 1; // Red component (0-255)
int32 g = 2; // Green component (0-255)
int32 b = 3; // Blue component (0-255)
}

Priority System

The LED API uses a priority-based control system to manage access between multiple features:

Priority LevelDescription
0-20Low priority (background effects)
21-50Medium priority (notifications)
51-80High priority (critical alerts)
81-100System priority (reserved)

Priority Rules:

  1. Higher priority values override lower ones
  2. Equal priority: Last received settings apply
  3. Always release control when done (is_active = false)
  4. If your feature stops/crash, control will be automatically released