#ifndef ADS1115V2_H
#define ADS1115V2_H
#include "Adc.h"
#include <Wire.h>
#include <ADS1115x.h>

class Ads1115V2 : public Adc
{
  public:
    Ads1115V2();
    ~Ads1115V2();

    virtual void begin();
    virtual double getQuantum();
    virtual double sampleValue(int16_t channel, boolean sgl = true);
    virtual double sampleValue();
    virtual double sampleVoltage(int16_t channel, boolean sgl = true);
    virtual double sampleVoltage();

    //Async methods
    virtual void startSample(int16_t channel, boolean sgl = true);
    virtual void startSample();
    virtual double getSampleVoltage();
    //End of async methods
  protected:
  private:
    uint16_t getReading(int16_t channel = -1, boolean sgl = true);
    ADS1115 ads1, ads2;
};

#endif //ADS1115V2_H
