Skip to content

Commit 7c510ca

Browse files
authored
Merge pull request #24 from adafruit/stemma_i2c
Added commented out board.STEMMA_I2C with explanation
2 parents 8b5f5ba + f97dd63 commit 7c510ca

File tree

1 file changed

+13
-11
lines changed

1 file changed

+13
-11
lines changed

examples/veml6070_simpletest.py

Lines changed: 13 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -7,15 +7,17 @@
77
import board
88
import adafruit_veml6070
99

10-
with board.I2C() as i2c:
11-
uv = adafruit_veml6070.VEML6070(i2c)
12-
# Alternative constructors with parameters
13-
# uv = adafruit_veml6070.VEML6070(i2c, 'VEML6070_1_T')
14-
# uv = adafruit_veml6070.VEML6070(i2c, 'VEML6070_HALF_T', True)
10+
i2c = board.I2C() # uses board.SCL and board.SDA
11+
# i2c = board.STEMMA_I2C() # For using the built-in STEMMA QT connector on a microcontroller
1512

16-
# take 10 readings
17-
for j in range(10):
18-
uv_raw = uv.uv_raw
19-
risk_level = uv.get_index(uv_raw)
20-
print("Reading: {0} | Risk Level: {1}".format(uv_raw, risk_level))
21-
time.sleep(1)
13+
uv = adafruit_veml6070.VEML6070(i2c)
14+
# Alternative constructors with parameters
15+
# uv = adafruit_veml6070.VEML6070(i2c, 'VEML6070_1_T')
16+
# uv = adafruit_veml6070.VEML6070(i2c, 'VEML6070_HALF_T', True)
17+
18+
# take 10 readings
19+
for j in range(10):
20+
uv_raw = uv.uv_raw
21+
risk_level = uv.get_index(uv_raw)
22+
print("Reading: {0} | Risk Level: {1}".format(uv_raw, risk_level))
23+
time.sleep(1)

0 commit comments

Comments
 (0)