Docs

RL-GNSS-001 · Navigation · KAMAL NAV GM1

Example code

Small UART and parser snippets for filtering and forwarding GNSS output.

Published May 4, 2026Updated May 9, 2026Reading time ~15 min

01NMEA sentence gate#

#include <stdbool.h>
#include <string.h>

bool raksham_is_fix_sentence(const char *line) {
  return strncmp(line, "$GNRMC", 6) == 0 ||
         strncmp(line, "$GNGGA", 6) == 0 ||
         strncmp(line, "$GNGSA", 6) == 0;
}
c

02Arduino serial bridge#

void setup() {
  Serial.begin(115200);
  Serial1.begin(115200);
}

void loop() {
  while (Serial1.available()) {
    Serial.write(Serial1.read());
  }
  while (Serial.available()) {
    Serial1.write(Serial.read());
  }
}
cpp

03MicroPython NMEA line reader#

from machine import UART

gnss = UART(1, baudrate=115200, tx=17, rx=16)

while True:
    line = gnss.readline()
    if not line:
        continue
    if line.startswith((b"$GNRMC", b"$GNGGA")):
        print(line.decode(errors="ignore").strip())
python
Was this page helpful?Send feedback
Back to top