m5stack / M5-ADS1115

Contains M5Stack UNIT Ameter & Vmeter related case programs.
MIT License
5 stars 1 forks source link

Unit_VMeter_M5Atom.ino:32:12: error: 'class ADS1115' has no member named 'setEEPROMAddr'; did you mean 'getPGAEEEPROMAddr'? #6

Closed lboue closed 5 months ago

lboue commented 7 months ago

Hello,

I am facing some issues with Unit_VMeter_M5Atom.ino demo file. Can you help me to fix that?

image

"C:\\Users\\user\\AppData\\Local\\Temp\\arduino\\sketches\\71A06728C97D80FE9BD90B439C7E6DC0\\sketch\\Unit_VMeter_M5Atom.ino.cpp" -o "C:\\Users\\user\\AppData\\Local\\Temp\\arduino\\sketches\\71A06728C97D80FE9BD90B439C7E6DC0\\sketch\\Unit_VMeter_M5Atom.ino.cpp.o"
C:\Users\user\Downloads\Unit_VMeter_M5Atom\Unit_VMeter_M5Atom.ino: In function 'void setup()':
C:\Users\user\Downloads\Unit_VMeter_M5Atom\Unit_VMeter_M5Atom.ino:28:20: error: 'class ADS1115' has no member named 'begin'
     while (!Vmeter.begin(&Wire, M5_UNIT_VMETER_I2C_ADDR, 26, 32, 400000U)) {
                    ^~~~~
C:\Users\user\Downloads\Unit_VMeter_M5Atom\Unit_VMeter_M5Atom.ino:28:27: error: 'Wire' was not declared in this scope
     while (!Vmeter.begin(&Wire, M5_UNIT_VMETER_I2C_ADDR, 26, 32, 400000U)) {
                           ^~~~
C:\Users\user\Downloads\Unit_VMeter_M5Atom\Unit_VMeter_M5Atom.ino:28:27: note: suggested alternative: 'pipe'
     while (!Vmeter.begin(&Wire, M5_UNIT_VMETER_I2C_ADDR, 26, 32, 400000U)) {
                           ^~~~
                           pipe
C:\Users\user\Downloads\Unit_VMeter_M5Atom\Unit_VMeter_M5Atom.ino:32:12: error: 'class ADS1115' has no member named 'setEEPROMAddr'; did you mean 'getPGAEEEPROMAddr'?
     Vmeter.setEEPROMAddr(M5_UNIT_VMETER_EEPROM_I2C_ADDR);
            ^~~~~~~~~~~~~
            getPGAEEEPROMAddr
In file included from C:\Users\user\Downloads\Unit_VMeter_M5Atom\Unit_VMeter_M5Atom.ino:15:
c:\Users\user\Documents\Arduino\libraries\M5-ADS1115\src/M5_ADS1115.h:72:33: error: invalid conversion from 'int' to 'ADS1115Mode_t' [-fpermissive]
 #define ADS1115_MODE_SINGLESHOT 0x01  // default
                                 ^~~~
C:\Users\user\Downloads\Unit_VMeter_M5Atom\Unit_VMeter_M5Atom.ino:33:20: note: in expansion of macro 'ADS1115_MODE_SINGLESHOT'
     Vmeter.setMode(ADS1115_MODE_SINGLESHOT);
                    ^~~~~~~~~~~~~~~~~~~~~~~
c:\Users\user\Documents\Arduino\libraries\M5-ADS1115\src/M5_ADS1115.h:134:32: note:   initializing argument 1 of 'void ADS1115::setMode(ADS1115Mode_t)'
     void setMode(ADS1115Mode_t mode);
                  ~~~~~~~~~~~~~~^~~~
c:\Users\user\Documents\Arduino\libraries\M5-ADS1115\src/M5_ADS1115.h:41:26: error: invalid conversion from 'int' to 'ADS1115Rate_t' [-fpermissive]
 #define ADS1115_RATE_8   0x00
                          ^~~~
C:\Users\user\Downloads\Unit_VMeter_M5Atom\Unit_VMeter_M5Atom.ino:34:20: note: in expansion of macro 'ADS1115_RATE_8'
     Vmeter.setRate(ADS1115_RATE_8);
                    ^~~~~~~~~~~~~~
c:\Users\user\Documents\Arduino\libraries\M5-ADS1115\src/M5_ADS1115.h:133:32: note:   initializing argument 1 of 'void ADS1115::setRate(ADS1115Rate_t)'
     void setRate(ADS1115Rate_t rate);
                  ~~~~~~~~~~~~~~^~~~
c:\Users\user\Documents\Arduino\libraries\M5-ADS1115\src/M5_ADS1115.h:31:26: error: invalid conversion from 'int' to 'ADS1115Gain_t' [-fpermissive]
 #define ADS1115_PGA_512  0x04
                          ^~~~
C:\Users\user\Downloads\Unit_VMeter_M5Atom\Unit_VMeter_M5Atom.ino:35:20: note: in expansion of macro 'ADS1115_PGA_512'
     Vmeter.setGain(ADS1115_PGA_512);
                    ^~~~~~~~~~~~~~~
c:\Users\user\Documents\Arduino\libraries\M5-ADS1115\src/M5_ADS1115.h:132:32: note:   initializing argument 1 of 'void ADS1115::setGain(ADS1115Gain_t)'
     void setGain(ADS1115Gain_t gain);
                  ~~~~~~~~~~~~~~^~~~
C:\Users\user\Downloads\Unit_VMeter_M5Atom\Unit_VMeter_M5Atom.ino:43:25: error: 'class ADS1115' has no member named 'getCoefficient'; did you mean 'getCoverTime'?
     resolution = Vmeter.getCoefficient() / M5_UNIT_VMETER_PRESSURE_COEFFICIENT;
                         ^~~~~~~~~~~~~~
                         getCoverTime
C:\Users\user\Downloads\Unit_VMeter_M5Atom\Unit_VMeter_M5Atom.ino:44:33: error: 'class ADS1115' has no member named 'getFactoryCalibration'; did you mean 'setCalibration'?
     calibration_factor = Vmeter.getFactoryCalibration();
                                 ^~~~~~~~~~~~~~~~~~~~~
                                 setCalibration
C:\Users\user\Downloads\Unit_VMeter_M5Atom\Unit_VMeter_M5Atom.ino: In function 'void loop()':
C:\Users\user\Downloads\Unit_VMeter_M5Atom\Unit_VMeter_M5Atom.ino:48:30: error: 'class ADS1115' has no member named 'getSingleConversion'; did you mean 'startSingleConversion'?
     int16_t adc_raw = Vmeter.getSingleConversion();
                              ^~~~~~~~~~~~~~~~~~~
                              startSingleConversion

Using library M5-ADS1115 at version 0.0.2 in folder: C:\Users\user\Documents\Arduino\libraries\M5-ADS1115 
Using library Wire at version 2.0.0 in folder: C:\Users\user\AppData\Local\Arduino15\packages\esp32\hardware\esp32\2.0.14\libraries\Wire 
exit status 1

Compilation error: 'class ADS1115' has no member named 'begin'

M5-ADS1115.log

lboue commented 7 months ago

Release 0.0.2 is the latest and was published on Aug 11, 2022. Since there was commits (c445ef5) on Feb 21, 2024 but not released in a new version. Can you publish these changes?

Tinyu-Zhao commented 5 months ago

Released. https://github.com/m5stack/M5-ADS1115/releases/tag/1.0.0