My daughter and I are trying to get a ebay purchased MicroSD Card Reader board and Sparkfun MicroOLED (LCD-13003) to work together on the SPI bus on an Arduino UNO.
We are using SPI, SD, and SFE_MicroOLED libraries
Micro SD CS is on pin 7
OLED CS is on pin 10
Both share MOSI on pin 11 & SCK on pin 13
SD Card uses MISO on pin 12 (OLED does not use MISO but does use DC on pin 8 & RESET on Pin 9)
We have declared both CS pins as OUTPUT
Following the examples in the Arduino program, we have been able to get both to work independently in this set up.
We want to display some numbers and write those numbers to the SD card for later use.
When trying to integrate we are running into problems and are banging our collective heads on 2x4s with rusty nails in them.
Have tried:
In Setup()
Set Serial Baud to 9600 in Setup()
Set both OLED CS HIGH and SD CS LOW
Open text file and write text to file
Close text file
Set SD CS HIGH
Set OLED LOW
Write to OLED Screen
Set OLED HIGH
In loop()
set OLED CS LOW
Write to OLED Screen
set OLED CS HIGH
Serial Print same information as to OLED
set SD CS LOW
Open SD
Write same information to SD Card using if loop
Close SD
set SD CS HIGH
When trying this - the SD card does not get written to but the file gets created
When changing the order - the OLED does not get displayed to
Added as bunch of Serial Prints to track where in the code things were not working
Even encountered the setup continuously looping an never getting getting to the main program loop.
We are looking for guidance on how to make this work and to understand what is going on.
Note that neither of us are programmers and we do not know C or C++
Thank you