How to input TIME ?
Atorcha opened this issue · comments
Atorcha commented
I would like to input TIME for activate a TIMER, but I dont know how treat the variable.
in void setup:
text_time = ESPUI.text("Time", time1_Callback, ControlColor::Dark, "13:00");
ESPUI.setInputType(text_time, "time");
in main
void time1_Callback(Control *sender, int text_time) {
Serial.print(" ");
Serial.println(sender->id);
Serial.print(text_time);
//This callback is needed to handle the changed values, even though it doesn't do anything itself.
}
Ian Gray commented
Your callback is wonky. The definition of the callback is that it has two arguments:
- A pointer to an instance of the Control class
- An integer corresponding to the event type that has been triggered. Different controls might trigger different events, for example a button can trigger
B_DOWN
andB_UP
events.
So you need to read the member variables in the Control
instance to get what you want. Or in other words:
Serial.print(sender->value);