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.
Dependents: CarPakingSystem_V13
Revision 4:cbc557852061, committed 2021-04-19
- Comitter:
- alanchip
- Date:
- Mon Apr 19 10:09:52 2021 +0000
- Parent:
- 3:ccd49dd0621d
- Commit message:
- 111
Changed in this revision
SSH1106.cpp | Show annotated file Show diff for this revision Revisions of this file |
SSH1106.h | Show annotated file Show diff for this revision Revisions of this file |
--- a/SSH1106.cpp Mon Mar 08 02:33:45 2021 +0000 +++ b/SSH1106.cpp Mon Apr 19 10:09:52 2021 +0000 @@ -186,6 +186,23 @@ } } +void SSH1106::writeTim_format(char column, char page, const char *font_address, const int num) +{ + char str[40]; + int n; + if((num+1)%10 != 0) //if there is a two bit decimal + { + n = sprintf(str,"%d",num); + SSH1106::writeText(column, page, font_address, str, n); + } + else + { + n = sprintf(str," %02d",num); + SSH1106::writeText(column, page, font_address, str, n); + } +} + + //write without size void SSH1106::writeText_format(char column, char page, const char *font_address, const char *text) {
--- a/SSH1106.h Mon Mar 08 02:33:45 2021 +0000 +++ b/SSH1106.h Mon Apr 19 10:09:52 2021 +0000 @@ -87,6 +87,7 @@ void drawbufferLineVert(char posx, char posy, char height, char width); void writeText_format(char column, char page, const char *font_address, const char *text); void writeDec_format(char column, char page, const char *font_address, const int num); + void writeTim_format(char column, char page, const char *font_address, const int num); void clear_page(int column,int page); void fillScreen(); private: