Codey OnlineArduino- & ESP32-Komponentenbibliothek › Micro-SD Card Reader 3.3V
Micro-SD Card Reader 3.3V
Sensoren

Micro-SD Card Reader 3.3V

Dies ist ein 3,3V microSD-Kartenleser-Modul, mit dem ein Mikrocontroller über den SPI-Bus mit einer microSD-Karte kommunizieren kann. Es verwendet CS (chip select) zusammen mit MOSI, MISO und CLK und teilt sich GND sowie eine 3,3V-Versorgung mit dem System.

Breite: 21.2 mm

Pinbelegung — Micro-SD Card Reader 3.3V

Pin Signal Beschreibung
3V3 power 3.3V power input for the microSD card reader; use only 3.3V logic/power.
CS chip-select SPI chip-select input for the microSD card; active low.
MOSI MOSI SPI data from host MCU to microSD card.
CLK SCK SPI clock input from the host MCU to the microSD card.
MISO MISO SPI data output from microSD card to host MCU.
GND ground Ground reference for power and SPI signals.

Beispielschaltplan — Micro-SD Card Reader 3.3V

Von Nach Kabel
board:5V x1:3V3 red
board:GND x1:GND black
board:D10 x1:CS green
board:D11 x1:MOSI blue
board:D13 x1:CLK yellow
board:D12 x1:MISO purple

Arduino-Beispielcode — Micro-SD Card Reader 3.3V

Dieses Beispiel wurde für das arduino-uno geschrieben und kompiliergeprüft. Codey Online passt es für jedes andere unterstützte Board an.

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

const int SD_CS_PIN = 10;

void setup() {
  Serial.begin(9600);
  while (!Serial) {
    ;
  }

  Serial.println("Micro-SD Card Reader 3.3V example");
  Serial.println("Initializing SD card...");

  pinMode(SD_CS_PIN, OUTPUT);
  digitalWrite(SD_CS_PIN, HIGH);

  if (!SD.begin(SD_CS_PIN)) {
    Serial.println("SD card initialization failed!");
    Serial.println("Check wiring, card format, and that the module is powered correctly.");
    while (true) {
      delay(1000);
    }
  }

  Serial.println("SD card initialized successfully.");

  File root = SD.open("/");
  if (root) {
    Serial.println("Files on the card:");
    printDirectory(root, 0);
    root.close();
  } else {
    Serial.println("Could not open root directory.");
  }
}

void loop() {
  // Simple periodic status message so you can see the sketch is running.
  Serial.println("SD card ready.");
  delay(2000);
}

void printDirectory(File dir, int numTabs) {
  while (true) {
    File entry = dir.openNextFile();
    if (!entry) {
      break;
    }

    for (int i = 0; i < numTabs; i++) {
      Serial.print('\t');
    }

    Serial.print(entry.name());
    if (entry.isDirectory()) {
      Serial.println("/");
      printDirectory(entry, numTabs + 1);
    } else {
      Serial.print("\t");
      Serial.println(entry.size(), DEC);
    }

    entry.close();
  }
}

Ähnliche Komponenten

18650 Battery Shield with USB-C Charger and 5V Boost Converter

18650 Battery Shield with USB-C Charger and 5V Boost Converter

2.4 inch OLED Display I2C 3.3V

2.4 inch OLED Display I2C 3.3V

3.5 inch TFT LCD Shield

3.5 inch TFT LCD Shield

50kg Load Cell Weight Sensor

50kg Load Cell Weight Sensor

Bau dein Arduino- oder ESP32-Projekt mit AI

Beschreib einfach, was du bauen willst. Codey Online schreibt den Code, zeichnet den Schaltplan, kompiliert alles und flasht dein Board direkt aus dem Browser.

Kostenlos starten