I'm trying to get my NEO-6M GPS working with my Adafruit Feather M0. Since I cant use software serial, its become a lot harder. I can't get any readings to print out. I know the GPS is working because the red light is flashing on the GPS, indicating its sending data.
I've tried using SERCOM but it's not working. I've included the code below.
#include <Arduino.h> // required before wiring_private.h
#include "wiring_private.h" // pinPeripheral() function
#include "TinyGPS++.h"
TinyGPSPlus gps;
Uart Serial2 (&sercom2, 10, 11, SERCOM_RX_PAD_1, UART_TX_PAD_0);
void SERCOM2_Handler()
{
Serial2.IrqHandler();
}
void setup() {
Serial.begin(115200);
Serial2.begin(115200);
pinPeripheral(10, PIO_SERCOM_ALT);
pinPeripheral(11, PIO_SERCOM_ALT);
}
void loop() {
while(Serial2.available())
{
gps.encode(Serial2.read());
}
if(gps.location.isUpdated())
{
Serial.println("Time: ");
Serial.println(gps.time.value());
Serial.println("Satellite Count: ");
Serial.println(gps.satellites.value());
Serial.println("Lat: ");
Serial.println(gps.location.lat(), 6);
Serial.println("Long: ");
Serial.println(gps.location.lng(), 6);
delay(10);
}
}
This is my first time trying to use SERCOM, any advice or help would be much appreciated.