Datasheet

Once you know the SD card works, check out the SD card library examples, SD library documentation and Notes!
Example logging sketch
If you want to try saving data to the SD card in the simplest sketch, try this example. You can adjust the delay() to set
how often analog data is read from pin A0 and saved to the SD card. The red LED will blink if there's an error, and the
green LED will blink when data is written to the SD card.
Note that to save power, we
buffer
the data, so you will only 'save' data truely every 50 datapoints (512 total characters
written)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
You will need to change the sketch's SD_CS pin to match the SD card's Chip Select pin on your Feather!
#include <SPI.h>
#include <SD.h>
// Set the pins used
#define cardSelect 4
File logfile;
// blink out an error code
void error(uint8_t errno) {
while(1) {
uint8_t i;
for (i=0; i<errno; i++) {
digitalWrite(13, HIGH);
delay(100);
digitalWrite(13, LOW);
delay(100);
}
for (i=errno; i<10; i++) {
delay(200);
}
}
}
// This line is not needed if you have Adafruit SAMD board package 1.6.2+
// #define Serial SerialUSB
void setup() {
// connect at 115200 so we can read the GPS fast enough and echo without dropping chars
// also spit it out
Serial.begin(115200);
Serial.println("\r\nAnalog logger test");
pinMode(13, OUTPUT);
// see if the card is present and can be initialized:
if (!SD.begin(cardSelect)) {
Serial.println("Card init. failed!");
error(2);
}
char filename[15];
© Adafruit Industries https://learn.adafruit.com/adafruit-adalogger-featherwing Page 26 of 36