Error Code when using ADS1115

Hello, there.
To use ADS1115, I wrote this code at the beginning.
Of course, I did this after I got the Adafruit library.

#include <Wire.h>
#include <Adafruit_ADS1X15.h>
Adafruit_ADS1115 ads(0x48);

However, the following error message is displayed every time.

<code name>:13:26: error: no matching function for call to 'Adafruit_ADS1115::Adafruit_ADS1115(int)'
 Adafruit_ADS1115 ads(0x48);

I've just changed the code to

Adafruit_ADS1115 ads;

and run it.
Is there any problem with this?

That error means that there is no version of the constructor that accepts an argument of that data type.
There is no need to include the device address. That (0x48) is hard coded in the .h file.

Look at the examples that come with the library. Do they specify an address?

Thank you for replying! I checked the library, and yes, the sample code did not specify the address. I think I was referring to the code written in another version.

This topic was automatically closed 120 days after the last reply. New replies are no longer allowed.