hello people,
i want to display the latitude and longitude gotten from a ublox neo 6m on a ssd1306 i2c 0.96 oled display using an arduino uno r3.
i write the code and hope that it will work on the first try but i spend more than two hour try to get it work,
the problem is : instead of displaying the coordinates ,i can only see 0.00 in the both coordinates, all the other things are displayed correctly in there places.
i tried the gps wiring by testing it with the example that send the coordinates over the serial port and all worked fine.
please can someone help me to display the coordinates on the screen.
First of all, a suggestion: it's easier to give an opinion on your code if you abstain from uploading a code that is mostly sizes, colours etc etc... keep it short and simple
Second of all, before adding a display to your project, see if it works with the serial monitor: you'll discover that this is not a "display problem", but a "programming problem" (meaning, the display shows what the code lets it show).
tinygps outputs are most of the times empty/nulls. If you print them with a too fast/too slow refresh, you'll surely miss the actual, valid outputs.
if (gps.location.isUpdated())
{
display.println(gps.location.lat(), 6);
}
This code does the very same job, but instead of printing the latitude every X millis, it prints the latitude when and only when the latitude is valid and updated.
As you can see, you can also choose how many digits you may want to print, depending on the accuracy of your gps module and how big is your display.
Last but not least, if you want to "write a sketch, get it working on the first try and spending less that 2 hours fixing it", you are pretending too much and giving up too early. It took me more than a week to get my gps logger up and running.
Next time, try checking the libraries examples beforehand: tinygps++ covers such problems on at least 2 examples
NICOLA_FU you have been too precipitous in your judgment. Actually there is an incomatibilità between the libraries of the GPS and those of the SSD1306 Oled display that I found a few days when I tried to put together the two devices.
The next time ascertained before making judgments.
Now it would be important to find a solution.