Not sure what happened but all of a sudden nothing will compile or load for the nano 33 ble.
I can select the uno and it will get further in the compile but understandably error on nano specific code.
#include <Adafruit_PMTK.h>
#include <Adafruit_GPS.h>
#include <NMEA_data.h>
#include <SPI.h>
#include <Wire.h>
#include <Adafruit_GFX.h>
#include <Adafruit_SH110X.h>
#include <splash.h>
#include "RTClib.h"
RTC_PCF8523 rtc;
#define i2c_Address 0x3c //initialize with the I2C addr 0x3C Typically eBay OLED's
#define SCREEN_WIDTH 128 // OLED display width, in pixels
#define SCREEN_HEIGHT 64 // OLED display height, in pixels
#define OLED_RESET -1 // QT-PY / XIAO
#define GPSSerial Serial1
Adafruit_GPS GPS(&GPSSerial);
#define GPSECHO true
Adafruit_SH1107 display = Adafruit_SH1107( SCREEN_HEIGHT, SCREEN_WIDTH,&Wire);
void setup() {
Serial.begin(115200);
delay(5000);
if (! rtc.begin()) {
Serial.println("Couldn't find RTC");
Serial.flush();
while (1) delay(10);
}
if (! rtc.initialized() || rtc.lostPower()) {
Serial.println("RTC is NOT initialized, let's set the time!");
rtc.adjust(DateTime(F(__DATE__), F(__TIME__)));
// rtc.adjust(DateTime(2014, 1, 21, 3, 0, 0));
}
// When the RTC was stopped and stays connected to the battery, it has
// to be restarted by clearing the STOP bit. Let's do this to ensure
// the RTC is running.
rtc.start();
float drift = 43; // seconds plus or minus over oservation period - set to 0 to cancel previous calibration.
float period_sec = (7 * 86400); // total obsevation period in seconds (86400 = seconds in 1 day: 7 days = (7 * 86400) seconds )
float deviation_ppm = (drift / period_sec * 1000000); // deviation in parts per million (μs)
float drift_unit = 4.34; // use with offset mode PCF8523_TwoHours
// float drift_unit = 4.069; //For corrections every min the drift_unit is 4.069 ppm (use with offset mode PCF8523_OneMinute)
int offset = round(deviation_ppm / drift_unit);
// rtc.calibrate(PCF8523_TwoHours, offset); // Un-comment to perform calibration once drift (seconds) and observation period (seconds) are correct
// rtc.calibrate(PCF8523_TwoHours, 0); // Un-comment to cancel previous calibration
Serial.print("Offset is "); Serial.println(offset); // Print to control offset
Serial.println("Adafruit Featherwing GPS library basic parsing test!");
display.begin(0x3c, true); // Address 0x3C default
display.display();
delay(2000);
// Clear the buffer.
display.clearDisplay();
// text display tests
display.setRotation(1);
display.setTextSize(1);
display.setTextColor(SH110X_WHITE);
display.setCursor(0, 0);
display.println("Starting GPS Feather...");
// wait for hardware serial to appear
// while (!Serial) delay(10);
// 9600 baud is the default rate for the Ultimate GPS
GPS.begin(9600);
GPS.sendCommand(PMTK_SET_NMEA_OUTPUT_RMCGGA);
// Set the update rate
GPS.sendCommand(PMTK_SET_NMEA_UPDATE_1HZ); // 1 Hz update rate
// For the parsing code to work nicely and have time to sort thru the data, and
// print it out we don't suggest using anything higher than 1 Hz
// Request updates on antenna status, comment out to keep quiet
// GPS.sendCommand(PGCMD_ANTENNA);
delay(1000);
}
uint32_t timer = millis();
void loop() {
display.display();
delay(2000);
// Clear the buffer.
display.clearDisplay();
// text display tests
display.setRotation(1);
display.setTextSize(1);
display.setTextColor(SH110X_WHITE);
display.setCursor(0, 0);
DateTime now = rtc.now();
Serial.print(now.year(), DEC);
Serial.print('/');
Serial.print(now.month(), DEC);
Serial.print('/');
Serial.print(now.day(), DEC);
Serial.print("-");
Serial.print(now.hour(), DEC);
Serial.print(':');
Serial.print(now.minute(), DEC);
Serial.print(':');
Serial.print(now.second(), DEC);
Serial.println();
display.print(now.year(), DEC);
display.print('/');
display.print(now.month(), DEC);
display.print('/');
display.print(now.day(), DEC);
display.print("-");
display.print(now.hour(), DEC);
display.print(':');
display.print(now.minute(), DEC);
display.print(':');
display.print(now.second(), DEC);
display.println();
/* if (Serial.available()) {
char c = Serial.read();
GPS.write(c);
display.println("Starting GPS Feather...");
}*/
if (GPS.newNMEAreceived()) {
// a tricky thing here is if we print the NMEA sentence, or data
// we end up not listening and catching other sentences!
// so be very wary if using OUTPUT_ALLDATA and trytng to print out data
//Serial.println(GPS.lastNMEA()); // this also sets the newNMEAreceived() flag to false
if (!GPS.parse(GPS.lastNMEA())) // this also sets the newNMEAreceived() flag to false
return; // we can fail to parse a sentence in which case we should just wait for another
}
display.print("\nTime: ");
if (GPS.hour < 10) {
display.print('0');
}
display.print(GPS.hour, DEC); display.print(':');
if (GPS.minute < 10) {
display.print('0');
}
display.print(GPS.minute, DEC); display.print(':');
if (GPS.seconds < 10) {
display.print('0');
}
display.print(GPS.seconds, DEC); display.print('.');
if (GPS.milliseconds < 10) {
display.print("00");
} else if (GPS.milliseconds > 9 && GPS.milliseconds < 100) {
display.print("0");
}
display.println(GPS.milliseconds);
display.print("Date: ");
display.print(GPS.day, DEC); display.print('/');
display.print(GPS.month, DEC); display.print("/20");
display.println(GPS.year, DEC);
display.print("Fix: "); display.print((int)GPS.fix);
display.print(" quality: "); display.println((int)GPS.fixquality);
if (GPS.fix) {
display.print("Location: ");
display.print(GPS.latitude, 4); display.print(GPS.lat);
display.print(", ");
display.print(GPS.longitude, 4); display.println(GPS.lon);
display.print("Speed (knots): "); display.println(GPS.speed);
display.print("Angle: "); display.println(GPS.angle);
display.print("Altitude: "); display.println(GPS.altitude);
display.print("Satellites: "); display.println((int)GPS.satellites);
display.print("Antenna status: "); display.println((int)GPS.antenna);
}
}
Arduino: 1.8.19 (Linux), Board: "Adafruit Feather M0 (SAMD21), Fast (-O2), Arduino, Off"
/home/pi/Arduino/libraries/Adafruit_GPS_Library/src/NMEA_build.cpp: In member function 'char* Adafruit_GPS::build(char*, const char*, const char*, char, bool)':
/home/pi/Arduino/libraries/Adafruit_GPS_Library/src/NMEA_build.cpp:76:10: warning: 'char* strncpy(char*, const char*, size_t)' specified bound depends on the length of the source argument [-Wstringop-overflow=]
76 | strncpy(p, thisSource, strlen(thisSource));
| ~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/home/pi/Arduino/libraries/Adafruit_GPS_Library/src/NMEA_build.cpp:78:10: warning: 'char* strncpy(char*, const char*, size_t)' specified bound depends on the length of the source argument [-Wstringop-overflow=]
78 | strncpy(p, thisSentence, strlen(thisSentence));
| ~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
In member function 'char* Adafruit_GPS::parseStr(char*, char*, int)',
inlined from 'char* Adafruit_GPS::parseStr(char*, char*, int)' at /home/pi/Arduino/libraries/Adafruit_GPS_Library/src/NMEA_parse.cpp:751:7:
/home/pi/Arduino/libraries/Adafruit_GPS_Library/src/NMEA_parse.cpp:766:14: warning: 'char* strncpy(char*, const char*, size_t)' specified bound depends on the length of the source argument [-Wstringop-overflow=]
766 | strncpy(buff, p, len); // or to the end or max capacity
| ~~~~~~~^~~~~~~~~~~~~~
/home/pi/Arduino/libraries/Adafruit_GPS_Library/src/NMEA_parse.cpp: In member function 'char* Adafruit_GPS::parseStr(char*, char*, int)':
/home/pi/Arduino/libraries/Adafruit_GPS_Library/src/NMEA_parse.cpp:765:28: note: length computed here
765 | len = min((int)strlen(p), n - 1);
| ~~~~~~^~~
/tmp/ccJgvTXC.s: Assembler messages:
/tmp/ccJgvTXC.s:934: Error: lo register required -- `sub r10,#1'
Multiple libraries were found for "Adafruit_PMTK.h"
Used: /home/pi/Arduino/libraries/Adafruit_GPS_Library
Not used: /home/pi/Arduino/libraries/Adafruit_GPS
exit status 1
Error compiling for board Adafruit Feather M0 (SAMD21).
This report would have more information with
"Show verbose output during compilation"
option enabled in File -> Preferences.