Created
August 31, 2020 21:13
-
-
Save elizabethn119/6f9759f57c6b2cf703443f0c3d4ade0c to your computer and use it in GitHub Desktop.
This file contains hidden or 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
import time | |
import board | |
import adafruit_bh1750 | |
from ISStreamer.Streamer import Streamer | |
# --------- User Settings --------- | |
SENSOR_LOCATION_NAME = "Office" | |
BUCKET_NAME = "House Plant" | |
BUCKET_KEY = "soilsensor" | |
ACCESS_KEY = "ENTER ACCESS KEY HERE" | |
MINUTES_BETWEEN_READS = 0.25 | |
# --------------------------------- | |
i2c = board.I2C() | |
lightsensor = adafruit_bh1750.BH1750(i2c) | |
streamer = Streamer(bucket_name=BUCKET_NAME, bucket_key=BUCKET_KEY, access_key=ACCESS_KEY) | |
while True: | |
streamer.log(SENSOR_LOCATION_NAME + " Ambient Light", lightsensor.lux) | |
streamer.flush() | |
time.sleep(60*MINUTES_BETWEEN_READS) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment