Fetch the repository succeeded.
This action will force synchronization from 合宙Luat/LuatOS, which will overwrite any changes that you have made since you forked the repository, and can not be recovered!!!
Synchronous operation will process in the background and will refresh the page when finishing processing. Please be patient.
LuatOS是运行在嵌入式硬件,用户编写lua代码就可完成各种功能
做一个灯神(点亮并闪烁一个LED灯)
local sys = require("sys")
-- 把GPIO19设置为输出模式,上拉,初始电平为低电平(0代表低电平,1代表高电平)
local netled = gpio.setup(19, 0, gpio.PULLUP)
sys.taskInit(function()
while 1 do
netled(1) -- 输出高电平
sys.wait(500) -- 等待500ms
netled(0) -- 输出低电平
sys.wait(500) -- 等待500ms
end
end)
-- 主循环, 必须加
sys.run()
有任何疑问? 加 QQ群: 1061642968 , 很多大佬哦
Sign in for post a comment
Comments ( 0 )