You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
code.py output:
Traceback (most recent call last):
File "code.py", line 8, in <module>
AttributeError: 'module' object has no attribute 'Adafruit_ADS7830'
After some research and experimentation, I arrived at this resolution:
@@ -1,17 +1,18 @@
import time
import board
-import adafruit_ads7830+import adafruit_ads7830.ads7830+from adafruit_ads7830.analog_in import AnalogIn
i2c = board.I2C()
# Initialize ADS7830
-adc = adafruit_ads7830.Adafruit_ADS7830(i2c)+adc = adafruit_ads7830.ads7830.ADS7830(i2c)
analog_inputs = []
for i in range(8):
- c = adc.inputs[i]+ c = AnalogIn(adc, i)
analog_inputs.append(c)
while True:
- for i in enumerate(analog_inputs):+ for i in range(8):
print(f"ADC input {i} = {analog_inputs[i].value}")
time.sleep(0.1)
The text was updated successfully, but these errors were encountered:
The example usage found in README.rst#usage-example fails to run with the following error:
After some research and experimentation, I arrived at this resolution:
As a diff, if it helps:
The text was updated successfully, but these errors were encountered: