1

I was working with a code I found online, it had:

from Adafruit import ADS1x15

...
t = time.perf_counter() - t0
adc.stopContinuousConversion()
print('Time elapsed: %.9f s.' % t)
print()

But it kept showing me this error:

Traceback (most recent call last):
File "C:\Users\Aryannn\Downloads\project\child.py", line 15, in <module>
from Adafruit import ADS1x15
ModuleNotFoundError: No module named 'Adafruit'

I am a bit new to Raspberry Pi so I bought it here to ask. It would be really great if you help me out here

2
  • Where does Adafruit come from? Is it a library you need to install? If so, have you installed it?
    – C.Nivs
    Commented May 10, 2022 at 3:22
  • I have the same question cause I googled it and it didn't show me a library like that, But it was in the code
    – Sahar
    Commented May 10, 2022 at 3:23

1 Answer 1

4

I'm guessing you're looking for the python library Adafruit's ADS1x15.

From https://github.com/adafruit/Adafruit_Python_ADS1x15, it looks to be deprecated. In its place, it's supposedly https://github.com/adafruit/Adafruit_CircuitPython_ADS1x15.

That said, if you do need to use the current version, I believe it is:

# Import the ADS1x15 module.
import Adafruit_ADS1x15


# Create an ADS1115 ADC (16-bit) instance.
adc = Adafruit_ADS1x15.ADS1115()

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.