Simple test¶
Ensure your device works with this simple test.
1# SPDX-FileCopyrightText: Copyright (c) 2022 ladyada for Adafruit Industries
2#
3# SPDX-License-Identifier: Unlicense
4
5import time
6import board
7import adafruit_guvx_i2c
8
9i2c = board.I2C() # uses board.SCL and board.SDA
10# i2c = board.STEMMA_I2C() # For using the built-in STEMMA QT connector on a microcontroller
11sensor = adafruit_guvx_i2c.GUVB_C31SM(i2c)
12
13# Check advanced example for more settings, start with lowest range
14sensor.range = 1
15
16while True:
17 print("UVB:", sensor.uvb)
18 time.sleep(1)