|

楼主 |
发表于 2024-5-11 16:16:35
|
显示全部楼层
我这样写定时器,我想问一下有什么问题吗
local ErrLevel_data_buff = {}
local ErrCode_data_buff = {}
local data_index = 0
function on_systick()
for data_index=0,14,1 do
start_timer(0,2000,1,0) --开启定时器 0,超时时间 2s
if data_index == 14
then
stop_timer(0) --停止定时器 0
end
end
end
function on_timer(0)
set_text(screen_can,11,ErrLevel_data_buff[data_index])
if data_index >= 0 and data_index <= 4
then
set_text(screen_can,51,ErrCode_data_buff[data_index])
end
end |
|