Hello, I've made this code for writing and reading from a .txt file from my sd card, but the thing is that it doesn't really work. It stops at the SD.begin() if statement most of the times and when i look on my computer at the files inside the sd card they are corrupted and looked like this: └0.Ç└.
I connected the cs pin both to pin 10 and pin 4 but it's the same thing. Please help!
Not enough information, but results like this can arise from connecting a 5V Arduino to a 3.3V SD module without logic level shifters, and the SD card can even be destroyed.
Please read and follow the instructions in the "How to get the best out of this forum" post, linked at the head of every forum category.
The code is made purely for testing the sd reader and when i read on the sd card on computer after running this program i see folders and files corrupted. And i was saying that i tried the program both by connecting the cs pin to pin 10 and to pin 4, separately
The module has two Vcc ports, one for 3.3V and one for 5V so i was thinking that it will be ok to connect to the 5V port. Is it a chance that i broke the module?