Description
How do I get data from a text area?
What MCU/Processor/Board and compiler are you using?
STM32F401
What LVGL version are you using?
7
What do you want to achieve?
Set time from text area
What have you tried so far?
From a standard example
Code to reproduce
the txt variable contains the initial value and is not updated and the interrupt is triggered.
static void ta_event_cb(lv_obj_t * ta, lv_event_t event)
{
if(event == LV_EVENT_VALUE_CHANGED) {
const char * txt = lv_textarea_get_text(ta);
if(txt[3] == ‘:’) {
lv_textarea_del_char(ta);
}
else if(txt[0] >= ‘0’ && txt[0] <= ‘9’ &&
txt[1] >= ‘0’ && txt[1] <= ‘9’ &&
txt[2] != ‘:’)
{
lv_textarea_set_cursor_pos(ta, 2);
lv_textarea_add_char(ta, ‘:’);
}
}
}
How can I get the time value printed in the text area like this
RTC_DateTime.RTC_Hours = 0;
RTC_DateTime.RTC_Minutes = 0;
RTC_DateTime.RTC_Seconds = 0;
for further change of RTS registers. Thanks.
The code block(s) should be formatted like:
/*You code here*/
Screenshot and/or video
If possible, add screenshots and/or videos about the current state.