s00500 / ESPUI

A simple web user interface library for ESP32 and ESP8266
https://valencia.lbsfilm.at/midterm-presentation/
Other
898 stars 166 forks source link

How to input TIME ? #222

Closed Atorcha closed 1 year ago

Atorcha commented 1 year ago

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. }

iangray001 commented 1 year ago

Your callback is wonky. The definition of the callback is that it has two arguments:

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);