Skip to content

Instantly share code, notes, and snippets.

@elizabethn119
Created August 31, 2020 20:25
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save elizabethn119/149e4b4957f558048acda829e0ed852a to your computer and use it in GitHub Desktop.
Save elizabethn119/149e4b4957f558048acda829e0ed852a to your computer and use it in GitHub Desktop.
# SPDX-FileCopyrightText: 2020 Bryan Siepert, written for Adafruit Industries
# SPDX-License-Identifier: Unlicense
import time
import board
import adafruit_bh1750
i2c = board.I2C()
sensor = adafruit_bh1750.BH1750(i2c)
while True:
print("%.2f Lux" % sensor.lux)
time.sleep(1)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment