-
-
Save sarasantos/3f6e6852793640b2f61896624b343579 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from machine import Pin, I2C | |
from time import sleep | |
from bme680 import * | |
# ESP32 - Pin assignment | |
i2c = I2C(scl=Pin(22), sda=Pin(21), freq=10000) | |
bme = BME680_I2C(i2c=i2c) | |
temperatures = [0, 0, 0, 0, 0] | |
n = 0 | |
while True: | |
print('loop') | |
if n >= len(temperatures): | |
n= 0 | |
temperatures[n] = bme.temperature * (9 / 5) + 32 | |
average = sum(temperatures)/len(temperatures) | |
n += 1 | |
print(average) | |
print(temperatures) | |
sleep(30) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment