janlucaklees / MPX4115A-Arduino-library

A library for easily using the MPX4115A pressure sensor on your Arduino.
0 stars 0 forks source link

Error compiling for Arduino 1 #1

Open richhl opened 2 years ago

richhl commented 2 years ago

Hi! have downloaded a zip of yout master branch, unzip at arduino ide library dir and while importing it, i've got:

Arduino:1.8.19 (Linux), Tarjeta:"Arduino Uno"

In file included from /tmp/arduino_modified_sketch_547580/i2cdetect.ino:1:0: /home/madrid/Arduino/libraries/MPX4115AArduinolibrarymaster/MPX4115A.h:10:10: fatal error: Vcc.h: No such file or directory

include "Vcc.h"

      ^~~~~~~

compilation terminated. exit status 1 Error compilando para la tarjeta Arduino Uno.

richhl commented 2 years ago

Have installed imagen but I don't really know if you depend or not an that library nor the correct version...clearly your code is expecting methods not implemented on that library/version.....

I've got:

Arduino:1.8.19 (Linux), Tarjeta:"Arduino Uno"

/home/madrid/Arduino/libraries/MPX4115AArduinolibrarymaster/MPX4115A.cpp: In constructor 'MPX4115A::MPX4115A(uint8_t, double)': /home/madrid/Arduino/libraries/MPX4115AArduinolibrarymaster/MPX4115A.cpp:12:31: error: no matching function for call to 'Vcc::Vcc(double&)' _vcc = new Vcc(vccCorrection); ^ In file included from /home/madrid/Arduino/libraries/MPX4115AArduinolibrarymaster/MPX4115A.h:10:0, from /home/madrid/Arduino/libraries/MPX4115AArduinolibrarymaster/MPX4115A.cpp:7: /home/madrid/Arduino/libraries/Vcc/src/Vcc.h:16:7: note: candidate: constexpr Vcc::Vcc() class Vcc { ^~~ /home/madrid/Arduino/libraries/Vcc/src/Vcc.h:16:7: note: candidate expects 0 arguments, 1 provided /home/madrid/Arduino/libraries/Vcc/src/Vcc.h:16:7: note: candidate: constexpr Vcc::Vcc(const Vcc&) /home/madrid/Arduino/libraries/Vcc/src/Vcc.h:16:7: note: no known conversion for argument 1 from 'double' to 'const Vcc&' /home/madrid/Arduino/libraries/Vcc/src/Vcc.h:16:7: note: candidate: constexpr Vcc::Vcc(Vcc&&) /home/madrid/Arduino/libraries/Vcc/src/Vcc.h:16:7: note: no known conversion for argument 1 from 'double' to 'Vcc&&' /home/madrid/Arduino/libraries/MPX4115AArduinolibrarymaster/MPX4115A.cpp: In member function 'double MPX4115A::readVcc()': /home/madrid/Arduino/libraries/MPX4115AArduinolibrarymaster/MPX4115A.cpp:45:16: error: 'class Vcc' has no member named 'Read_Volts' return _vcc->Read_Volts();

richhl commented 2 years ago

any clue @janlucaklees ?

janlucaklees commented 2 years ago

Hi @richhl,

let me warn you up front: I could not get this sensor to work well. I think the problem was that I could not control or measure the actually supplied voltage good enough. So my measurements were really imprecise.

Besides that: To me it looks like you can adapt my code to use the new measure method of the VCC library. (See here: https://github.com/felias-fogg/Vcc.) It should be in this line: https://github.com/janlucaklees/MPX4115A-Arduino-library/blob/master/MPX4115A.cpp#L45