Simple test

Ensure your device works with this simple test.

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