I recently found interesting issue, that display is not displaying properly, or even can't properly allocate the memory, because of existance of code related to arrays - getting array value with index converted out of string, to be precise.
I'm adding code with the way display is set:
if (!display.begin(SSD1306_SWITCHCAPVCC, 0x3C)) {
Serial.println(F("SSD1306 allocation failed"));
for (;;);
}
and the part of code that added is causing the issue
String number = "15";
int newInterpolationData[][2] = {
{1022, 1019}, {1017, 1014}, {1012, 1008}, {1005, 1000},
{997, 994}, {990, 986}, {982, 971}, {956, 924},
{907, 874}, {860, 824}, {813, 776}, {763, 726},
{713, 678}, {665, 629}, {616, 578}, {565, 529},
{509, 479}, {460, 430}, {411, 380}, {363, 332},
{311, 282}, {264, 234}, {215, 184}, {167, 136},
{119, 87}, {71, 43}, {43, 35}, {35, 28},
{26, 20}, {18, 12}, {11, 7}
};
Serial.println(newInterpolationData[number.toInt()][0]);
I tested different configurations and display didn't allocate, or displaying was someting like offseted.
What can be the source of this issue? Changing "number.toInt()" to some fixed value solves the issue.