Getting started with Adafruit's Micro-SD Breakout Board in 2 minutes.
Wiring
Wiring the Breakout board is very simple.
- Connect the 5v pin to the 5V pin on the Arduino
- Connect the GND pin to one of the three GND pin on the Arduino
- Connect CLK to pin 13
- Connect DO to pin 12
- Connect DI to pin 11
- Connect CS to pin 10
Picture shamelessly taken from its home at adafruit.com
Programming
To use the Micro-SD you need to include the SD.h library at the top of your program. Then add the following line of code to your setup() function:
SD.begin(10);
Now you can write something on the card:
File logFile = SD.open("log.txt",FILE_WRITE);
if(logFile){
logFile.println(“Hello World!”);
logFile.close();
}
Finally, while humming the MissionImpossible theme, you can power off the Arduino board, take the Micro-SD card out, put the micro-SD card in an SD card adaptor, put the SD card adaptor in your laptop and look at your new file.
Interesing project,
ReplyDeletewhat is arduino
Thanks for reading. If you have any questions, go ahead!
ReplyDeletegoogle 3477
ReplyDeletegoogle 3478
google 3479
google 3480
google 3481