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.