Hello, I am making a project with an Esp32. I have code and other libraries already installed and compiling fine. I am wanting to install SmoothThermistor to read values from an assortment of thermistors attached to by board. I had already used this library in ArduinoIDE and it worked fine.
So, I go into the Library Manager and install it. It says it was installed fine without issue. When I compile the project though, it gives me some pretty strange errors regarding the SmoothThermistor library.
Here are the errors given for SmoothThermistor:
Compiling .pio/build/nodemcu-32s/libb97/SmoothThermistor/SmoothThermistor.cpp.o .pio/libdeps/nodemcu-32s/SmoothThermistor/src/SmoothThermistor.cpp:53:2: error: invalid preprocessing directive #IF #IF !defined(ESP32) || !defined(ESP8266) ^ .pio/libdeps/nodemcu-32s/SmoothThermistor/src/SmoothThermistor.cpp:55:2: error: invalid preprocessing directive #ENDIF #ENDIF ^ Compiling .pio/build/nodemcu-32s/libb3d/BLE/BLE2902.cpp.o .pio/libdeps/nodemcu-32s/SmoothThermistor/src/SmoothThermistor.cpp: In member function 'void SmoothThermistor::useAREF(bool)': .pio/libdeps/nodemcu-32s/SmoothThermistor/src/SmoothThermistor.cpp:54:44: error: 'analogReference' was not declared in this scope analogReference(aref? EXTERNAL: DEFAULT); ^ *** [.pio/build/nodemcu-32s/libb97/SmoothThermistor/SmoothThermistor.cpp.o] Error 1 ==================================================== [FAILED] Took 14.45 seconds =======================================
I am using the latest version of arduino-esp32, 2.0.0-rc1. I did backtrack it tot he stable version and compiled and it came up with the same errors, so it can’t be the issue. In any even, here is my platform.ini code:
[env:nodemcu-32s] platform = https://github.com/platformio/platform-espressif32.git#feature/arduino-upstream board = nodemcu-32s framework = arduino platform_packages = framework-arduinoespressif32 @ https://github.com/espressif/arduino-esp32#2.0.0-rc1 upload_port = /dev/cu.SLAB_USBtoUART upload_speed = 921600 monitor_speed = 115200 lib_deps = gilmaimon/ArduinoWebsockets@^0.5.2 bblanchon/ArduinoJson@^6.18.3 protohaus/ESPRandom@^1.4.1 board_build.partitions = partitions_large.csv build_type = debug monitor_filters = log2file, default, esp32_exception_decoder
I’m asking here if anyone else has had issues with this library as it works fine on ArduinoIDE, so I’m figuring there may be a platformio specific issue. If you haven’t used it, maybe you could try installing it and compiling to see if get the same issue.
Thanks for any help.