Alright,
I'm using an OSEPP UNO board with the Adafruit datalogger shield attached. I've removed much of the code to try to reduce the memory required. I'm using the OLED ssd1306 128x64 breakout board. I started with the example code from adafruit (File>examples>Adafruit_1306SSD>1306SSD_128x64_spi). I did the modifications for hardware driven SPI using the following pin assignments:
Reset 3 --> 7 (was 13)
CS 5 --> 9 (was 12)
D/C 9 --> 8 (was 11)
CLK 11 --> 13 (was 10)
DAT/MOSI 14 --> 11 (was 9)
This is from the previous post but I changed CS to from 10 to 9 because I believe the datalogger shield uses 10. Here's the front end of the code.
#include <Wire.h>
#include <Adafruit_GFX.h>
#include <Adafruit_SSD1306.h>
#include <SPI.h>
#include <SdFat.h>
#include <SdFatUtil.h> // use PgmPrint
#include <Wire.h>
#include "RTClib.h"
//#include <math.h>
RTC_DS1307 RTC; // define the Real Time Clock object
// The objects to talk to the SD card
Sd2Card card;
SdVolume volume;
SdFile root;
SdFile file;
#define OLED_DC 8
#define OLED_CS 9
#define OLED_CLK 13
#define OLED_MOSI 11
#define OLED_RESET 7
Adafruit_SSD1306 display(OLED_MOSI, OLED_CLK, OLED_DC, OLED_RESET, OLED_CS);
#define NUMFLAKES 10
#define XPOS 0
#define YPOS 1
#define DELTAY 2
#define LOGO16_GLCD_HEIGHT 16
#define LOGO16_GLCD_WIDTH 16
static unsigned char __attribute__ ((progmem)) logo16_glcd_bmp[]={
0x30, 0xf0, 0xf0, 0xf0, 0xf0, 0x30, 0xf8, 0xbe, 0x9f, 0xff, 0xf8, 0xc0, 0xc0, 0xc0, 0x80, 0x00,
0x20, 0x3c, 0x3f, 0x3f, 0x1f, 0x19, 0x1f, 0x7b, 0xfb, 0xfe, 0xfe, 0x07, 0x07, 0x07, 0x03, 0x00, };
#if (SSD1306_LCDHEIGHT != 64)
#error("Height incorrect, please fix Adafruit_SSD1306.h!");
#endif
void setup() {
Serial.begin(9600);
// by default, we'll generate the high voltage from the 3.3v line internally! (neat!)
display.begin(SSD1306_SWITCHCAPVCC);
// init done
display.display(); // show splashscreen
delay(2000);
display.clearDisplay(); // clears the screen and buffer
}
The rest of the code is just the example code unmodified. If I upload this the uno, it displays the adafruit industry logo but it's garbled. If I comment out the two sdFile lines, it is fine.
Thanks for your help