ESP8266/Lua Codez

From Playful Exploration
Revision as of 05:19, 2 June 2016 by Peter (talk | contribs) (Created page with "== Dump BME280 Pressure, Humidity and Temperature == <syntaxhighlight lang="lua"> bme280.init(1,2) tmr.alarm(1, 3000, 1, function() tmr.softwd(30) local h,t,b=bme280.h...")
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search

Dump BME280 Pressure, Humidity and Temperature

bme280.init(1,2)
tmr.alarm(1, 3000, 1, function()
    tmr.softwd(30)
    local h,t,b=bme280.humi(),bme280.temp(),bme280.baro()
    print('humi: '..(h/1000)..'%  temp: '..(t/100)..'C  baro: '..b..'PA  dewp: '..(bme280.dewpoint(h,t)/100)..'C')
end)