2015-03-07 03:11:17 +01:00
|
|
|
HDC1000 = require("HDC1000")
|
|
|
|
|
|
|
|
sda = 1
|
|
|
|
scl = 2
|
2015-03-07 15:01:20 +01:00
|
|
|
drdyn = false
|
2015-03-07 03:11:17 +01:00
|
|
|
|
2018-03-12 07:56:07 +01:00
|
|
|
i2c.setup(0, sda, scl, i2c.SLOW) -- call i2c.setup() only once
|
|
|
|
HDC1000.setup(drdyn)
|
2015-03-07 03:11:17 +01:00
|
|
|
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
|
2018-03-12 07:56:07 +01:00
|
|
|
package.loaded["HDC1000"]=nil
|