module(...,package.seeall)
i2cid=3
local function init()
local i2cslaveaddr = 0x51
if i2c.setup(i2cid,i2c.SLOW,i2cslaveaddr) ~= i2c.SLOW then
print("init fail")
return
else print("init ok.........")
end
end
init()
sys.timerStart(i2c.close,1000,i2cid)
--------------------------------------------main.lua-------------------
PROJECT = "I2C"
VERSION = "2.0.0"
require "log"
LOG_LEVEL = log.LOGLEVEL_TRACE
require "testI2c"
--启动系统框架
sys.init(0, 0)
sys.run()
i2cid 从0到3都试过,都不行