ESP32 Learn

SPI on ESP32: Basics & SD Card

2025-09-20 路 ~1 min read
Table of contents
 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
#include <SPI.h>

#include <SD.h>

void setup() {
  Serial.begin(115200);
  if (!SD.begin()) {
    Serial.println("SD mount failed");
    return;
  }
  File f = SD.open("/hello.txt", "w");
  f.println("ESP32 SD OK");
  f.close();
}
void loop() {}

馃敄 #spi #sdcard