Adafruit_FeatherOLED icon indicating copy to clipboard operation
Adafruit_FeatherOLED copied to clipboard

can't compile on PlatformIO for Adafruit Feather S2, #define VBATPIN A13 error

Open EtoTen opened this issue 2 years ago • 1 comments

VSCode, PlatformIO (latest)

platformio.ini:

[env:featheresp32-s2]
platform = espressif32
board = featheresp32-s2
framework = arduino
lib_deps = 
	plerup/EspSoftwareSerial@^7.0.0
	arcao/Syslog@^2.0.0
	makerspaceleiden/TLog@^1.0.3
	arduino-libraries/ArduinoHttpClient@^0.4.0
	jchristensen/movingAvg@^2.3.1
	arduino-libraries/NTPClient@^3.2.1
	adafruit/Adafruit GFX Library@^1.11.5
	adafruit/Adafruit NeoPixel@^1.10.7
	rlogiacco/CircularBuffer@^1.3.3
	yiannisbourkelis/Uptime Library@^1.0.0
	https://github.com/adafruit/Adafruit_FeatherOLED
	https://github.com/knolleary/pubsubclient
	https://github.com/adafruit/Adafruit_LC709203F

Board definition: https://github.com/platformio/platform-espressif32/blob/master/boards/featheresp32-s2.json "name": "Adafruit ESP32-S2 Feather Development Board"

Compile error:


In file included from .pio/libdeps/featheresp32-s2/Adafruit Feather OLED/Adafruit_FeatherOLED.cpp:43:
.pio/libdeps/featheresp32-s2/Adafruit Feather OLED/Adafruit_FeatherOLED.cpp: In member function 'float Adafruit_FeatherOLED::getBatteryVoltage()':
.pio/libdeps/featheresp32-s2/Adafruit Feather OLED/Adafruit_FeatherOLED.h:48:17: error: 'A13' was not declared in this scope
 #define VBATPIN A13
                 ^~~
.pio/libdeps/featheresp32-s2/Adafruit Feather OLED/Adafruit_FeatherOLED.cpp:180:21: note: in expansion of macro 'VBATPIN'
   return analogRead(VBATPIN) * VBAT_MULTIPLIER;
                     ^~~~~~~
.pio/libdeps/featheresp32-s2/Adafruit Feather OLED/Adafruit_FeatherOLED.h:48:17: note: suggested alternative: 'T13'
 #define VBATPIN A13
                 ^~~
.pio/libdeps/featheresp32-s2/Adafruit Feather OLED/Adafruit_FeatherOLED.cpp:180:21: note: in expansion of macro 'VBATPIN'
   return analogRead(VBATPIN) * VBAT_MULTIPLIER;
                     ^~~~~~~
*** [.pio\build\featheresp32-s2\lib256\Adafruit Feather OLED\Adafruit_FeatherOLED.cpp.o] Error 1
In file included from .pio/libdeps/featheresp32-s2/Adafruit Feather OLED/Adafruit_FeatherOLED_SH110X.h:11,
                 from .pio/libdeps/featheresp32-s2/Adafruit Feather OLED/Adafruit_FeatherOLED_SH110X.cpp:42:
.pio/libdeps/featheresp32-s2/Adafruit Feather OLED/Adafruit_FeatherOLED_SH110X.cpp: In member function 'float Adafruit_FeatherOLED_SH110X::getBatteryVoltage()':
.pio/libdeps/featheresp32-s2/Adafruit Feather OLED/Adafruit_FeatherOLED.h:48:17: error: 'A13' was not declared in this scope
 #define VBATPIN A13
                 ^~~
.pio/libdeps/featheresp32-s2/Adafruit Feather OLED/Adafruit_FeatherOLED_SH110X.cpp:183:21: note: in expansion of macro 'VBATPIN'
   return analogRead(VBATPIN) * VBAT_MULTIPLIER;
                     ^~~~~~~
.pio/libdeps/featheresp32-s2/Adafruit Feather OLED/Adafruit_FeatherOLED.h:48:17: note: suggested alternative: 'T13'
 #define VBATPIN A13
                 ^~~
.pio/libdeps/featheresp32-s2/Adafruit Feather OLED/Adafruit_FeatherOLED_SH110X.cpp:183:21: note: in expansion of macro 'VBATPIN'
   return analogRead(VBATPIN) * VBAT_MULTIPLIER;
                     ^~~~~~~
*** [.pio\build\featheresp32-s2\lib256\Adafruit Feather OLED\Adafruit_FeatherOLED_SH110X.cpp.o] Error 1

I am assuming that the define "ARDUINO_ADAFRUIT_FEATHER_ESP32S2" does not get defined in my environment for some reason and thus the check "#elif defined(ESP32) && !defined(ARDUINO_ADAFRUIT_FEATHER_ESP32S2) " Adafruit_FeatherOLED.h:46 still passes and tries to set an invalid pin for the S2

EtoTen avatar Jan 31 '23 11:01 EtoTen