HitLib 1.3.0
VEX V5 LED animation library for PROS
Loading...
Searching...
No Matches
hitlib::Profile Struct Reference

An immutable, statically-allocated collection of ProfileMode entries. More...

#include <led_profile.hpp>

Public Attributes

const char * name
 Profile name (for display/debug).
const ProfileModemodes
 Pointer to the mode array.
uint8_t modeCount
 Number of entries in modes.

Detailed Description

An immutable, statically-allocated collection of ProfileMode entries.

A Profile holds no per-strand state, state lives inside LedStrand. Multiple strands (or groups) can share the same Profile instance.

Example: declaring a custom profile

static void myIdle (hitlib::LedStrand& s) { s.rainbow(1); }
static void myAlert(hitlib::LedStrand& s) { s.flash(0xFF0000, 100, 100); }
static const hitlib::ProfileMode myModes[] = {
{"Idle", 10, myIdle, nullptr},
{"Alert", 80, myAlert, nullptr},
};
static const hitlib::Profile myProfile = {"MyRobot", myModes, 2};
Driver for a single WS2812B-compatible LED strip on a VEX ADI port.
Definition led_strand.hpp:53
void flash(uint32_t color, uint32_t onMs, uint32_t offMs, uint32_t bgColor=0x000000)
Blink the whole strip on and off.
void rainbow(uint8_t speed)
Scroll a full HSV rainbow across the strip.
Describes a single named animation mode within a Profile.
Definition led_profile.hpp:38
See also
ProfileMode
LedStrand::attachProfile

Member Data Documentation

◆ name

const char* hitlib::Profile::name

Profile name (for display/debug).

◆ modes

const ProfileMode* hitlib::Profile::modes

Pointer to the mode array.

◆ modeCount

uint8_t hitlib::Profile::modeCount

Number of entries in modes.