Skip to content

PadAnimator

#include "crosspad/pad/PadAnimator.hpp"

Generated from crosspad/pad/PadAnimator.hpp in crosspad-core. Edit the header’s doxygen comments to change this page.

Recipes that use it: Pads and LEDs

PadAnimator & getPadAnimator()

Platform-injected singleton accessor.

Used in Pads and LEDs.

Declared in crosspad/pad/PadAnimator.hpp:93.

Portable pad LED animator for progress bars, success/error/boot animations.

Uses ILedStrip and IClock — no ESP-IDF dependencies. The platform glue creates the instance and wires the animation-state callback so PadLedController knows when to suppress normal LED updates.

Used in Pads and LEDs.

FieldTypeDescription
kPadCountconstexpr uint8_t

Members

MemberDescription
PadAnimator
initPlatform only The platform calls it once at start-up (crosspad_platform_init).
updatePlatform only PadManager::update() calls it.
isActive
startProgress
setProgress
showFrame
playSuccess
playError
playBootAnim
startCharging
setChargePercent
setChargingActive
stop
setCompletionCallback
setAnimationStateCallback

Methods

PadAnimator() = default

Platform only The platform calls it once at start-up (crosspad_platform_init).

void init(ILedStrip &strip, IClock &clock)

Platform only PadManager::update() calls it.

void update()
bool isActive() const

Used in Pads and LEDs.

void startProgress(RgbColor color=RgbColor(208, 240, 9))
void setProgress(float progress)
void showFrame(const RgbColor(&colors)[kPadCount])

Used in Pads and LEDs.

void playSuccess(uint32_t fadeMs=800)
void playError(uint32_t holdMs=2000)
void playBootAnim(uint32_t durationMs=600)
void startCharging(float soc=0.0f)
void setChargePercent(float soc)
void setChargingActive(bool active)
void stop()

Used in Pads and LEDs.

void setCompletionCallback(CompletionCallback cb)
void setAnimationStateCallback(AnimationStateCallback cb)

Declared in crosspad/pad/PadAnimator.hpp:16.