![]() |
HitLib 1.5.0
VEX V5 LED animation library for PROS
|
How fast a moving animation travels: so many pixels, so often. More...
#include <led_strand.hpp>
Public Member Functions | |
| constexpr | Speed (int pixelsPerStep=1, uint16_t ms=0) |
pixelsPerStep pixels every ms milliseconds; with no ms, that many pixels on every refresh tick. | |
Static Public Member Functions | |
| static constexpr Speed | everyMs (uint16_t ms, uint8_t pixelsPerStep=1) |
pixelsPerStep pixels (default one) every ms milliseconds. | |
Public Attributes | |
| uint8_t | pixels |
| Pixels moved per step. | |
| uint16_t | stepMs |
| Milliseconds between steps. 0 steps on every refresh tick. | |
How fast a moving animation travels: so many pixels, so often.
A bare number is pixels per refresh tick, which is what speed has always meant, so strand.rainbow(2) is unchanged. A pixel a tick is the fastest-but-one a bare number can say and the slowest it can say, so for anything slower give the time between steps instead:
Like flash()'s durations, stepMs is rounded to whole refresh ticks, so the pace is even: a 100 ms step on a 20 ms strand moves on every fifth tick, never on a mix of fourth and sixth ones.
|
inlineconstexpr |
pixelsPerStep pixels every ms milliseconds; with no ms, that many pixels on every refresh tick.
|
inlinestaticconstexpr |
pixelsPerStep pixels (default one) every ms milliseconds.
| uint8_t hitlib::LedStrand::Speed::pixels |
Pixels moved per step.
| uint16_t hitlib::LedStrand::Speed::stepMs |
Milliseconds between steps. 0 steps on every refresh tick.