1

I am trying to write some data to an SD card with a nodeMCU ESP8266 card. Here is the basic code I use :

#include <SPI.h>
#include <SD.h>

const int CS_PIN = D8;

void setup() {
  Serial.begin(115200);
  if(!SD.begin(CS_PIN)){
    Serial.println("not this time");
  } else {
  File test = SD.open("test.txt", FILE_WRITE);
  test.print("hello");
  test.close();
  Serial.println("ok");
  }
}

void loop() {
}

Here are the wiring I made :

SD       nodeMCU
-----------------
GND        GND
VCC        3.3V
MISO       D6
MOSI       D7
SCK        D5
CS         D8

The SD card format is FAT, as it is asked in the SD.h documentation.

The program can't even open the SD card...

Thank you for your help !

0 Answers0