Simple test

Ensure your device works with this simple test.

examples/spa06_003_simpletest.py
 1# SPDX-FileCopyrightText: Copyright (c) 2025 Tim Cocks for Adafruit Industries
 2#
 3# SPDX-License-Identifier: MIT
 4
 5import time
 6
 7import board
 8
 9from adafruit_spa06_003 import SPA06_003
10
11i2c = board.I2C()
12# i2c = board.STEMMA_I2C()
13
14# Initialize with default I2C Address
15spa = SPA06_003.over_i2c(i2c)
16
17# Initialize with alternate I2C Address
18# from adafruit_spa06_003 import SPA06_003_ALTERNATE_ADDR
19# spa = SPA06_003.over_i2c(i2c, address=SPA06_003_ALTERNATE_ADDR)
20
21while True:
22    if spa.temperature_data_ready and spa.pressure_data_ready:
23        print(f"Temperature: {spa.temperature} °C", end="   ")
24        print(f"Pressure: {spa.pressure}  hPa")
25
26    time.sleep(1.0)