美文网首页
luart 函数定时器使用

luart 函数定时器使用

作者: 董占峰 | 来源:发表于2018-12-28 10:31 被阅读0次

luart 函数定时器使用

  1. 函数原型
sys.timerLoopStart(function()
                       print("hello")
                   end,5000)
  1. 函数原型
sys.timerStart(sayHello,1000)
  1. 函数链接
    函数链接

pmd.ldoset GPIO使用注意事项

01.png 02.png 03.png

线程延时使用

  1. 参考代码1
sys.taskInit(function()
    while true do
        print("ss function test")
        sys.wait(1000)          -- 挂起1000ms,同理为每隔1000ms运行一次
    end
end)
  1. 参考代码2
function test()
    while true do
        print("ss function test")
        sys.wait(1000)          -- 挂起1000ms,同理为每隔1000ms运行一次
    end
end

sys.taskInit(test)

消息订阅

  1. 参考
    消息订阅.jpg
  2. 系统自带订阅消息
    自带订阅消息.jpg

相关文章

网友评论

      本文标题:luart 函数定时器使用

      本文链接:https://www.haomeiwen.com/subject/lrcslqtx.html