-
Notifications
You must be signed in to change notification settings - Fork 225
BME280 SENSOR
Jaume Olivé Petrus edited this page Apr 19, 2017
·
26 revisions
What | Comments | |
---|---|---|
Identifier | BME280 | |
Interface | I2C | |
Provides | temperature | celsius degrees |
humidity | % relative humidity | |
pressure | hPa | |
Properties | address | sensor address (r/w) |
mode | sensor mode (r/w) | |
standbytime | ||
Datasheet |
-- Setup BME280, attached at I2C0, speed=400Khz
-- sda=GPIO14, scl=GPIO26, adress is 0x76
s1 = sensor.setup("BME280", i2c.I2C0, 400, pio.GPIO14, pio.GPIO26, 0x76)
while true do
-- Read temperature
temperature = s1:read("temperature")
-- Read humidity
humidity = s1:read("humidity")
-- Read preassure
pressure = s1:read("pressure")
-- Print results
print("temperature: "..temperature..", humidity: "..humidity..", pressure: "..pressure)
tmr.delayms(500)
end