lm75 - lm75 Temperature Sensor Support lm75a lm75b#
Adaptation status unknown
Note
This page document is automatically generated by this file. If there is any error, please submit issue or help modify pr, thank you!
Example
-- Usage Examples
local lm75 = require "lm75"
i2cid = 0
i2c_speed = i2c.FAST
sys.taskInit(function()
i2c.setup(i2cid,i2c_speed)
lm75.init(i2cid)--initialization, passing in i2c_id
while 1 do
local lm75_data = lm75.get_data()
if lm75_data then
log.info("lm75_data", lm75_data.."℃")
end
sys.wait(1000)
end
end)
lm75_data.init(i2c_id)#
lm75_data Initialization
Parameters
Incoming Value Type |
Explanation |
---|---|
number |
The i2c bus id |
Return Value
return value type |
explanation |
---|---|
bool |
Successful return true |
Examples
lm75_data.init(0)
lm75.get_data()#
Get lm75 data
Parameters
None
Return Value
return value type |
explanation |
---|---|
table |
lm75 Data |
Examples
local lm75_data = lm75.get_data()
if lm75_data then
log.info("lm75_data", lm75_data.."℃")
end