diff options
author | Matthias P. Braendli <matthias.braendli@mpb.li> | 2023-05-18 13:33:06 +0200 |
---|---|---|
committer | Matthias P. Braendli <matthias.braendli@mpb.li> | 2023-05-18 13:33:06 +0200 |
commit | a574c239214a963bec1a2229c077af261130277c (patch) | |
tree | 9ad620af11d28bbb7f4a97c58c5f88a84f15e42f /src | |
parent | cb1cc5e64c0db865de76de2e34f1bcb5f90a2dfd (diff) | |
download | lora-aprs-hb9egm-a574c239214a963bec1a2229c077af261130277c.tar.gz lora-aprs-hb9egm-a574c239214a963bec1a2229c077af261130277c.tar.bz2 lora-aprs-hb9egm-a574c239214a963bec1a2229c077af261130277c.zip |
Add SD card
Diffstat (limited to 'src')
-rw-r--r-- | src/main.ino | 13 |
1 files changed, 13 insertions, 0 deletions
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 <RadioLib.h> #include <Wire.h> #include <SparkFun_u-blox_GNSS_Arduino_Library.h> +#include <SD.h> + +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); |