问题可能是由于未在主循环中调用gslc_Update()函数所致。这可以解决gui元素未被更新的问题。以下是示例代码:
在程序中的主循环中添加gslc_Update()函数以更新GUI元素。
while(1){
// main loop code goes here
gslc_Update(&m_gui);
}
或者,您可以将gslc_Update()函数添加到您的主循环的定时器函数中。
void loop(){
// other loop code goes here
// call the timer function every 10 milliseconds
static unsigned long tmr = millis();
if (millis()-tmr > 10) {
tmr = millis();
my_timer_event();
gslc_Update(&m_gui);
}
}