Replies: 2 comments 1 reply
-
So you have this code and it works but you don't know why?
Yeah that's great and matches the arduino-pico/variants/rpipico/pins_arduino.h Lines 17 to 20 in c4f3617 Not sure what all the commented out code for SPI1 is about since, if you call arduino-pico/libraries/SD/src/SD.h Lines 34 to 41 in c4f3617 |
Beta Was this translation helpful? Give feedback.
-
BUT I did not defined SPI pins at all. |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
Anybody could explain me, how this code from Datalogger example could work:
const int _CS = 22;
//#include <SPI.h>
#include <SD.h>
void setup() {
// Open serial communications and wait for port to open:
Serial.begin(115200);
while (!Serial);
Serial.print("Initializing SD card...");
// Ensure the SPI pinout the SD card is connected to is configured properly
//SPI1.setRX(_MISO);
//SPI1.setTX(_MOSI);
//SPI1.setSCK(_SCK);
// see if the card is present and can be initialized:
if (!SD.begin(_CS)) {
Serial.println("Card failed, or not present");
// don't do anything more:
return;
}
Serial.println("card initialized.");
Yes, it successfuly compiled and works onboard with the folliwing pins:
MISO = 16;
MOSI = 19;
SCK = 18;
Beta Was this translation helpful? Give feedback.
All reactions