|

楼主 |
发表于 2025-5-27 08:07:23
|
显示全部楼层
--下面列出了常用的回调函数
--更多功能请阅读<<物联型LUA脚本API.pdf>>
function on_init()
uart_set_timeout(1000,200)
end
function on_systick() --定时回调函数,系统每隔1秒钟自动调用。
end
function on_screen_change(screen)
end
function on_audio_callback (state)
end
function on_timer(timer_id)
end
function on_uart_recv_data(packet) --串口接收
end
function on_control_notify(screen,control,value)
if screen ==1 then
if control==2 and value==0 then --进入对抗界面
local prtstrC={1,1}
tmp=get_text(1,1)
for i=0,tmp do
prtstrC[i]=0
end
uart_send_data(prtstrC)
end
end
end |
|