Skip to main content

Generic Card

Preview

Generic card is the 'fits-all-types' card, which you can use to display any kind of value. It's mostly used when you want to display numbers, strings etc which don't relate to any other card in the list.

Initializer

/* 
Generic Card
Valid Arguments: (ESPDash dashboard, Card Type, const char* name, const char* symbol (optional) )
*/
Card card1(&dashboard, GENERIC_CARD, "Generic1");

Callback

note

Generic card doesn't require any callback.

Updater

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

Reference

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


...

/* Generic card initializer */
Card generic(&dashboard, GENERIC_CARD, "Generic1");


void setup() {
...

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

void loop() {
...
}