Skip to main content

Progress Bar Card

Preview:

Preview

This card displays a horizontal progress bar based on a integer or a float value.

Initializer

Initializer requires min, max of range you want to display.

/* 
Progress Card
Valid Arguments: (ESPDash dashboard, Card Type, const char* name, const char* symbol (optional), int min, int max)
*/
Card card1(&dashboard, PROGRESS_CARD, "Progress1", "", 0, 255);

Callback

note

Progress bar card doesn't require any callback.

Updater

card1.update(int value);
card1.update(float value);

Or, update symbol along your value:

card1.update(244, "%");

Reference

This is a reference sketch showing positions for intializer and updater.


...

/* Progress card initializer */
Card progress(&dashboard, PROGRESS_CARD, "Progress1", "", 0, 255);


void setup() {
...

/* Progress card updater - can be used anywhere (apart from global scope) */
progress.update(100);
}

void loop() {
...
}