// ESP32-C6 + GPS sensor from SeeedStudio
#include <Arduino.h>

// GPS pins
#define GPS_RX D7
#define GPS_TX D6

void setup() {
  Serial.begin(115200);        // USB Serial Monitor
  delay(1000);
  
  // Start Serial1 (hardware UART) for GPS
  Serial1.begin(9600, SERIAL_8N1, GPS_RX, GPS_TX);   // RX=GPIO7 (D7), TX=GPIO6 (D6)
  
  Serial.println("=== ESP32-C6 + Grove GPS Air530 (Serial1) ===");
  Serial.println("Waiting for GPS data... Place module near window or outside");
}

void loop() {
  // Print all incoming GPS data to Serial Monitor
  while (Serial1.available()) {
    char c = Serial1.read();
    Serial.write(c);
  }

  // Status message every 5 seconds
  static unsigned long last = 0;
  if (millis() - last > 5000) {
    Serial.println("\n--- Waiting for GPS fix (green LED blinking) ---");
    last = millis();
  }
}