So recently I have been trying to create a file using the PaulStoffregen SerialFlash but could never succeed for some reason.
#include <SPI.h>
#include <Arduino_MKRGPS.h>
#include <SerialFlash.h>
const int FlashChipSelect = 5;
const char *filename = DATA.TXT;
uint32_t length = 1999000;
void setup() {
Serial.begin(9600);
while (!Serial) {
;
}
GPS.begin();
if (!SerialFlash.begin(FlashChipSelect)) {
error("Unable to access SPI Flash chip");
} Serial.println("Connection successful");
SerialFlash.createErasable(filename, length);
}
void loop() {
GPS.wakeup();
retry:
if (GPS.available())
{
float latitude = GPS.latitude();
float longitude = GPS.longitude();
float altitude = GPS.altitude();
float speed = GPS.speed();
float satellites = GPS.satellites();
float course = GPS.course();
}
}
void error(const char *message) {
while (1) {
Serial.println(message);
delay(2500);
}
}
This is my code and when I run it I get this error
C:\Users\user\OneDrive\Documents\Arduino\sketch_sep9a\sketch_sep9a.ino:5:24: error: 'DATA' was not declared in this scope
const char *filename = DATA.TXT;
^~~~
C:\Users\user\OneDrive\Documents\Arduino\sketch_sep9a\sketch_sep9a.ino:5:24: note: suggested alternative: 'DAC'
const char *filename = DATA.TXT;
^~~~
DAC
exit status 1
Compilation error: 'DATA' was not declared in this scope
On GitHub there is very little information on creating the files or how to approach any errors that may occur.
I'm very confused as to why DATA is not declared and have no idea how to fix it, any help is very appreciated.