Simple test
Ensure your device works with this simple test.
examples/ads7830_simpletest.py
1# SPDX-FileCopyrightText: 2023 Liz Clark for Adafruit Industries
2# SPDX-License-Identifier: MIT
3
4# Simple demo to read analog input on channel 0
5
6import time
7
8import board
9
10import adafruit_ads7830.ads7830 as ADC
11from adafruit_ads7830.analog_in import AnalogIn
12
13i2c = board.I2C()
14
15# Initialize ADS7830
16adc = ADC.ADS7830(i2c)
17chan = AnalogIn(adc, 0)
18
19while True:
20 print(f"ADC channel 0 = {chan.value}")
21 time.sleep(0.1)