Wrong version of Wire.h? ADS1115

Hey everyone,

I have an Arduino Nano RP2040 connect and recently installed the RobTillaart/ADS1X15 repo.

For reference, I'm using this code:

#include "ADS1X15.h"
 
ADS1115 ADS(0x48);
 
 
void setup() 
{
  Serial.begin(115200);
  Serial.println(__FILE__);
  Serial.print("ADS1X15_LIB_VERSION: ");
  Serial.println(ADS1X15_LIB_VERSION);
 
  ADS.begin();
}
 
 
void loop() 
{
  ADS.setGain(0);
 
  int16_t val_0 = ADS.readADC(0);  
  int16_t val_1 = ADS.readADC(1);  
  int16_t val_2 = ADS.readADC(2);  
  int16_t val_3 = ADS.readADC(3);  
 
  float f = ADS.toVoltage(2);  // voltage factor
 
  Serial.print("\tAnalog0: "); Serial.print(val_0); Serial.print('\t'); Serial.println(val_0 * f, 3);
  Serial.print("\tAnalog1: "); Serial.print(val_1); Serial.print('\t'); Serial.println(val_1 * f, 3);
  Serial.print("\tAnalog2: "); Serial.print(val_2); Serial.print('\t'); Serial.println(val_2 * f, 3);
  Serial.print("\tAnalog3: "); Serial.print(val_3); Serial.print('\t'); Serial.println(val_3 * f, 3);
  Serial.println();
 
  delay(1000);
}

Here's my problem. When I go to compile I get this:

error: 'TwoWire' {aka 'class arduino::MbedI2C'} has no member named 'setSDA'

I ran a check to see if everything I had was up to date, I'm using PlatformIO via VSCode so things are a bit different than with the Arduino IDE but here's the config:

[env:nanorp2040connect]
platform = raspberrypi
board = nanorp2040connect
framework = arduino
lib_deps = 
	arduino-libraries/WiFiNINA@^1.8.14
	bblanchon/ArduinoJson@^6.21.2
	robtillaart/ADS1X15@^0.3.9

The framework being arduino installs the arduino mbed core.

Now weirdly enough I checked all the cores and none of them have these methods. They never have. So I'm kind of scratching my head since the threads I'm finding online when searching for that error all mention updating to the latest Wire.

This has got to be something stupid, what am I missing?

Thanks!

PS: Maybe I've been looking at the file history wrong. In the meantime, I'm going to use the adafruit library and see if that matches my needs.

The error message you provided is not complete.
Please show your error message in full.

Please open an issue on GitHub for this.
The nano RP2040 comes in two flavors, one MBED an one other (Earle F. Philhower III).
Fixed this recently for another library too.

Created PR to implement the fix - fix NANO RP2040 (mbed) support by RobTillaart · Pull Request #54 · RobTillaart/ADS1X15 · GitHub

Please download the develop branch and verify if it works for you.

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