-
Notifications
You must be signed in to change notification settings - Fork 8
Status LED
Hrisabh Yadav edited this page Nov 14, 2025
·
1 revision
Status LED control interface for system indication and feedback.
typedef enum {
GREEN, // Green LED
BLUE, // Blue LED
RED, // Red LED
STATUS // Status LED
} led_status_e;typedef enum {
OFF = 0, // LED off
ON, // LED on
TOGGLE // Toggle LED state
} led_state_e;-
bool LedStatusState- Current status LED state
Controls the state of status LEDs.
Parameters:
-
_led_status- LED to control (GREEN, BLUE, RED, STATUS) -
_state- State to set (ON, OFF, TOGGLE)
// Basic LED control
Set_LED(GREEN, ON); // Turn green LED on
Set_LED(RED, OFF); // Turn red LED off
Set_LED(BLUE, TOGGLE); // Toggle blue LED
Set_LED(STATUS, ON); // Turn status LED on
// System status indication
void indicateSystemStatus() {
if (FlightStatus_Check(FS_ARMED)) {
Set_LED(BLUE, ON); // Armed - blue LED
Set_LED(GREEN, OFF);
} else {
Set_LED(GREEN, ON); // Disarmed - green LED
Set_LED(BLUE, OFF);
}
// Battery warning
uint16_t battery = Bms_Get(Voltage);
if (battery < 3300) {
Set_LED(RED, TOGGLE); // Low battery - blinking red
} else {
Set_LED(RED, OFF);
}
}
// Heartbeat indication
void heartbeat() {
static uint32_t lastBlink = 0;
if (millis() - lastBlink > 1000) {
Set_LED(STATUS, TOGGLE);
lastBlink = millis();
}
}MagisV2 © 2025 Drona Aviation | Licensed under GPL-3.0 | Report Issues