Skip to content

Commit

Permalink
pps stuf
Browse files Browse the repository at this point in the history
  • Loading branch information
gauteh committed Oct 1, 2024
1 parent cd6a683 commit 28679be
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 6 deletions.
13 changes: 9 additions & 4 deletions sfy-buoy/sfy-ext-gps/ext-gps-mod/demo_gps.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ void setup_gps() {
if (ok) ok = gnss.setI2CInput(COM_TYPE_UBX);
if (ok) ok = gnss.setUART1Output(0);
if (ok) ok = gnss.setUART1Input(0);
if (ok) ok = gnss.setNavigationFrequency(1); //Set output in Hz.
if (ok) ok = gnss.setNavigationFrequency(20); //Set output in Hz.

Serial.print(F("GPS setup flag: "));
Serial.println(ok);
Expand All @@ -61,8 +61,12 @@ void setup_gps() {

void loop_gps() {
// TODO: move these to PPS?
gnss.checkUblox();
gnss.checkCallbacks();
/* gnss.checkUblox(); */
/* gnss.checkCallbacks(); */
/* if (gnss.newdata()) { */
/* data = gnss.getdata(); */
/* getPVT(data); */
/* } */
}


Expand All @@ -71,8 +75,9 @@ void pps() {
pps_ts = micros();

Serial.println("GNSS: PPS!");
gnss.checkUblox();
gnss.checkCallbacks();

// TODO: checkUblox + checkCallbacks
}

# endif
15 changes: 13 additions & 2 deletions sfy-buoy/sfy-ext-gps/ext-gps-mod/ext-gps-mod.ino
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,10 @@
// Serial to SFY
// TX1: ~7 / 42
// RX1: ~8 / 38
Uart sfy{1, 38, 42};
// ..
// TX1: ~9 / 39
// RX1: ~10 / 40
Uart sfy{1, 40, 39};

void setup()
{
Expand All @@ -27,9 +30,17 @@ void setup()

void loop()
{
static int i = 0;

loop_gps();
Serial.print(".");
delay(50);
delay(100);

JsonDocument doc;
doc["loop"] = i;
serializeJson(doc, sfy);

i++;
}

void main_pps() {
Expand Down

0 comments on commit 28679be

Please sign in to comment.