Problem with usin both a OLED-Display AND a SD card reader

Hi I'am a newbie,

i want to create a testproject with a little output on a OLED display (0,96 Zoll I2C IIC SPI serielle 128 x 64 OLED LCD LED Display-Module uses i2c-bus) and a testwrite to a SD-Card device (SPI Reader Micro Speicher SD TF Karte Memory Card Shield Module) .

MyCode is:

#include <SD.h>
#include <SPI.h>
#include <SimpleDHT.h>
#include <Adafruit_SSD1306.h>
#include <gfxfont.h>
#include <Adafruit_GFX.h>
#include <Wire.h>

int CS_PIN = 10;
int x=0;

File file;

#define OLED_RESET 4

//Adafruit_SSD1306 display(OLED_RESET); <------------ This Line!!!

void setup()
{
pinMode(CS_PIN, OUTPUT);
SD.begin();
delay(500);
file=SD.open("MYTest.txt", FILE_WRITE); 
file.println("BALALALAALLA");
file.close(); 



 
}
void loop()
{
//display.begin(SSD1306_SWITCHCAPVCC, 0x3C);
//display.clearDisplay();
//display.display();
//display.setTextColor(WHITE);
//display.println("cccccc");
  //display.display();
}

But the program works either when the display commands or the file commands are commented out.

The code above works. But when I include the Adafruit line marked with <------------ This Line!!! the Program dosen't work anymore.
Is it possible that the I2C-Bus (Display) and the SPI (Card) are incompaible. I have no idea. Maybe someone can help me.

Grettings
tola

OK i checked the RAM - it is full of Libraries.

Adafruit SSD1306 lib occupy 1024 bytes for the display. Maybe you should look for a graphics lib which requires lesser RAM.

Oliver

Or a part with more SRAM, '1284P with 16K SRAM.
Here's one of several form factors I offer, this one very Uno like:
http://www.crossroadsfencing.com/BobuinoRev17/

Add Mightycore to your IDE and select Bobuino board type.

olikraus:
Adafruit SSD1306 lib occupy 1024 bytes for the display. Maybe you should look for a graphics lib which requires lesser RAM.

Oliver

The library to look for is u8g2 by olikraus, it needs less ram afaik. It is available with Library Manager.