Skip to content

Instantly share code, notes, and snippets.

@doofy-dev
Created November 20, 2022 17:12
Show Gist options
  • Save doofy-dev/cd44f290aaec62b1773487543500d74d to your computer and use it in GitHub Desktop.
Save doofy-dev/cd44f290aaec62b1773487543500d74d to your computer and use it in GitHub Desktop.
Sample led usage
#include <furi.h>
#include <notification/notification.h>
#include <notification/notification_messages.h>
const NotificationSequence enable_all_colors = {
&message_red_255,
&message_green_255,
&message_blue_255,
NULL,
};
const NotificationSequence disable_led = {
&message_green_0,
&message_blue_0,
&message_red_0,
NULL,
};
int32_t your_entry_point(void *p) {
NotificationApp *notification = furi_record_open(RECORD_NOTIFICATION);
// to enable the LEDS call this
notification_message(notification, &enable_all_colors);
// main loop goes here
// At the end, disable them
notification_message(notification, &disable_led);
// cleanup part
furi_record_close(RECORD_NOTIFICATION);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment