Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
Dependencies: FatFileSystem MSCFileSystem SPI_TFTx2 TFT_fonts TOUCH_TFTx2 beep mbed
Fork of CANary_corrupt by
Diff: displayModes.cpp
- Revision:
- 93:c2402e8cd0e2
- Parent:
- 92:935adef49ea4
- Child:
- 94:c3a14b3975d6
--- a/displayModes.cpp Mon Apr 22 02:27:37 2013 +0000 +++ b/displayModes.cpp Wed May 01 03:02:59 2013 +0000 @@ -865,8 +865,16 @@ tt.set_font((unsigned char*) SCProSB31x55); tt.foreground(Green); if (showMiles){ + float miles = mpkWh[dtePeriod]*((float)(gids-5)*.075); tt.locate(160,8); - printf("%4.1f \n",mpkWh[dtePeriod]*((float)(gids-5)*.075)); + // Right justify + if (miles>99.9){ + printf("%4.1f \n",miles); + } else if (miles>9.9){ + printf(" %3.1f \n",miles); + } else { + printf(" %2.1f \n",miles); + } } else { tt.locate(180,10); printf("%3.1f \n",mpkWh[dtePeriod]);