i dont know why this started. i tried updating /rolling back my library for the display but nothing worked. whats causing this to crash? it only crashes if i use display.display()
#include <Adafruit_SSD1306.h>
#define OLED_RESET LED_BUILTIN
unsigned long SecondsOn=0;
Adafruit_SSD1306 display(OLED_RESET);
void setup() {
display.begin(SSD1306_SWITCHCAPVCC, 0x3C);
display.clearDisplay();
display.setTextSize(2);
display.setTextColor(WHITE);
}
void loop() {
delay(100);
SecondsOn++;
display.clearDisplay();
display.setCursor(0, 0);
display.print(SecondsOn);
display.print(" `F ");
display.display();
}
Maybe you don't have an adequate power supply.
I don't know much about the displays you are using, and you haven't clued us into what hardware your are using, but when glancing over the tutorial, I noticed that your constructor doesn't have half the stuff the examples have.
Adafruit_SSD1306 display(OLED_RESET);// Adafruit_SSD1306 display(SCREEN_WIDTH, SCREEN_HEIGHT, &Wire, OLED_RESET);
Perehama:
I don't know much about the displays you are using, and you haven't clued us into what hardware your are using, but when glancing over the tutorial, I noticed that your constructor doesn't have half the stuff the examples have.
Adafruit_SSD1306 display(OLED_RESET);// Adafruit_SSD1306 display(SCREEN_WIDTH, SCREEN_HEIGHT, &Wire, OLED_RESET);
The way i understand is unless i manually specify screen width and height it will use the default,
using
#define SCREEN_WIDTH 128 // OLED display width, in pixels
#define SCREEN_HEIGHT 32 // OLED display height, in pixels
// Declaration for an SSD1306 display connected to I2C (SDA, SCL pins)
#define OLED_RESET LED_BUILTIN // Reset pin # (or -1 if sharing Arduino reset pin)
Adafruit_SSD1306 display(SCREEN_WIDTH, SCREEN_HEIGHT, &Wire, OLED_RESET);
adding wire solved the problem. weird it wasnt a problem i dont think until i update esparduino core