HDC1000-example.lua 361 B

12345678910111213
  1. HDC1000 = require("HDC1000")
  2. sda = 1
  3. scl = 2
  4. drdyn = false
  5. HDC1000.init(sda, scl, drdyn)
  6. HDC1000.config() -- default values are used if called with no arguments. prototype is config(address, resolution, heater)
  7. print(string.format("Temperature: %.2f °C\nHumidity: %.2f %%", HDC1000.getTemp(), HDC1000.getHumi()))
  8. HDC1000 = nil
  9. package.loaded["HDC1000"]=nil