File tree Expand file tree Collapse file tree 1 file changed +13
-11
lines changed Expand file tree Collapse file tree 1 file changed +13
-11
lines changed Original file line number Diff line number Diff line change 7
7
import board
8
8
import adafruit_veml6070
9
9
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
15
12
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 )
You can’t perform that action at this time.
0 commit comments