ESP8266 WeMos D1 Mini + SD Card Connection
Автор: Electricum
Загружено: 21 апр. 2025 г.
Просмотров: 119 просмотров
WeMos D1 Mini + SD Card Connection
1. Wiring (SPI Mode)
SD Module WeMos D1 Mini
VCC 3.3V or 5V*
GND GND
CS D8 (GPIO15)
MOSI D7 (GPIO13)
MISO D6 (GPIO12)
SCK D5 (GPIO14)
Use 3.3V if the module supports it (some 5V modules need level shifters).
________________________________________
2. Key Code Logic
Initialize SD Card:
SD.begin(D8); // ChipSelect=D8
Write Data (Overwrite Mode):
File file = SD.open("/data.txt", FILE_WRITE);
file.println("Hello, SD!");
file.close();
Read Data:
File file = SD.open("/data.txt");
while (file.available()) Serial.write(file.read());
file.close();
________________________________________
3. Common Fixes check if card not working
Duplicate Data? → Delete old file first:
if (SD.exists("/data.txt")) SD.remove("/data.txt");
SD Not Detected?
o Check wiring (especially CS).
o Reformat SD card (FAT32).
o Add delay(1000) before SD.begin().
________________________________________
4. Expected Output
Copy
SD initialized.
File written.
File content:
Hello, SD!
________________________________________
Code:
https://github.com/ukkokalevala/SDcar...

Доступные форматы для скачивания:
Скачать видео mp4
-
Информация по загрузке: