#include <stdlib.h>
#include <StandardCplusplus.h>
#include <vector>
#include <Wire.h>
#include <Adafruit_ADS1015.h>
#include <Adafruit_MCP4725.h>
using namespace std;
vector<Adafruit_ADS1115> adcs(4);
vector<Adafruit_MCP4725> dacs(2);
void setup()
{
Serial.begin(9600);
Wire.begin();
adcs[0] = new Adafruit_ADS1115(0x48);
adcs[0].begin();
adcs[1] = new Adafruit_ADS1115(0x49);
adcs[1].begin();
adcs[2] = new Adafruit_ADS1115(0x4A);
adcs[2].begin();
adcs[3] = new Adafruit_ADS1115(0x4B);
adcs[3].begin();
dacs[0] = new Adafruit_MCP4725;
dacs[0].begin(0x62);
dacs[1] = new Adafruit_MCP4725;
dacs[1].begin(0x63);
} // setup
void loop()
{
} // loop
Here's the error message:
sketchbook/libraries/Adafruit_MCP4725/Adafruit_MCP4725.h:31:7: note: no known conversion for argument 1 from 'Adafruit_MCP4725*' to 'const Adafruit_MCP4725&'
Looking at the header files for the two classes, I don't see any major difference in the constructors. I don't see that I'm passing a pointer to anything here. I don't know what "argument 1" the error message is referring to in the first place. Putting parentheses after the class name like this doesn't change the results:
dacs[0] = new Adafruit_MCP4725();
Any ideas why the compiler treats these two differently? Thanks!
Thanks for the reply, Isaac. As I suspected, that didn't work. The constructor doesn't take an argument. The bus address is passed to begin(). That's the bus address of one of the ADCs anyway. The ADCs appear to be initializing correctly.