I'm using U8g2lib to show certain data from GPS sensor on the oled screen.
One of the behaviors I wish to achieve has to do with speed value, coming from this line where GPS distance between points is calculated.
Serial.print(shortestDist, 0);
However, I only want to show 3-digit distance. So if the calculated distance is more than 999 or less than 100, I would like to print some text instead of numbers.
Also, on another part of the OLED I want to print another set of values from the GPS but for aesthetic sake I want the numbers to be aligned to the right, default alignment is to the left.
It's over 700 lines of code that I have, I really didn't want to post that tower only to figure the print function on that one value.
The print works properly and I take few other values from the GPS, for example this one as well
u8g2.print(gps.satellites.value());
So this puts the number of satellites on the screen, and what I'd like to know is how to limit the number displayed on the screen - I don't want any print if it's under double digits, for example. So that's what I was asking how to approach.
I always forget to mention it since I find it redundant but I'm a copy paste newbie and frankly most of the code is just borrowed from other projects on instructable and such, I feel it's big enough of achievement for me when I manage to "merge" them and get them to work in the first place this is a hobby for me, I would love to learn to code, but the desire to finish the project and get it to work always overcomes
Perhaps but I find it bit hard where to look - but with the examples posted here I understand the logic and I just managed to get a lock with the GPS and the code seems to be working! Thanks!