I am experiencing a bizarre issue where a small part of my OLED display will glitch out, based on the existence of functions that aren't even called.
My wiring is as follows:
A4 and A5 go to sda and scl, gnd to gnd, and 5V to vcc.
A0, A1, and A2, are each connected to the other gnd line.
In my code, it starts by running Cordpage, and will run only that function unless one of the button pins is grounded. Bladepage, Crosspage, and Lamepage do not run(and wouldn't really do anything even if they were called). However, despite the fact that this is running Cordpage, and never changing to another, there is a small burst of static in the lower right. This static goes away if ANY of the other pages are commented out in the loop. For example, the only difference between my two files is that in the loop
if(page == bladepage){
Bladepage();
}
has been replaced with
if(page == bladepage){
//Bladepage();
}
yet, in spite of the fact that Bladepage is never called, this removes the static. This also works for Crosspage and Lamepage.
These are the displays in question.
In principle, I know there might be ways to try and circumvent this issue, like clearing and rewriting the display each time. I haven't given those much consideration yet, because for now, I just want to know WHY it's glitching out like this; it makes absolutely no sense to me that this should be an issue.
Can anyone give me any insight into why this is happening? I'm losing my mind.
sketch_sep12c.ino (11.3 KB)
sketch_sep12d.ino (11.3 KB)