diff options
author | Stanley Huang <stanleyhuangyc@gmail.com> | 2013-09-06 12:12:41 +0800 |
---|---|---|
committer | Stanley Huang <stanleyhuangyc@gmail.com> | 2013-09-06 12:12:41 +0800 |
commit | fa1d3eac1a2450d6c3d945e33b87d84615ff5b7b (patch) | |
tree | bb54b4543e9f1449c766c587f35d718260efb9f2 /megalogger | |
parent | add8ebb1deeedd236af741f9455164c10f88f61e (diff) | |
download | 2021-arduino-obd-fa1d3eac1a2450d6c3d945e33b87d84615ff5b7b.tar.gz 2021-arduino-obd-fa1d3eac1a2450d6c3d945e33b87d84615ff5b7b.tar.bz2 2021-arduino-obd-fa1d3eac1a2450d6c3d945e33b87d84615ff5b7b.zip |
fix LAT/LNG display bug
Diffstat (limited to 'megalogger')
-rw-r--r-- | megalogger/megalogger.ino | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/megalogger/megalogger.ino b/megalogger/megalogger.ino index 5fba25a..8beb80f 100644 --- a/megalogger/megalogger.ino +++ b/megalogger/megalogger.ino @@ -374,10 +374,10 @@ private: lcd.setFont(FONT_SIZE_MEDIUM); char buf[16]; - sprintf(buf, "%d.%ld", (int)(lat / 100000), lat % 100000); + sprintf(buf, "%d.%ld", (int)(lat / 100000), abs(lat) % 100000); lcd.setCursor(50, 18); lcd.print(buf); - sprintf(buf, "%d.%ld", (int)(lon / 100000), lon % 100000); + sprintf(buf, "%d.%ld", (int)(lon / 100000), abs(lon) % 100000); lcd.setCursor(50, 21); lcd.print(buf); int32_t alt = gps.altitude(); |