File tree Expand file tree Collapse file tree 1 file changed +37
-0
lines changed
examples/examples-custom-boards/lyrat-mini/sd Expand file tree Collapse file tree 1 file changed +37
-0
lines changed Original file line number Diff line number Diff line change
1
+
2
+ // The following should work: but unforunately it does not work for me!
3
+
4
+ #include < SPI.h>
5
+ #include < SD.h>
6
+
7
+ // These pins are defined in the HAL
8
+ #define PIN_SD_CARD_CS 13
9
+ #define PIN_SD_CARD_MISO 2
10
+ #define PIN_SD_CARD_MOSI 15
11
+ #define PIN_SD_CARD_CLK 14
12
+
13
+ // Arduino Setup
14
+ void setup (void ) {
15
+ Serial.begin (115200 );
16
+
17
+ // setup SPI
18
+ SPI.begin (PIN_SD_CARD_CLK, PIN_SD_CARD_MISO, PIN_SD_CARD_MOSI, PIN_SD_CARD_CLK);
19
+
20
+ // Setup SD and open file
21
+ if (!SD.begin (PIN_SD_CARD_CLK, SPI)){
22
+ Serial.println (" SD.begin failed" );
23
+ while (true );
24
+ }
25
+
26
+ auto file = SD.open (" /audio8000.raw" , FILE_READ);
27
+ if (!file){
28
+ Serial.println (" file open failed" );
29
+ while (true );
30
+ }
31
+
32
+ Serial.println (" Success" );
33
+ }
34
+
35
+ // Arduino loop - repeated processing
36
+ void loop () {
37
+ }
You can’t perform that action at this time.
0 commit comments