HitLib 1.5.0
VEX V5 LED animation library for PROS
Loading...
Searching...
No Matches
HitLib

HitLib is a VEX V5 LED animation library for PROS and VEXcode. It drives WS2812B-compatible LED strips connected to ADI ports, including strips on ADI expanders, with a fully thread-safe, task-driven animation engine.


Getting Started

New to HitLib? Start here:

  1. Installation - wire up your strip and install the template
  2. Groups - understand strands and groups before writing code
  3. Animation Reference - every animation with examples
  4. Profiles & Modes - event-driven animation for competition
  5. Custom Animations - build your own out of layers, new in 1.5

What is HitLib?

HitLib gives you a two-layer animation engine on top of the V5's addressable LED API. Every strip has a base layer and an overlay layer. Animations run continuously in a background task, you just call a method and it plays.

LedGroup
└─ LedStrand
├─ Base layer ← flow / rainbow / pulse / bitscroll / twinkle, or a
│ level meter driven by hand, by a value, or by a song
├─ Overlay layer ← second independent animation, shown where a
│ splice mask asks for it
├─ Splice mask ← alternating sections, or arbitrary custom regions
│ that each animate on their own
└─ Profile ← priority-based mode stack for match events

Feature Overview

Feature Description
Animations Static, flow gradient, rainbow, pulse, flash, twinkle, bitscroll
Bounce variants Pulse bounce, bitscroll bounce
Overlay system A second animation layer, shown in a splice mask's masked bins
Splice mask Alternating sections sharing the overlay, or custom regions that each run their own animation
Level meter Fill the strip in proportion to a value - by hand, or tracking a motor, sensor or the battery on its own
Music sync Fill in time with a song - MP3/M4A/FLAC/OGG/WAV or MIDI, analysed by Pattern Studio
Gauges Several independent meters on one strip, each colored off its own scale - motorHeatGauge() ships with the V5's derating schedule
Profiles Priority mode stack, activateMode / activateModeTimed
Sequencer Multi-phase timed driver for endgame sequences
Groups One call fans out to every strand in the group
Brightness 0–100% applied non-destructively at flush time

Minimal Example

hitlib::LedStrand strand(6, 63);
void initialize() {
group.add(&strand);
group.init();
group.start();
}
void opcontrol() {
group.rainbow(1);
}
Owns a set of LedStrand pointers and fans all animation commands out to each strand simultaneously.
Definition led_group.hpp:43
void rainbow(LedStrand::Speed speed)
Scroll a full HSV rainbow across the strip.
void add(LedStrand *strand)
Register a strand with this group.
void init(uint32_t refreshMs=20)
Initialize hardware on all registered strands.
void start()
Start the group refresh task.
Driver for a single WS2812B-compatible LED strip on a VEX ADI port.
Definition led_strand.hpp:53
Top-level convenience header, includes the full hitlib public API.