1
0
mirror of https://github.com/s00500/ESPUI.git synced 2025-06-12 09:20:39 +00:00

Added an example for using the new extended parameter callback

This commit is contained in:
Martin Mueller
2022-06-11 10:56:35 -04:00
parent 1419b2dec0
commit 511840fa97
5 changed files with 33 additions and 11 deletions

View File

@ -60,8 +60,9 @@ void buttonCallback(Control* sender, int type)
}
}
void buttonExample(Control* sender, int type)
void buttonExample(Control* sender, int type, void* param)
{
Serial.println(String("param: ") + String(int(param)));
switch (type)
{
case B_DOWN:
@ -227,7 +228,7 @@ void setup(void)
statusLabelId = ESPUI.label("Status:", ControlColor::Turquoise, "Stop");
millisLabelId = ESPUI.label("Millis:", ControlColor::Emerald, "0");
ESPUI.button("Push Button", &buttonCallback, ControlColor::Peterriver, "Press");
ESPUI.button("Other Button", &buttonExample, ControlColor::Wetasphalt, "Press");
ESPUI.button("Other Button", &buttonExample, ControlColor::Wetasphalt, "Press", (void*)19);
ESPUI.padWithCenter("Pad with center", &padExample, ControlColor::Sunflower);
ESPUI.pad("Pad without center", &padExample, ControlColor::Carrot);
testSwitchId = ESPUI.switcher("Switch one", &switchExample, ControlColor::Alizarin, false);