From a574c239214a963bec1a2229c077af261130277c Mon Sep 17 00:00:00 2001 From: "Matthias P. Braendli" Date: Thu, 18 May 2023 13:33:06 +0200 Subject: Add SD card --- src/main.ino | 13 +++++++++++++ 1 file changed, 13 insertions(+) (limited to 'src') diff --git a/src/main.ino b/src/main.ino index 4bcca3e..da82e01 100644 --- a/src/main.ino +++ b/src/main.ino @@ -2,6 +2,11 @@ #include #include #include +#include + +File myFile; + +constexpr int SD_CS = 17; // SX1278 has the following connections: // NSS pin: PD14 (Arduino 10) @@ -49,6 +54,14 @@ void setup() { Serial.begin(9600); pinMode(LED_BUILTIN, OUTPUT); + pinMode(SD_CS, OUTPUT); + + if (!SD.begin(SD_CS)) { + Serial.println("SD init failed!"); + return; + } + + Wire.begin(); SerialGNSS.begin(9600); -- cgit v1.2.3