Skip to content

GPS code for arduino - #24

Open
AazamAlam wants to merge 1 commit into
mainfrom
AazamAlam-GPS
Open

GPS code for arduino#24
AazamAlam wants to merge 1 commit into
mainfrom
AazamAlam-GPS

Conversation

@AazamAlam

@AazamAlam AazamAlam commented Oct 6, 2025

Copy link
Copy Markdown
Collaborator

First GPS arduino code version

GPS arduino code with loop() and setup() functions that initializes the SD card and puts data formatted into a single csv file.

The code processes it through a software serial port using UART communication protocol and uses a UBX library to simplify the code syntax and print to the csv file.

I have a more c++ version, but it imports arduino libraries, so not super robust, but I can try to work around that if it is more standard at GTPL.

GPS arduino code with loop() and setup() functions that initializes the SD card and puts data formatted into a single csv file. 

The gps processes it through a software serial port using UART communication protocol and uses a UBX library to simplify the code syntax and print to the csv file.

@AnyiLin AnyiLin left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sorry about the long delay for this. There were two main issues that I found, but otherwise it looks good. First, the delay(100) on line 102 can cause a buffer overflow for Serial. Instead, you should always run gps.read() and only save gps data if gps.ready() is true and 100ms have passed from the last save. Additionally, the gps_data.csv file already exists, then you may be writing in an extra header line in the middle of the file. Instead, we should probably delete the contents of the file every time we initialize the gps, since it will likely be different launches.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants