Arduino + VS Code
I’ve been successful in getting GPS data, and spend time today trying to fine tune how to actually go about and use/store/display that data. I got it to where I was streaming long/lat coordinates continuously… but that doesn’t really help much.
In addition to checking when the GPS data is available, I also wanted to only display the long/lat if a button was pressed. So I’m now in the process of trying to combine a few tutorials together into a single thing.
Note: the pins are a bit loose for the GPS module, so I had to jam something underneath it to ensure contact. Classy.
Additionally, I spent (a lot of) time switching from using the Arduino IDE and getting VS Code set up to where I can do things from there. I used the Microsoft Arduino extension, following along with this tutorial.
Unfortunately, things weren’t super straightforward for me. I ended up having to tweak some of the configuration files, and ran into a problem where I couldn’t select the Serial Port. After a lot of searching and reading, I figured out that rolling back to VS Code 1.4.21 (and disabling auto-updates) got things working again.
The way Arduino code works, there are two main functions: setup() and loop(). Setup is run once at the start, and loop is run continuously… well, forever. Add this to the fact that I really don’t know C++ at all, and it makes for some gnarly code. At least for now, in my first passes.
It’s been slow but pretty interesting so far. Getting a button press signal is easy. Figuring out how to debounce it is a little trickier.
So far I’ve got things working to where if you press the button, and GPS data is available, you’ll see the current long/lat position.
But if you click the button again within a second of the first button press, you’ll see a warning to be a bit patient (adding in a 1 second buffer/delay).
It’s… mostly working. That is to say it’s working on every other button press, which is something I need to dig into. Moving from here to three components (button press causes GPS info to show on an LCD display) is going to be an interesting challenge, both physically and conceptually for me.
Need to get my head around how something like that would be wired up. And also wondering if I need a larger breadboard.
As a final thought: all of this is fun and passes the time. But ultimately this device is meant to be used while wandering outside, which is not something I imagine anyone will be doing for… some time.
Realizing I’m spending a lot of time, indoors, working on a thing that’s ultimately meant to be outdoors.
Reaching out to the Satellites