nodemcu-firmware/lua_modules/hdc1000/HDC1000-example.lua

13 lines
361 B
Lua
Raw Permalink Normal View History

HDC1000 = require("HDC1000")
sda = 1
scl = 2
2015-03-07 15:01:20 +01:00
drdyn = false
2015-03-07 15:01:20 +01:00
HDC1000.init(sda, scl, drdyn)
HDC1000.config() -- default values are used if called with no arguments. prototype is config(address, resolution, heater)
print(string.format("Temperature: %.2f °C\nHumidity: %.2f %%", HDC1000.getTemp(), HDC1000.getHumi()))
HDC1000 = nil
package.loaded["HDC1000"]=nil